Snippet: Java Mission Control (JMC) and Flight Recorder (JFR)

The Java Mission Control and the Java Flight Recorder allow us to capture run-time information from our Java applications without much overhead and aggregate profiling information. I have written down the commands that I’m using the most when profiling a Java application with this tool chain in the following article. Figure 1. Java Mission Control - Report Running Java Mission Control (JMC) We may start the JMC user interface shown above using the jmc command that is shipped with Oracle’s JRockit or Java (since Java 7 update 40). ...

October 11, 2017 · 4 min · 748 words · Micha Kops

Finding Memory Leaks using Eclipse and the MemoryAnalyzer Plugin

The MemoryAnalyzer Plugin for Eclipse allows us to quickly analyze heap dumps from a virtual machine and search for memory leaks. In the following tutorial we’re going to create and run a small application that is going to cause an OutOfMemoryException during its runtime. In addition, we’re forcing the virtual machine to save a heap dump and finally analyzing this data using Eclipse and the MemoryAnalyzer plugin. Prerequisites Java Development Kit 6 Eclipse Indigo ...

November 2, 2011 · 4 min · 704 words · Micha Kops

Java Snippets

Remote Debug a Pod’s Java Process Simple steps for remote debugging a Java process running on a k8 pod: Edit deployment and add the following parameters to the Java start line: -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=127.0.0.1:5005 Also add the following port mapping at the section container → ports in the deployment: - containerPort: 5005 protocol: TCP Safe, wait for the new pods and then add a port forward for port 5005 for this pod: kubectl port-forward podname 5005 ...

March 1, 2010 · 13 min · 2583 words · Micha Kops