Prefetch Technologies // Keeping your cache lines cozy

Archive

Posts in Java

Instrumenting Java code with JSDT probes

javadtraceApr 8, 2009 5 min read

A few months back, I got wind from the world famous Jarod Jenson that Keith McGuigan was working on adding JSDT probes to Java. JSDT probes struck me as an extremely useful feature for realtime problem analysis, so I decided to instrument some sample code to see how they worked. After a couple of e-mail exchanges with Keith, I had a working Java build that supported JSDT. After reviewing a number of Java projects, I chose to instrument the PostgreSQL Java type IV driver, since I wanted to learn PostgreSQL along with JDBC…

$ read more →

Debugging Java performance problems presentation

javaOct 27, 2008 1 min

I recently gave a presentation at the local UNIX users group titledDebugging Java performance problems. The presentation describes various opensource tools and how they can be used to understand what is causing CPU, memory and lock contention issues inside a Java virtual machine. If there are additional tools not discussed in the presentation that you find useful for debugging Java performance problems, please let me know through the comment feature.

$ read more →

Profiling Java methods with the heap profiling agent

javaFeb 2, 2008 2 min

The Java SDK comes with a number of tools and JVM options that can be used to analyze the performance of the Java runtime. One extremely useful tool is the heap profiler agent, which provides facilities to profile memory usage, CPU utilization and lock contention. To load the profiler agent to profile CPU utilization, you can add the "-agentlib:hprof=cpu=times" option to your java command line: Once loaded, the agent will use byte code injection (BCI) to instrument each method's entry and return points. This allows the agent to measure the number of times each method was called, the time spent in each method, and the call chain that led to the method being invoked…

$ read more →

Getting alerts when Java processes crash

javaJan 29, 2008 1 min

When bugs occur in the Java runtime environment, most administrators want to get notified so they can take corrective action. These actions can range from restarting a Java process, collecting postmortem data or calling in application support personnel to debug the situation further. The Java runtime has a number of useful options that can be used for this purpose. The first option is "-XX:OnOutOfMemoryError", which allows a command to be run when the runtime environment incurs an out of memory condition…

$ read more →

Monitoring Java garbage collection with jstat

javaJan 16, 2008 4 min

Java memory management revolves around the garbage collector, which is the entity responsible for traversing the heap and freeing space that is being taken up by unreferenced objects. Garbage collection makes life easier for Java programmers, since it frees them from having to explicitly manage memory resources (this isn't 100% true, but close enough). In the Java runtime environment, there are two types of collections that can occur. The first type of collection is referred to as minor collection…

$ read more →