java has a tool jmap which is used to investigate various memory state of JVM. what i want to learn is how exactly this tool works? Can i get a source code for it?
i am assuming that implementation of jmap is dependent on the system it runs on. i am running a mac os X.
can someone guide me how can i learn this?Can someone point me to the right direction?
why i want to learn this? just curious ...
thanks in advance
SCJP 1.4, SCWCD 1.4
your eyes cannot see what your mind does not know
I too am curious how this is implemented for practical reasons. We run software that is running out of memory at 10GB. Just after startup the smallest heap footprint I can get seems to be around 3.5 GB. I have tried opening with eclipse MAT, yourkit and jhat to no avail (they all seem to like to try to use about 80% of the heap size on top of the memory used to load the .hprof file wholesale). I am hoping to find a way to break the file in managable chunks or write a jhat tool that lazily loads some of this huge pill of data. Anyway, so far I have run into this site http://www.java2s.com/Open-Source/Java-Document/6.0-JDK-Modules-sun/tools/sun/tools/jmap/JMap.java.htm which at least gives an idea of where to look in the openJDK and lists the code of the JMap class itself. I will post more as I find it.