RFR: 8253779: Amalloc may be wasting space by overaligning [v4]
Coleen Phillimore
coleenp at openjdk.java.net
Sat Jul 10 00:04:57 UTC 2021
On Fri, 9 Jul 2021 20:04:08 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:
>> check_for_overflow does more than just the pointer comparison. It conditionally calls vm_exit_out_of_memory. I don't want to copy this into both of the Amalloc function, and it has a nice name vs. squinting and trying to understand why "if (pointer_delta(_max, _hwm, 1) < x)" does the same thing. As is, this is readable and I don't want to change it.
>
> Such a use of pointer_delta is one of its canonical use-cases, as discussed in the comment describing that function.
>
> grow does everything that check_for_overflow does, except correctly. check_for_overflow can incorrectly report an error if the current chunk happens to be near the end of the address space, even though malloc can succeed.
>
> The current code with the call to check_for_overflow is incorrect, slower, and larger than it needs to be. It's got nothing at all going for it except the "whence" string, which is not enough to make up for the other problems. If that feature is important, add it to grow().
I'll file another RFE to fix it. I hope you can do it because I would only cut/paste the pointer diff expressions that you type here. This has already exceeded the original RFE change. JDK-8270217
One backlog item removed, two created JDK-8270217.
-------------
PR: https://git.openjdk.java.net/jdk/pull/4732
More information about the hotspot-dev
mailing list