0

I've done some search out there but couldn't find too much really helpful info on it, but could someone try to explain the basic of Java memory maps? Like where/how to use it, it's purpose, and maybe some syntax examples (inputs/outputs types)? I'm taking a Java test soon and this could be one of the topics, but through all of my tutorials Jmap has not come up. Thanks in advance

Edit: I'm referring to the tool: jmap

trflach
  • 98
  • 1
  • 8
  • So you might be tested on something you've never been taught? ಠ_ಠ – Matt Ball Jan 03 '12 at 19:42
  • Do you just want to know about the program *jmap*, or...? – someguy Jan 03 '12 at 19:43
  • @1 yea...imagine that lol. Actually it's been all self taught. Trying to test out of the Java1 class into Java2. Switching majors sucks. @2, idk? how to use the command? I'm (wrongly?) assuming its a built in feature/command. – trflach Jan 03 '12 at 19:44
  • Do you mean Java's memory model? Like how garbage collection works in general and what memory sections there are? Or is it more the profiling part? – Thomas Jan 03 '12 at 19:44
  • like the command: http://docs.oracle.com/javase/1.5.0/docs/tooldocs/share/jmap.html – trflach Jan 03 '12 at 19:46
  • Are you talking about the tool `jmap` or using memory mapping in Java because they are completely different? You should be able to a quick search on both to have some idea of what they do and how to use them. – Peter Lawrey Jan 03 '12 at 19:46
  • referring to the tool, and I was unable to find any definitive thing – trflach Jan 03 '12 at 19:48

1 Answers1

1

I would read the man page you have referenced.

jmap prints shared object memory maps or heap memory details of a given process or core file or a remote debug server.

NOTE: This utility is unsupported and may or may not be available in future versions of the JDK. In Windows Systems where dbgeng.dll is not present, 'Debugging Tools For Windows' needs to be installed to have these tools working. Also, PATH environment variable should contain the location of jvm.dll used by the target process or the location from which the Crash Dump file was produced.

http://docs.oracle.com/javase/7/docs/technotes/tools/share/jmap.html

Its not a tool to be played with lightly. You need a good profiler which can read it output as jhat is only useful for trivial programs. (YourKit works just fine for 1+ GB heaps)

Community
  • 1
  • 1
Peter Lawrey
  • 525,659
  • 79
  • 751
  • 1,130
  • I understand that it is supposed to show the details on many of the variables/objects that your program created, but what would you run this against. Btw, I'm completely new to Java (well 2 weeks old) so this kind of thing is new. – trflach Jan 03 '12 at 19:54
  • And you want to know about a very low level tool even Oracle describe as "experimental" and "unsupported" I know professional developers who haven't used it in ten years of Java development. – Peter Lawrey Jan 03 '12 at 19:57
  • Basically it dumps the state of all the objects and their fields, but not the local variables of threads. I would use YourKit to read the dump, but in theory you can use `jhat` to read it but its a bit of nightmare if you have more than a very small number of objects. – Peter Lawrey Jan 03 '12 at 19:58
  • Thanks! but hey, its not me who's just dying to know this. My school's test *might* have it, so I was just looking into it. I have a C background, so these low level things aren't at all brand new either. – trflach Jan 03 '12 at 20:01
  • @trflach, its a bit like a core dump, but without a gdb to read it easily. – Peter Lawrey Jan 03 '12 at 20:14