Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Nautilus is taking up 450 MiB according to System Monitor (Ubuntu 10.04).

$pmap <PID of Nautilus>
...
total          1578276K

Is pmap reporting 1.5 GiB of memory here? I'm trying to find out what's taking up the 450 MiB so I can deduce what I'm doing wrong, or where the problem lies.

share|improve this question

1 Answer 1

up vote 3 down vote accepted

There's no simple notion of how much memory is used by a program.

The output of pmap describes all the virtual memory that's mapped by a process. Mapped means that the process can access that data through a pointer, without issuing any further command to load data or request access. Mapped virtual memory isn't always in RAM: it can be swapped out, and it can be in a file. For example, all the shared libraries that are used by a program are mapped in each process that uses them, but (for the most part) only one copy is kept in RAM for the whole system, and that copy need not be fully loaded in memory (parts that are required will be loaded from the disk file on when needed). The 1.5GB figure includes all of the process's code, static data, shared memory and own data. It's not a very meaningful figure.

pmap is a simple reformatting of /proc/$pid/maps. Understanding Linux /proc/id/maps explains what the columns mean.

The 450MB figure is (I think) the process's resident set, that is, the non-shared memory that is currently in RAM. This includes both data that belongs only to the process (and which may get swapped out), and files that the process has opened for writing (disk buffers, which may be evicted to be reloaded later from the file).

You won't easily be able to break down the 450MB memory further. This is a job for the program's author, with debugging tools.

share|improve this answer
    
Can I pmap or a similar command to see whats in the process's resident set? I dont think the swaps being used (swapoff -a leaves the 450 MiB in System Monitor unchanged...) –  propaganda Jan 15 '12 at 19:59
    
@propaganda It'll be moslty what doesn't have a file in the pmap output. You can't analyse further without looking at the program's source code and examining various variables with a debugger. –  Gilles Jan 15 '12 at 20:03
    
perhaps relevant is that I often get the error "firefox is already running" after closing all open windows of firefox, waiting and trying to start the browser (which I solve by killing the running firefoxbin) –  propaganda Jan 15 '12 at 22:13
    
@propaganda I don't see the connection. If you're sure you don't have a hidden Firefox window, that would be a Firefox bug. –  Gilles Jan 15 '12 at 22:19

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.