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

Aleksey Shipilev shade at redhat.com
Mon May 25 09:54:20 UTC 2020


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?

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.

-- 
Thanks,
-Aleksey



More information about the hotspot-gc-dev mailing list