How to use jmp (Java Memory Profiler) on Windows

I spent way too long figuring this out, so I figured I might as well spread the knowledge.

I’m developing a Java application for school using the Eclipse IDE. We’re having some memory issues, and the application is chugging on slower computers. So I wanted to use the Java Memory Profiler, but, it turns out it’s a little bit hard to get to work on Windows, and walk-throughs out there are not very good on the subject.

First, download the jmp dll. Put it into C:\Windows, and if that doesn’t work on the following steps, put it in the directory with the application as well.

This is the part that tripped me up. I wasn’t actually able to get jmp working with Eclipse, but I did get it working with normal Java. For this, you’re going to need to install Cygwin. Luckily, there are lots of good Cygwin tutorials out there. You’ll also need GTK+. It should be a simple download and install.

Open up Cygwin and change to the directory that contains the Java application you want to profile. Let’s say it’s called Application. Run this just as a test, to make sure that Java is working properly:

java Application

If that works, it’s time to try jmp. Here we go!

java -Xrunjmp Application

That’s really all there is to it. Too bad it wasn’t really stated succintly anywhere else on the web. You can also run the following command to get a list of jmp options:

java -Xrunjmp:help

5 Responses to “How to use jmp (Java Memory Profiler) on Windows”

  1. mathu Says:

    how to analyse the heapdump generated by JMP in mentioned location

  2. pecks Says:

    can’t see why you need Cygwin if you’re just calling Java..why can’t you just use the Command Prompt? (or am I missing something?)

  3. Cyde Weys Says:

    pecks: I don’t know, it’s been so long that I did this that I forget the details. I’m going to guess it might be because jmp uses GTK for its GUI, although Pidgin and GIMP do that too without having to run from a special shell. Go ahead and try it in a DOS prompt and let us know how it works out?

  4. DR Says:

    Hi,
    Actually I had followed all instruction….
    but it gives an error as no C compiler found in PATH …
    I have TurboC complier and I have given it’s path in PATH variable.
    Can you please help me with this issue.

  5. EdHunter Says:

    Thank you, This post helped me solve a really big problem!

    My god java can be agonising!