LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-24-2007, 10:20 PM   #1
Lothar Schwab
LQ Newbie
 
Registered: Aug 2007
Location: Minnesota, USA
Distribution: Lubuntu
Posts: 19

Rep: Reputation: 2
Apps have high virtual memory consumption


Compared to many non .NET and non Java applications on
windows I see that UI apps on my Ubuntu system often
show a high virtual memory consumption and also a high
resident memory portion. Nautilus for instance is often
at around 100MB virtual memory space and Firefox show
an even higher memory footprint.

Why is this so? Do these applications use statically
linked libraries more often than typical windows
applications?

Is it that the open source applications are not optimized
for a low footprint?

Have you made similar observations?
 
Old 08-24-2007, 10:55 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
No, they don't use statically linked libs. However, the output
of top will report the same lib for each app that uses it, and
moreover it will report the *potential* size, in other words it
will make as if every single library that may be inherited some-
where along the line (whether any of the functions it may provide
are being used or not, and without regard whether to it being
actually loaded or not) needs to be represented in the vsize.



Cheers,
Tink
 
Old 08-25-2007, 07:05 AM   #3
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,649
Blog Entries: 4

Rep: Reputation: 3934Reputation: 3934Reputation: 3934Reputation: 3934Reputation: 3934Reputation: 3934Reputation: 3934Reputation: 3934Reputation: 3934Reputation: 3934Reputation: 3934
There are several relevant issues that any good operating system (OS) will consider, even though their designers may choose to report them to the user in different ways:

(1) Avoiding resource over-commitment: If you admit another unit-of-work into your system, you do not want to have "bitten off more than you can chew," and you cannot afford to discover the problem after-the-fact. Linux systems often run continuously for months and years, driving as much workload as they choose to accept. The OS needs to be able to predict the worst case.

(2) Accounting for shared resources: Every system has, somewhere, a pantheon of literally hundreds of libraries which programs open and use, from the venerable glibc right on down. No matter how many programs have the library open, they're all sharing the same copy: all of their virtual-memory address spaces are mapping the same pages.
  • This creates another sort of over-commitment issue (glibc pages might have hundreds of "demand"ers, whereas my.first.program's pages will have only one: we don't want to "starve" a guy's first program out of having enough memory, yet we don't want to be paging glibc too much because that affects everybody.
  • How do you report those shared resources when the user asks the innocent question, "how much memory is my.first.program using?" He thinks he's asking a simple question: he wants a simple answer. Do you include the shared resources, or not?

(3) "Laziness": A memory-management system won't do any work that it doesn't have to. If there is currently no pressure on the memory system, it won't go out of its way to page anything out. After all, someone might need those pages to be here a few milliseconds from now, and right no one in particular is insisting that they be gone (to make room for something else). So the memory manager just "catches a few more winks."
  • This "laziness principle" is very important for, say, a CGI-based web server, which "runs a program" for every request that comes in. The program ends, so its address-space becomes "unused," but the memory-manager doesn't sweep it out the door because... Lo! Here comes another request, for the same program! Reattach to the same program-pages (they're still here), allocate a new empty data-segment and stack-segment, and we're ready to go (again).
 
Old 08-25-2007, 08:41 PM   #4
Lothar Schwab
LQ Newbie
 
Registered: Aug 2007
Location: Minnesota, USA
Distribution: Lubuntu
Posts: 19

Original Poster
Rep: Reputation: 2
Comparison

I am too new to Linux to know for sure what the
"Virtual Memory" column in "System Monitor" really
means. The great thing about open source is that
it is only myself preventing me from finding out

But my initial question is actually misleading. These
comparatively high values have nothing to do with
Linux itself. It is only X based gnome applications
that show these high values. So it might simply be
that a bunch of libraries in this area have a very
large code set for which considerable virtual address
range is reserved to map them in when needed. And maybe very
little of this code is actually needed (the actually
resident amount of memory is much less).

The actual issue could therefore be that libraries
are just packaged in larger granularities than this
is typically done on windows systems.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Memory Consumption of 10.2 naparhi Slackware 4 08-27-2006 03:10 AM
process memory consumption ilnli Linux - General 4 09-08-2005 07:13 PM
Tips on reducing memory consumption Boyer Linux - Software 13 01-17-2005 03:20 PM
Slackware memory consumption muhkuhmasta Slackware 5 07-15-2004 05:51 AM
high memory consumption and slow speed ryancw Linux - Newbie 1 03-24-2004 09:10 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:10 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration