Memleak technology

The JRockit Mission Control Memory Leak Detector, or Memleak for short, is a dynamic tool that can be attached to a running JRockit instance. Memleak can be used to track how heap memory usage in the Java runtime changes over time for each type (class) in the system. It can also find out which types have instances pointing to a certain other type, or to find out which instances are referring a certain other instance. Allocation tracing can be enabled to track allocations of a certain type of object. This all sounds complicated, but it is actually quite easy to use and supported by a rich graphical user interface. Before we show how to use it to resolve memory leaks, we need to discuss some of the architectural consequences of how Memleak is designed.

  • Trend analysis is very cheap: Data is collected as part of the normal garbage collection mark phase. As mentioned, this is a surprisingly fast operation. When the tool is running, every normal garbage collection will collect the necessary data. In order to ensure timely data collection, the tool will also, by default, trigger a garbage collection every ten seconds if no normal garbage collection has taken place. To make the tool even less intrusive, this setting can be changed in the preferences.
  • Regardless of client hardware, you will be able to do the analysis: Connecting to a server with a multi-gigabyte heap from a puny laptop is not a problem.
  • Events and changes to the heap can be observed as they happen: This is both a strength and a weakness. It is very powerful to be able to interact with the application whilst observing it, for example to see which operation is responsible for certain behavior, or to introspect some object at the same time as performing operations on it. It also means that objects can become eligible for garbage collection as they are being studied. Then further operations involving the instances are impossible.
  • No off-line analysis is possible: This can be a problem if you want to get a second opinion on a memory leak from someone who can't be readily given access to your production system. Fortunately, the R28 version of JRockit can do standard HPROF heap dumps that can be analyzed in other tools, such as Eclipse MAT, if required.

    Note

    Note that HPROF dumps contain the contents of the heap. If the system from which the HPROF dump was generated contains sensitive data, that data will be readily accessible by anyone getting access to the dump. Be careful when sharing dumps.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.15.29.119