RFR: 8241830: Simplify commit error messages in G1PageBasedVirtualSpace
Claes Redestad
claes.redestad at oracle.com
Mon Mar 30 16:02:03 UTC 2020
On 2020-03-30 17:50, Leo Korinth wrote:
>
>
> 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!
Right, I was about to send out a correction that FormatBuffer doesn't
malloc but stack allocates a (large) fixed buffer. I confused the impl
details with stringStream (which I'm looking at for a few other,
unrelated cleanups..).
>
>> 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.
Ok, thanks!
/Claes
More information about the hotspot-gc-dev
mailing list