RFR(xs): 8210068: Unsafe.allocateMemory() should not round up requested memory size

Andrew Haley aph at redhat.com
Mon Nov 5 09:15:36 UTC 2018


On 11/05/2018 07:13 AM, Thomas Stüfe wrote:
> This rounding is unnecessary, since the additional space is not needed
> by the caller. In addition, this rounding causes NMT to over-report
> the numbers of mtOther - which consists mainly of nio DirectByteBuffer
> related allocations - the more buffers and the smaller they are the
> more inaccurate those numbers become.
> 
> --
> 
> This bug has been originally reported by Adam Farley, see fragments of
> a scattered discussion on core-libs:
> 
> http://mail.openjdk.java.net/pipermail/core-libs-dev/2018-July/054412.html
> http://mail.openjdk.java.net/pipermail/core-libs-dev/2018-August/054797.html

I don't believe that this change is useful. Any realistic malloc()
will round the allocated memory size anyway, and the current behaviour
more realistically answers the "Where did my memory go?" question.

-- 
Andrew Haley
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671


More information about the hotspot-runtime-dev mailing list