File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes How jmap is implemented? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "How jmap is implemented?" Watch "How jmap is implemented?" New topic
Author

How jmap is implemented?

Anuj Troy
Ranch Hand

Joined: Apr 07, 2005
Posts: 30
hi

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
Craig LaValle
Greenhorn

Joined: Sep 18, 2007
Posts: 3

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.
Craig LaValle
Greenhorn

Joined: Sep 18, 2007
Posts: 3

Found a very interesting blog on jhat as well:

http://ordinaryjava.blogspot.com/2008/04/hacking-jhat-api-to-integrate-it-to-my.html
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: How jmap is implemented?
 
Similar Threads
which tool is good to learn for java developers, welcome suggestions.
How to take memory heap dump snapshot in java
Heap Dump in jdk1.4.2
get heap.bin from glassfish
Getting a heap dump