Arcflow of garbage collection and jit buffer reordering (jit garbage collection)
Original Publication Date: 2000-Mar-01
Included in the Prior Art Database: 2003-Jun-18
When analyzing the performance of a java virtual machine, it is nice to have a way to identify where time is spent performing what type of operations and on behalf of what types of processing. In particular, it is helpful to know what time is spent performing garbage collection and jit buffer garbage collection (jit gc). Jit buffer garbage collection occurs when there is space available for a jitted method, but the contiguous free space is not large enough to hold the jitted method. Garbage collection occurs when the heap is filled and there is not enough contiguous space left to allocate a specific object on the heap. Various levels of garbage collection can occur, such as, freeing unused objects or moving objects to provide more contiguous space. Please note that it is not sufficient to simply take the difference between the end time and the start time to identify the jit garbage collection time. This is because other operations could take place, such as, process switches, timer interrupts, key board interrupts, etc. Also, other events could occur during jit gc. For example, it is possible that other operations using code that is pinned or simply running interpretively might be continuing concurrently. The key to avoiding this problem is in the processing or analysis phase, which could be either real time or post processing. We define a methodology for attributing time spent in a method or process/thread (pid/tid) by identifying the current method or process/thread (pid/tid) as a node and applying base time to the node currently executing whenever a new event occurs. Nodes are either a pid/tid node or a child of a pid/tid node. New child nodes are defined to represent the jit garbage collection node or simply garbage collection nodes. During the processing or analysis phase, base time is kept for each node (which might be simply be a pid/tid) by determining the delta time since the last event and accumulating this calculated delta time as time spent on the base time for the last active node on the specified pid/tid. Each event may refer to an existing node under the specified pid/tid or may require the creation of a new node. New trace hooks or events which identify the start of jit garbage collection or simply garbage collection and the end of jit garbage collection or simply garbage collection are defined. When the trace records are written to an internal buffer, the time of the write is recorded in the record. When trace events are processed real time, the delta time since the previous event is calculated. When the processing is complete, accumulated time for each node and its subnodes is constructed by walking the tree for each thread. Reports are generating indicating the base time and accumulated time for each node and the nested level of the nodes.