RFR: 8224871: os::attempt_reserve_memory_at() tries too hard
Thomas Stüfe
thomas.stuefe at gmail.com
Tue Jun 4 08:23:49 UTC 2019
Yes please. Looks good.
Internally we had this coding disabled since 2015 to no adverse affect.
If it did not work the first time, it wont work on the second try neither,
even if there is an overlap.
Cheers, Thomas
On Tue, May 28, 2019 at 3:07 PM Erik Österlund <erik.osterlund at oracle.com>
wrote:
> Hi,
>
> The os::attempt_reserve_memory_at() function on BSD, linux and Solaris
> all try a bit too hard. They first try to mmap memory at a given
> address. If that failed, rather than giving up as expected, it tries in
> a loop to mmap random memory (without address hints), and looks if it so
> happens to be that it can from these completely random and arbitrary
> address ranges find overlapping ranges that happen to cross over the
> exact range that was requested, and then cuts out the excess and returns
> that. We really should just give up instead if the OS refused to hand
> out memory at the requested address.
>
> Bug:
> https://bugs.openjdk.java.net/browse/JDK-8224871
>
> Webrev:
> http://cr.openjdk.java.net/~eosterlund/8224871/webrev.00/
>
> Thanks,
> /Erik
>
More information about the hotspot-runtime-dev
mailing list