Friday 11 January 2008

OS X pmap

Looking for something like Solaris' 'pmap' on OS X? Try 'vmmap' from the terminal window. It outputs the per-segment memory usage, and all the usual stuff like which libraries are mapped, and where. The final section gives a nice summary. The o/p below is from Firefox, which was using over 700Mb of pysical RAM. I am currently experimenting with Flock, which supposedly has better memory management. I think the first issue I might have is that I use the 1Passwd utility pretty heavily, and I do not know if it is supported in the flock browser.


==== Summary for process 1473
ReadOnly portion of Libraries: Total=130.6M resident=44.2M(34%) swapped_out_or_unallocated=86.3M(66%)
Writable regions: Total=1.8G written=1.0G(53%) resident=875.7M(46%) swapped_out=552.6M(29%) unallocated=1.0G(54%)

REGION TYPE [ VIRTUAL]
=========== [ =======]
ATS (font support) [ 33.9M]
CG backing stores [ 11.9M]
CG raster data [ 2084K]
CG shared images [ 3208K]
Carbon [ 1464K]
CoreGraphics [ 328K]
IOKit [ 256.0M]
Java [ 161.0M]
MALLOC [ 1.3G]
Mach message [ 8K]
Memory tag=240 [ 4K]
STACK GUARD [ 56.3M]
Stack [ 20.0M]
VM_ALLOCATE ? [ 16.6M]
__DATA [ 7780K]
__DATA/__OBJC [ 32K]
__IMAGE [ 1240K]
__IMPORT [ 852K]
__LINKEDIT [ 12.6M]
__OBJC [ 2296K]
__PAGEZERO [ 4K]
__TEXT [ 118.0M]
__UNICODE [ 532K]
mapped file [ 103.5M]
shared memory [ 50.1M]
shared pmap [ 4124K]