

jmap worked for the console dump if I sudo'd the command. and jhat heap.out now works! Point your browser at and object browse!Īlso something I didn't realize until I was preparing for this post. and jrunscript will put you in a js shell. Language ECMAScript 1.6 implemention "Mozilla Rhino" 1.6R7 Language EmbeddedECMAScript 1.6 implemention "Mozilla Rhino" 1.6 release 2 ** you have to be sudo to do steps 3 and 4. Copy rhino1_7R1/js.jar to /System/Library/Frameworks/amework/Versions/1.6/Home/lib/ext/.

Copy jsr223-engines/javascript/build/js-engine.jar to /System/Library/Frameworks/amework/Versions/1.6/Home/lib/ext/.Language AppleScript 2.0.1 implemention "AppleScriptEngine" 1.0Īs a side note if you actually wanted to run AppleScript as a shell, type jrunscript -l AppleScript On the mac, if you execute: jrunscript -q, which provides a listing of script engines you'll see: If you go to the terminal again and run: jrunscript, it indicates that the script engine for language js can not be found. It turns out that jhat uses the Java 6 js engine. It took me a little hunting to uncover the issue. (OQLEngine.java:51)Īt .(QueryListener.java:59)Īt .Main.main(Main.java:189)Ĭaused by: Īt 0(Native Method)Īt (NativeMethodAccessorImpl.java:39)Īt (DelegatingMethodAccessorImpl.java:25)Īt .invoke(Method.java:597)Īt .(OQLEngine.java:256) When running jhat on the hump dump, you get the following error:Įliminating duplicate references.Įxception in thread "main" : Īt .(OQLEngine.java:277)Īt. New Generation (Eden + 1 Survivor Space):Īt this point it looks like it is working, however the file dump doesn't work. It was initially launched in 1998 and it offers support for 32-bit as well as 64-bit operating systems. James Gosling was the actual developer of this tool who worked at Sun Microsystems, but Oracle Corporation acquired it later. To fix this, do a sudo, such as sudo jmap. Java platform helps users develop Java-based applications and deploy them in a cross-platform computing environment. instead you get a message like:Įrror attaching to process: Error attaching to process, or no such process If you type jmap, you would expect to get a high-level memory dump. You can also use jps to discover the pid: jps -l (then look for the Java2D.jar) After the process starts it should indicate the pid (in this example it is 5510)Ĥ. From the terminal: java -jar Java2D.jar &ģ.

From the terminal: cd /Developer/Examples/Java/JFC/Java2D/Ģ. Setting up a test Java process to profile.ġ. I assume that Java 5 has the same issue but haven't checked.
#SUN JAVA FOR MAC MAC#
This post will detail the steps necessary to get jmap and jhat to work on a Mac for Java 6. The information to repair the situation seems to be hard to come by.
#SUN JAVA FOR MAC MAC OS X#
A number of the Java memory management tools with the default distribution on Mac OS X Leopard are broken.
