Check out the new USENIX Web site. next up previous
Next: Related Work Up: Support for Interactive Low-Overhead Previous: Overhead of Disabled Profiling

The Partial Profiling Problem

A problem that arises when profiler events can be enabled and disabled is that the profiler agent receives incomplete, or partial, profiling information. This has been characterized as the partial profiling problem [16]. For example, if the profiler agent enables the thread start and end events after a thread has been started, it will receive an unknown thread ID that has not been defined in any thread start event. Similarly, if the profiler agent enables the class load event after a number of classes have been loaded and a number of instances of these classes have been created, the agent may encounter NEW_OBJECT events that contain an unknown class ID.

A straightforward solution is to require the virtual machine to record all profiling events in a trace file, whether or not these events are enabled by the profiler agent. The virtual machine is then able to send the appropriate information for any entities unknown to the profiler agent. This approach is undesirable because of the potentially unlimited size of the trace file and the overhead when profiling events are disabled.

We solve the partial profiling problem based on one observation: The Java virtual machine keeps track of information internally about the valid entities (such as class IDs) that can be sent with profiling events. The virtual machine need not keep track of outdated entities (such as a class that has been loaded and unloaded) because they will not not appear in profiling events. When the profiler agent receives an unknown entity (such as an unknown class ID), the entity is still valid, and thus the agent can immediately obtain all the relevant information from the virtual machine. We introduce a JVMPI function that allows the profiling agent to request information about unknown entities received as part of a profiling event. For example, when the profiler agent encounters an unknown class ID, it may request the virtual machine to send the same information that is contained in a class load event for this class.

Certain entities need to be treated specially by the profiling agent in order to deal with partial profiling information. For example, if the profiling agent disables the MOVE_OBJECT event, it must immediately invalidate all object IDs it knows about, because they may be changed by future garbage collections. With the MOVE_OBJECT event disabled, the agent can request the virtual machine to send the class information about unknown object IDs. However, such requests must be made only when garbage collection is disabled (by, for example, calling one of the JVMPI functions). Otherwise garbage collection may generate a MOVE_OBJECT event asynchronously and invalidate the object ID before the virtual machine obtains the class information for this object ID.


next up previous
Next: Related Work Up: Support for Interactive Low-Overhead Previous: Overhead of Disabled Profiling
Sheng Liang
1998-12-19