Patent ID: 7596667

Claim:
A method for byte allocation accounting in a system having a multithreaded application and a generational garbage collector that dynamically pre-tenures objects from a predetermined number of candidate allocation sites, comprising: a. associating an array with each application thread, each array containing a number of entries equal to the predetermined number and each entry indexed by a site number; b. during a first young-generation collection, assigning a site number to each candidate site; c. between the first young-generation collection and a second young-generation collection, using each application thread to count bytes allocated from each candidate site and storing a byte count comprising the count of bytes allocated from that candidate site in the array associated with that application thread in an entry indexed by the site number assigned to that candidate site; and d. during the second young-generation collection, for each candidate site, forming a byte count summary for that candidate site, by summing byte counts in all array entries indexed by the site number assigned to that candidate site.