RFR: 8038934: Remove prefix allocated_ from methods and variables in Metaspace

Erik Helin erik.helin at oracle.com
Tue Apr 1 15:02:39 UTC 2014

Hi all,

this patch removes the prefix "allocated_" from some members in the 
class MetaspaceAux.

 From the beginning, there were only functions named used_in_bytes() and 
capacity_in_bytes(). These functions iterated over the 
ClassLoaderDataGraph to reach all metaspaces and then iterated over the 
chunk list, which made them quite slow.

Later, the functions allocated_used_bytes() and 
allocated_capacity_bytes() were added that used accounting to be able to 
return a value faster and without using a lock. When these functions 
were added, the functions used_bytes() and capacity_bytes() were renamed 
to used_bytes_slow() and capacity_bytes_slow() to clarify the difference 
(the slow functions were later made private).

Since the old, slow functions end in "_slow", we can drop the prefix 
"allocated_" from the accounting functions.



More information about the hotspot-dev mailing list