摘要:
A method and system for detecting memory leaks in an object-oriented environment during real-time trace processing is provided. During the profiling of a program executing in a data processing system, a profiler processes events caused by the execution of the program, and the profiler maintains a profile data structure containing execution-related metrics for the program. The execution-related metrics may include object allocation and deallocation metrics that are associated with object processing initiated on behalf of an executing method. An object allocator allocates objects during the execution of the program and modifies object allocation metrics in the profile data structure. An object deallocator, such as a garbage collector, deallocates objects during the execution of the program and modifies object deallocation metrics in the profile data structure. The object allocation metrics and the object deallocation metrics may be compared to identify memory leaks.
摘要:
A method and system for detecting memory leaks in an object-oriented environment during real-time trace processing is provided. During the profiling of a program executing in a data processing system, a profiler processes events caused by the execution of the program, and the profiler maintains a profile data structure containing execution-related metrics for the program. The execution-related metrics may include object allocation and deallocation metrics that are associated with object processing initiated on behalf of an executing method. An object allocator allocates objects during the execution of the program and modifies object allocation metrics in the profile data structure. Object metrics are stored in a particular location and a pointer to that location is stored in a hash table associated with the object's ID. In another embodiment the pointer to the location is stored in a shadow heap in the same relative position as the position of the object in the heap. The object allocation metrics and the object deallocation metrics may be compared to identify memory leaks.
摘要:
A method and system are disclosed for operating an object-oriented environment within a computer system. The execution of the object-oriented environment is initiated. A first memory location is allocated in a memory area within the object-oriented environment for storing an object. A second memory location is allocated in the memory area with the allocation of the first memory location for storing a persistence indicator. The persistence indicator indicates a point during the execution of the object-oriented environment at which the allocation of the first memory location occurred. A total number of bytes of the memory area which had been allocated during the execution of the object-oriented environment when the allocation of the first memory location occurred is stored as the persistence indicator.
摘要:
A method and apparatus for instrumenting garbage collection in a data processing system is provided. During garbage collection, a pass is made through the object heap and a plurality of heap data is retrieved and written to a trace file. The data may include the type of object, the size of the object on the heap, the class of the object, if appropriate, and a plurality of pointers, including live set pointers, and one or more tags representing attributes that may be associated with the particular object. The instrumentation may controlled to occur at a preselected phase of the garbage collection process. Additionally, a user may dynamically initiate a garbage collection instrumentation if the user determines that an event has occurred during the operation of the data processing system about which the user wishes further data.
摘要:
A method, system, and computer program product for profiling memory allocation in a data processing system are disclosed. The method includes initiating a memory allocation request and, in response to the memory allocation request, profiling the memory allocation request to determine a prescribed set of characteristics associated with request. The profiled set of characteristics are the stored for subsequent review. In one embodiment, the profiled memory allocation request is selectively chosen from a set of memory allocation requests on the basis of a memory allocation sampling criterion. The sampling criterion may be based upon the size of the memory block requested in the memory allocation request in one embodiment. In an alternative embodiment, the sampling criterion is the based upon the number of memory allocation requests. In an embodiment with multiple memory allocation routines, the memory allocation request may be of a first memory allocation routine type and the sampling criterion may be based upon the number of memory allocation requests of the first type. In one embodiment, the set of characteristics monitored by the application program includes the calling sequence that resulted in the memory allocation request. In one embodiment, the memory allocation request may be initiated by an application program written in the Java programming language and the memory allocation request is handled by a Java Virtual Machine.
摘要:
A client state object, such as a “cookie,” allows a server to save client state information on the client. This information is returned when the client requests information from the server. A server includes two identifiers—a primary name and an alternate name. Web pages on the server are modified so that links to server resources, such as files, that need client state information reference the primary name, while other links that do not need client state information reference the alternate name. In this manner, it does not matter which directory on the server is used to store files and files can be intermingled with one another regardless of whether the individual files use client state information. A method is provided for modifying existing web pages based on whether server resources addressed by the hyperlinks use client state information.