RFR: 8241830: Simplify commit error messages in G1PageBasedVirtualSpace

Leo Korinth leo.korinth at oracle.com
Mon Mar 30 15:50:33 UTC 2020



On 30/03/2020 16:23, Claes Redestad wrote:
> Hi,
> 
> when committing memory for virtual space, we eagerly generate an error
> message using err_msg, which ends up malloc'ing some memory. As this is
> done for each potential heap region, this turns out to have a
> significant cost on startup when ergonomics decide we should run with
> many regions.

Nice to get a measurable improvement even though no malloc actually 
seems to be called. The code also got a bit simpler!

> Since the address range information is redundant (a warning will be
> printed along with the hs_err file with similar detail), I propose
> replacing with a static error message. This aligns with other call
> sites. For unrecoverable mmap failures, the message will be ignored and
> replaced by "committing reserved memory", meaning the extra information
> is unlikely to actually manifest.

Maybe you can differentiate the the static string so that we can see 
which of the two functions failed? Either way, the change looks good to 
me and if you choose to change the static strings, I need no new webrev.

Thanks,
Leo

> Webrev: http://cr.openjdk.java.net/~redestad/8241830/open.00/
> Bug:    https://bugs.openjdk.java.net/browse/JDK-8241830
> 
> Thanks!
> 
> /Claes



More information about the hotspot-gc-dev mailing list