RFR: 8244817: Add configuration logging similar to ZGCs to other GCs

stefan.johansson at oracle.com stefan.johansson at oracle.com
Mon May 25 12:33:32 UTC 2020


Hi Aleksey,

On 2020-05-25 11:54, Aleksey Shipilev wrote:
> On 5/23/20 10:53 PM, stefan.johansson at oracle.com wrote:
>> Thanks Per and Kim for the reviews,
>>
>> I intend to push this on Monday.
>>
>> Updated webrevs with the rename:
>> Full: http://cr.openjdk.java.net/~sjohanss/8244817/01/
>> Inc: http://cr.openjdk.java.net/~sjohanss/8244817/00-01/
> 
> Feels like print_memory() is better be printing in proper units?
> 
I agree, fixed.

> void GCInitLogger::print_memory() {
>    julong mem = os::physical_memory();
>    log_info(gc, init)("Memory: " JULONG_FORMAT "%s",
>                       byte_size_in_proper_unit(mem), proper_unit_for_byte_size(mem));
> }
> 
> It mismatches a bit against print_heap that does exact units:
> 
> void GCInitLogger::print_heap() {
>    log_info(gc, init)("Heap Min Capacity: " SIZE_FORMAT "%s",
>                       byte_size_in_exact_unit(MinHeapSize), exact_unit_for_byte_size(MinHeapSize));
>    log_info(gc, init)("Heap Initial Capacity: " SIZE_FORMAT "%s",
>                       byte_size_in_exact_unit(InitialHeapSize),
> exact_unit_for_byte_size(InitialHeapSize));
>    log_info(gc, init)("Heap Max Capacity: " SIZE_FORMAT "%s",
>                       byte_size_in_exact_unit(MaxHeapSize), exact_unit_for_byte_size(MaxHeapSize));
> 
>    log_info(gc, init)("Pre-touch: %s", AlwaysPreTouch ? "Enabled" : "Disabled");
> }
> 
> ...but that seems to be fine, as "exact" would print exactly what user passed to -Xmx/-Xms.
> 

I had proper here at one point but decided to go with exact since it 
felt like a better match. I never want K if M can be used. It doesn't 
necessary mean that it will be the same unit as the user passed, but the 
largest possible unit:
-Xmx8192 will print 8G
-Xmx8180 will print 8180M

New webrev:
Full: http://cr.openjdk.java.net/~sjohanss/8244817/02/
Inc: http://cr.openjdk.java.net/~sjohanss/8244817/01-02/

Thank,
Stefan




More information about the hotspot-gc-dev mailing list