Reputation: 16480
I have -XX:+PrintGCDetails turned on, and I want to understand the results.
For example, let's say it displays the following:
12345K->12000K(567890k)...
so I understand that 12345K and 12000K are the occupancy not the size, whereas the 567890k represents the size.
My question is what is the difference between occupancy and size; how is occupancy measured - is that count of objects or is it something else?
Also, in my GC configuration, if I specify occupancy percent, how is that percent calculated, is that size/size or is it count/count?
Upvotes: 0
Views: 124
Reputation: 718758
My question is what is the difference between occupancy and size;
Think of a "space" as a bucket of water. The bucket has a size; say 20 litres. At any given amount of time, the bucket contains a certain amount of water which varies between 0 and 20 litres.
... how is occupancy measured - is that count of objects or is it something else?
The size and occupancy are measured in bytes of memory, so they constrain the total size of the objects rather than the object count.
(Now you see why I didn't use the "lift" analogy. Lift occupancy is typically stated in terms of the number of people in the lift rather than their aggregate weight.)
Also, in my GC configuration, if I specify occupancy percent, how is that percent calculated, is that size/size or is it count/count?
The former.
Upvotes: 2