(Ant) writes:
> I noticed my Terminal's top command shows virtual memory really big like
> about 200 GB. I tried rebooting the updated 64-bit Mac OS X 10.7.4, but
> it is still big like shown in http://pastie.org/4379346 (wide screen
> recommended) even if I don't have anything running (e.g., VMware Fusion
> v7.1.4) except the background startups, Terminal, and top command.
>
> Is this normal? Does it really need a huge virtual memory size? This is
> on a month old Mac Mini (late 2011 model) with 4 GB of RAM.
>
> Thank you in advance.
VSIZE over the whole system doesn't really measure an exhaustible
resource. Within one process it reflects address space usage, which is
comparatively easy to run out of for a 32-bit process, but rather hard
to do for a 64-bit process.
Still, the VSIZE figure reported per process does show some curious
inconsistencies. For instance this process is supposedly using well
over 2GB of address space:
$ ps -o pid,comm,rss,vsize -p 7110
PID COMM RSS VSZ
7110 -bash 832 2435492
Yet adding up its memory mappings yields only about 5% of that figure:
$ vmmap 7110 |perl -ne '/([0-9a-f]{16})-([0-9a-f]{16})/ && ($tot += hex($2)-hex($1)); END { print $tot/1024,"\n"; }'
127744
Possibly vmmap is hiding mappings that support none of read, write or
execute. These can amount to a lot - for instance on a 64-bit Linux
system there is a 2MB PROT_NONE mapping for every shared library used by
a process, potentially hugely inflating the reported VSIZE.
--
http://www.greenend.org.uk/rjk/