[opensuse] top reporting %mem incorrectly?
This morning when I logged into my computer, I noticed that my system monitor was saying that I was using up ~6GB of memory, so I decided to fire up top and see what was using it. And I noticed something - the %mem fields look really off. For example, Chrome is using ~1G, and it says that's 10.7% of memory. But, Virtualbox is using ~1.3G, and it says that it's only using 0.5% of memory? I thought, well, maybe it's just showing the percentage used by that individual process but the amount of all of the processes with the same name, but nope, there's only one VirtualBox process running. Is this a bug, or is something else going on? I'm running 32-bit oS 12.3 with 8GB of memory. Chris top - 08:59:14 up 5 days, 1:01, 3 users, load average: 0.38, 0.44, 0.50 Tasks: 237 total, 1 running, 235 sleeping, 0 stopped, 1 zombie %Cpu(s): 2.6 us, 1.5 sy, 0.1 ni, 95.8 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st KiB Mem: 7916552 total, 6757444 used, 1159108 free, 168268 buffers KiB Swap: 2097148 total, 37484 used, 2059664 free, 1259212 cached VIRT RES SHR %MEM COMMAND 1047m 824m 42m 10.7 chrome 720m 385m 22m 5.0 kded4 516m 357m 53m 4.6 Xorg 906m 294m 43m 3.8 firefox 408m 192m 10m 2.5 simias 836m 189m 46m 2.4 chrome 456m 177m 65m 2.3 plasma-desktop 1277m 106m 14m 1.4 java 331m 87m 31m 1.1 chrome 343m 87m 24m 1.1 plugin-containe 287m 86m 18m 1.1 chrome 271m 69m 24m 0.9 chrome 374m 65m 24m 0.9 krunner 351m 61m 24m 0.8 kwin 536m 60m 2680 0.8 mysqld 259m 59m 24m 0.8 chrome 246m 56m 23m 0.7 chrome 371m 52m 21m 0.7 pidgin 335m 50m 22m 0.7 chrome 2778m 50m 50m 0.7 systemd-journal 392m 44m 20m 0.6 mono 1310m 37m 0 0.5 VirtualBox -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On Wed, Sep 25, 2013 at 10:08 AM, Christopher Myers <cmyers@mail.millikin.edu> wrote:
This morning when I logged into my computer, I noticed that my system monitor was saying that I was using up ~6GB of memory, so I decided to fire up top and see what was using it. And I noticed something - the %mem fields look really off. For example, Chrome is using ~1G, and it says that's 10.7% of memory. But, Virtualbox is using ~1.3G, and it says that it's only using 0.5% of memory? I thought, well, maybe it's just showing the percentage used by that individual process but the amount of all of the processes with the same name, but nope, there's only one VirtualBox process running.
Is this a bug, or is something else going on?
I'm running 32-bit oS 12.3 with 8GB of memory.
Chris
top - 08:59:14 up 5 days, 1:01, 3 users, load average: 0.38, 0.44, 0.50 Tasks: 237 total, 1 running, 235 sleeping, 0 stopped, 1 zombie %Cpu(s): 2.6 us, 1.5 sy, 0.1 ni, 95.8 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st KiB Mem: 7916552 total, 6757444 used, 1159108 free, 168268 buffers KiB Swap: 2097148 total, 37484 used, 2059664 free, 1259212 cached
VIRT RES SHR %MEM COMMAND 1047m 824m 42m 10.7 chrome 720m 385m 22m 5.0 kded4 516m 357m 53m 4.6 Xorg 906m 294m 43m 3.8 firefox 408m 192m 10m 2.5 simias 836m 189m 46m 2.4 chrome 456m 177m 65m 2.3 plasma-desktop 1277m 106m 14m 1.4 java 331m 87m 31m 1.1 chrome 343m 87m 24m 1.1 plugin-containe 287m 86m 18m 1.1 chrome 271m 69m 24m 0.9 chrome 374m 65m 24m 0.9 krunner 351m 61m 24m 0.8 kwin 536m 60m 2680 0.8 mysqld 259m 59m 24m 0.8 chrome 246m 56m 23m 0.7 chrome 371m 52m 21m 0.7 pidgin 335m 50m 22m 0.7 chrome 2778m 50m 50m 0.7 systemd-journal 392m 44m 20m 0.6 mono 1310m 37m 0 0.5 VirtualBox
The percentage of RAM used does not include VIRT (virtual), only RES (resident). The delta between VIRT and RES has either never be swapped in, or it has been swapped out. Specifically when you start a large program like VirtualBox only one RAM page is allocated. When execution starts it starts making calls to other pages. Those pages are pulled in only as needed. They then sit in RAM until swapped out. I would guess you just launched VirtualBox and it hadn't used much code/data space yet. Greg -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Ah cool, that makes sense, I figured that %mem was the total of all of the memory being used, not just a subset of it. Still though, it's odd that VBox is only using 37m of memory when it's been running a win7 VM with 2G of memory for nearly a week; maybe it's sitting idle enough to allow its memory to be swapped out? Chris
Greg Freemyer 09/25/13 9:28 AM >>> On Wed, Sep 25, 2013 at 10:08 AM, Christopher Myers wrote: This morning when I logged into my computer, I noticed that my system monitor was saying that I was using up ~6GB of memory, so I decided to fire up top and see what was using it. And I noticed something - the %mem fields look really off. For example, Chrome is using ~1G, and it says that's 10.7% of memory. But, Virtualbox is using ~1.3G, and it says that it's only using 0.5% of memory? I thought, well, maybe it's just showing the percentage used by that individual process but the amount of all of the processes with the same name, but nope, there's only one VirtualBox process running.
Is this a bug, or is something else going on?
I'm running 32-bit oS 12.3 with 8GB of memory.
Chris
top - 08:59:14 up 5 days, 1:01, 3 users, load average: 0.38, 0.44, 0.50 Tasks: 237 total, 1 running, 235 sleeping, 0 stopped, 1 zombie %Cpu(s): 2.6 us, 1.5 sy, 0.1 ni, 95.8 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st KiB Mem: 7916552 total, 6757444 used, 1159108 free, 168268 buffers KiB Swap: 2097148 total, 37484 used, 2059664 free, 1259212 cached
VIRT RES SHR %MEM COMMAND 1047m 824m 42m 10.7 chrome 720m 385m 22m 5.0 kded4 516m 357m 53m 4.6 Xorg 906m 294m 43m 3.8 firefox 408m 192m 10m 2.5 simias 836m 189m 46m 2.4 chrome 456m 177m 65m 2.3 plasma-desktop 1277m 106m 14m 1.4 java 331m 87m 31m 1.1 chrome 343m 87m 24m 1.1 plugin-containe 287m 86m 18m 1.1 chrome 271m 69m 24m 0.9 chrome 374m 65m 24m 0.9 krunner 351m 61m 24m 0.8 kwin 536m 60m 2680 0.8 mysqld 259m 59m 24m 0.8 chrome 246m 56m 23m 0.7 chrome 371m 52m 21m 0.7 pidgin 335m 50m 22m 0.7 chrome 2778m 50m 50m 0.7 systemd-journal 392m 44m 20m 0.6 mono 1310m 37m 0 0.5 VirtualBox
The percentage of RAM used does not include VIRT (virtual), only RES (resident). The delta between VIRT and RES has either never be swapped in, or it has been swapped out. Specifically when you start a large program like VirtualBox only one RAM page is allocated. When execution starts it starts making calls to other pages. Those pages are pulled in only as needed. They then sit in RAM until swapped out. I would guess you just launched VirtualBox and it hadn't used much code/data space yet. Greg -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On Wed, Sep 25, 2013 at 10:40 AM, Christopher Myers <cmyers@mail.millikin.edu> wrote:
Ah cool, that makes sense, I figured that %mem was the total of all of the memory being used, not just a subset of it.
Still though, it's odd that VBox is only using 37m of memory when it's been running a win7 VM with 2G of memory for nearly a week; maybe it's sitting idle enough to allow its memory to be swapped out?
Getting beyond my knowledge. You only have 2GB of swap setup and it is barely used:
top - 08:59:14 up 5 days, 1:01, 3 users, load average: 0.38, 0.44, 0.50 Tasks: 237 total, 1 running, 235 sleeping, 0 stopped, 1 zombie %Cpu(s): 2.6 us, 1.5 sy, 0.1 ni, 95.8 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st KiB Mem: 7916552 total, 6757444 used, 1159108 free, 168268 buffers KiB Swap: 2097148 total, 37484 used, 2059664 free, 1259212 cached
A question for the group: When a executable / shared object (library) is first launched the file in the file system is used as the backing store and any page faults trying to access that code causes the page to be brought in from the file itself. Once a code page has been paged in that way and is later swapped out, does it go to the swap space, or is the original file still used as the backing store? Greg -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
В Wed, 25 Sep 2013 10:57:59 -0400 Greg Freemyer <greg.freemyer@gmail.com> пишет:
On Wed, Sep 25, 2013 at 10:40 AM, Christopher Myers <cmyers@mail.millikin.edu> wrote:
Ah cool, that makes sense, I figured that %mem was the total of all of the memory being used, not just a subset of it.
Still though, it's odd that VBox is only using 37m of memory when it's been running a win7 VM with 2G of memory for nearly a week; maybe it's sitting idle enough to allow its memory to be swapped out?
Getting beyond my knowledge. You only have 2GB of swap setup and it is barely used:
top - 08:59:14 up 5 days, 1:01, 3 users, load average: 0.38, 0.44, 0.50 Tasks: 237 total, 1 running, 235 sleeping, 0 stopped, 1 zombie %Cpu(s): 2.6 us, 1.5 sy, 0.1 ni, 95.8 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st KiB Mem: 7916552 total, 6757444 used, 1159108 free, 168268 buffers KiB Swap: 2097148 total, 37484 used, 2059664 free, 1259212 cached
A question for the group:
When a executable / shared object (library) is first launched the file in the file system is used as the backing store and any page faults trying to access that code causes the page to be brought in from the file itself.
Once a code page has been paged in that way and is later swapped out, does it go to the swap space, or is the original file still used as the backing store?
read-only parts (code etc) are never swapped out, pages are simply reused. read-write parts are of course swapped out if needed.
Greg
-- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Greg Freemyer wrote:
On Wed, Sep 25, 2013 at 10:40 AM, Christopher Myers <cmyers@mail.millikin.edu> wrote:
Ah cool, that makes sense, I figured that %mem was the total of all of the memory being used, not just a subset of it.
Still though, it's odd that VBox is only using 37m of memory when it's been running a win7 VM with 2G of memory for nearly a week; maybe it's sitting idle enough to allow its memory to be swapped out?
Getting beyond my knowledge. You only have 2GB of swap setup and it is barely used:
top - 08:59:14 up 5 days, 1:01, 3 users, load average: 0.38, 0.44, 0.50 Tasks: 237 total, 1 running, 235 sleeping, 0 stopped, 1 zombie %Cpu(s): 2.6 us, 1.5 sy, 0.1 ni, 95.8 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st KiB Mem: 7916552 total, 6757444 used, 1159108 free, 168268 buffers KiB Swap: 2097148 total, 37484 used, 2059664 free, 1259212 cached
A question for the group:
When a executable / shared object (library) is first launched the file in the file system is used as the backing store and any page faults trying to access that code causes the page to be brought in from the file itself.
Once a code page has been paged in that way and is later swapped out, does it go to the swap space, or is the original file still used as the backing store?
Interesting question - I would have thought a library page would be read-only, and hence not paged/swapped out, but thrown away. -- Per Jessen, Zürich (16.8°C) http://www.dns24.ch/ - free DNS hosting, made in Switzerland. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
El 25/09/13 11:08, Christopher Myers escribió:
This morning when I logged into my computer, I noticed that my system monitor was saying that I was using up ~6GB of memory, so I decided to fire up top and see what was using it. And I noticed something - the %mem fields look really off. For example, Chrome is using ~1G, and it says that's 10.7% of memory. But, Virtualbox is using ~1.3G, and it says that it's only using 0.5% of memory? I thought, well, maybe it's just showing the percentage used by that individual process but the amount of all of the processes with the same name, but nope, there's only one VirtualBox process running.
Is this a bug, or is something else going on?
To determine the amount of memory used in a more realistic way, use "pmap -X <pid>" and read the PSS column. -- "Judging by their response, the meanest thing you can do to people on the Internet is to give them really good software for free". - Anil Dash -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Hmm, the version of pmap on my computer doesn't have an X option: chrismyers:/home/cmyers # pmap -X 19180 pmap: invalid option -- 'X' usage: pmap [options] pid [...] -d, --device display offset and device numbers -q, --quiet hide header and memory statistics -A, --limit=low,high limit results to the given range -V, --version display version information -h, --help display this help but runs without it specified. Since we've been talking about virtualbox in this case, here is the output from pmap: 63012K writable-private, 93212K readonly-private, 1181444K shared, and 1152128K referenced while top's output says: PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 19180 root 20 0 1306m 33m 0 S 9.6 0.4 342:47.58 VirtualBox (I'm more curious than anything ;) I've been using openSuSE (at home and work) and SLES (at work) for about 6 years now, and while I've learned a ton, there's sooooo much still to learn :) ) -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
participants (5)
-
Andrey Borzenkov
-
Christopher Myers
-
Cristian Rodríguez
-
Greg Freemyer
-
Per Jessen