1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142
|
JMP is a profiler for java that can be used to trace objects usage and
method timings. JMP uses the JVMPI interface to gather statistics and
interact with the JVM. JMP uses a GTK+ interface to show the status.
JMP normally uses one window to show the classes in memory. Each
class has summary information for number of instances and total bytes
of used memory for all the instances.
JMP can perform heap analysis and has the ability to show which
objects own (have references to) all the objects of a specified
class. This is a great way to find memory leaks.
JMP also shows method timings and calls in another window. Several
columns show time taken in the method, number of calls to each method,
time taken in methods called.
JMP collects information about which method are called and from
where, this information is used to build call graphs.
JMP uses one extra thread to be able to drive the GTK+ interface, with
a timer to systematically update the stats.
JMP is written in C, it is designed for speed.
Mailing list:
The easiest way to contact the developers and users of jmp is to
use the mailing lists:
jmp-user@khelekore.org - for questions on running jmp, success stories etc.
jmp-devel@khelekore.org - for bugs, feature requests etc.
Reporting bugs:
Send an email to jmp-devel@khelekore.org. Please supply as detailed
information as possible. The basic information should at least
contain:
- Operating system
- The result of an 'java -version' or similar
- Version of jmp
- special startup flags to jmp
- What you were trying to do
- What happened
It is very helpful if you can compile jmp with tracing enabled and
supply the information it gives (or at least the last text generated
by tracing).
Requesting features:
Send an email to jmp-devel@khelekore.org and request the features you are
missing. I try to develop the functions I want and need. Cool features
are good to have...
Patches should go to:
Well please support the project by dropping a patch (diff -u or so) to
jmp-devel@khelekore.org. I want jmp to compile with -Wall so please try to
do that too.
installing:
The short way is the standard
./configure && make install
Or try the "make install-to-java" which will try to install jmp right next to
hprof (SUN's standard profiler).
Building without gtk:
Jmp can be build and run without gtk. This can be useful for
servers. Currently the only alternative to gtk is the noui which means
that you have to run jmp with a dumptimer like:
"java -Xrunjmp:dumptimer=3600 my.fine.Program" which will output a
file once every hour. To build jmp without gtk add the "--enable-noui"
to the configure parameters: "./configure --enable-noui"
Special configuration options:
Normally you should not need this. If configure cant find the jdk you
use check that JAVA_HOME is set correctly.
You can use the "--with-includes=dirs " to specify where the jdk is located
orc> ./configure --with-includes='/usr/local/jdk/include /usr/local/jdk/include/linux'
Special LDFLAGS needed
jmp tries to use pkg-config to find current gtk include files and
libraries. Since jmp is in itself a shared library it needs to use the
R flag for linking. So if you can build it but not run it check that
the libjmp is correctly linked. Something like "ldd .libs/libjmp.so"
should not show anything like file not found
Performance:
For optimal performance set your CFLAGS to O3 and give your cpu type,
something like:
CFLAGS='-O3 -march=pentiumpro' ./configure
should give you a faster profiler
With full optimization my test is about 2 (out of 38) seconds faster.
debugging:
To turn on debbuging information try configuring with:
CFLAGS='-DJMPDEBUG -g' ./configure && make clean install
Running:
Make sure your LD_LIBRARY_PATH includes the directory where libjmp.so
is located:
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
java -Xrunjmp my.fine.java.Program
java -Xrunjmp:nomethods my.fine.java.Program
To get more information about the different options available try this:
java -Xrunjmp:help
The nomethod will cause jmp to not trace method_entry and method_exit. Since
method tracing is a slow operation this can save time if you only want to
profile objects.
The noobjects will cause jmp to not trace object allocations. This saves very
little time, normally you use 10-20 methods for each objects allocated.
The nogui will cause jmp to not show any windows and only dump stats at jvm
shutdown.
Hacking on jmp:
If you change the automake file files (*.am), you probably have to do
a bootstrap to get the autotool version right: Just run ./bootstrap in
the toplevel directory.
Known problems:
JMP can probably hang your java runtime so do not use jmp on a
production server yet.
JMP can most probably crash your java runtime after a few CPU-cycles.
JMP is much slower on SUN's jdk/1.4. Mostly this is caused by the fact
that the number of method calls has increased a lot (more than doubled
for the standard test). If you can, run JMP on IBM's jdk.
It seems that Redhat/7.1(?) and jdk/1.3.0 can crash directly on startup,
changing to jdk/1.3.1 or jdk/1.4 fixes this problem.
|