VM Memory Profiler

Copyright  2006  Sun Microsystems, Inc. All rights reserved.

Overview

Memory profiler is a tool for getting detailed information about the Java heap contents during the VM execution. It allows to track memory leaks and optimize memory usage.

Feature list

Design

The design of the memory profiler support is the same as the design of the java-level debugger support in the VM. Moreover, they are using the same transport layer, so memory profiler and java debugger couldn't be used together for now.


Memory profiler allows to take heap snapshot at any point during the VM execution. The VM is suspended while the profiler collects the snapshot information.


Memory profiler support implementation consists of two parts:


The memory profiler support in the VM provides all the information about object addresses, classes, sizes and references. The proxy propagates it to an arbitrary client. Existing prototype includes Swing UI client which presents gathered data to the user and performs analysis of the data, such as looking for live objects, calculating statistics and so on. Such design allows writing plugins for existing IDE's, which would allow to work java debugger and memory profiler together.

The current interface contains the following functions:

Usage

Building the VM with memory profiler support

Starting the server part

Now you can connect to the VM. Below process of using standart Client tool.


Using the client tool

The following command line is used to run Client tool is “java view.Client -host <hostname> -port <portname>” where hostname and postname are the parameters of running debug agent. The default values are “localhost” and 5000.

The main screen contains the following elements: