Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

pmap shows that Dropbox uses nearly 200MB of memory (on Linux). When I run Dropbox on Windows, it only uses about 30MB of memory. What is the reason for that?

Also, why are there so many [ anon ] ranges that occupy so much memory according to pmap output?

[mirror@home Dropbox]$ pgrep dropbox
9544

9544:   /home/mirror/.dropbox-dist/dropbox
08048000   3028K r-x--  /home/mirror/.dropbox-dist/dropbox
0833d000    248K rw---  /home/mirror/.dropbox-dist/dropbox
0837b000     52K rw---    [ anon ]
08c20000  15688K rw---    [ anon ]
ad052000   1028K rw---    [ anon ]
ad1d4000   1024K rw---    [ anon ]
ad3d4000   1024K rw---    [ anon ]
ad5d4000      4K -----    [ anon ]
ad5d5000  10240K rw---    [ anon ]
adfd5000      4K -----    [ anon ]
adfd6000  10240K rw---    [ anon ]
ae9d6000      4K -----    [ anon ]
ae9d7000  10240K rw---    [ anon ]
af3d7000      4K -----    [ anon ]
af3d8000  10240K rw---    [ anon ]
afdd8000      4K -----    [ anon ]
afdd9000  10240K rw---    [ anon ]
b07d9000      4K -----    [ anon ]
b07da000  10240K rw---    [ anon ]
b11da000      4K -----    [ anon ]
b11db000  10240K rw---    [ anon ]
b1bdb000      4K -----    [ anon ]
b1bdc000  10240K rw---    [ anon ]
b25dc000      4K -----    [ anon ]
b25dd000  10240K rw---    [ anon ]
b2fdd000      4K -----    [ anon ]
b2fde000  10240K rw---    [ anon ]

........

b7fc6000      4K rw---  /lib/libpthread-2.5.so
b7fc7000     12K rw---    [ anon ]
b7fca000      4K r-x--  /home/mirror/.dropbox-dist/_bisect.so
b7fcb000      4K rw---  /home/mirror/.dropbox-dist/_bisect.so
b7fcc000     20K r-x--  /home/mirror/.dropbox-dist/_struct.so
b7fd1000      4K rw---  /home/mirror/.dropbox-dist/_struct.so
b7fd2000    108K r-x--  /lib/ld-2.5.so
b7fed000      4K r----  /lib/ld-2.5.so
b7fee000      4K rw---  /lib/ld-2.5.so
bfa77000    156K rw---    [ stack ]
 total   194620K
share|improve this question

1 Answer 1

pmap displays the virtual memory of a process – that is, not only locations where the process stores data and stack, but also dynamically loaded libraries, memory-mapped files, shared memory, and so on. Very few of those actually contribute to the resident or shared segments, which would represent actual resource usage.

In other words, you are looking at the wrong numbers. For "memory usage", look at the "RSS" field in ps, or "RES" in top/htop.

For example, Dropbox on my system is about 38 MB, even though its virtual memory space is over 1.7 GB.

share|improve this answer
    
what is virtual memory? physical memory + swap space? –  hugemeow Sep 6 '12 at 18:41
1  
@hugemeow: No – it's the memory address space of a process. (Processes cannot access RAM or swap directly – they can only access "virtual" addresses, which the kernel translates to RAM/swap belonging to that process, RAM/swap belonging to shared libraries, data in a mmap()ed file, or something else. Every process has a separate virtual address space of its own.) –  grawity Sep 6 '12 at 18:55
    
so is there a lot of parts that constitue process's memory, for example stack, heap, shared space(which can be used by many process, right?) –  hugemeow Sep 6 '12 at 19:03
    
@hugemeow: Right. (Other parts are the "code" (the program itself), various kinds of "memory-mapped files", and probably some other parts that I forget.) Only some parts actually "use" your RAM/swap. –  grawity Sep 6 '12 at 19:12

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.