Patent ID: 7971010

Claim:
A method comprising: initiating a loitering trace of objects that cause a memory leak and remain in a heap after surviving at least one garbage collection operation, wherein initiating the loitering trace includes detecting the objects remaining in the heap via a loitering module of a profiling structure at a first virtual machine of an application server of a first computer system, wherein initiating the loitering trace further includes performing time-based sampling for the objects remaining, wherein the time-based sampling is performed at regular time intervals and includes method statistics identifying an average runtime of each of the objects remaining, wherein the method statistics are calculated based on a number of uses called for each of the objects remaining and a time length associated with each use of each of the remaining objects; providing, from the first virtual machine, the time-based sampling to a second virtual machine of the first computer system or a second computer system; and performing an act on the objects remaining in the heap based on the time-based sampling.