RFR: JDK-8249258 java/util/StringJoiner/StringJoinerTest.java failed due to OOM (JDK 15)
Thomas Schatzl
thomas.schatzl at oracle.com
Wed Jul 15 15:26:32 UTC 2020
Hi,
On 15.07.20 15:35, Jim Laskey wrote:
> Try this:
>
> - You have a 4G heap.
> - You allocate some stuff, say 1 byte.
> - You allocate a 2G object - so there is only 2G - 1, left. Not enough space for another 2G object.
> - But you do allocate 1 byte.
> - You have 1 byte, 2G and 1 byte.
> - You free the original 2G object.
> - But something allocates 1 byte in it's old space.
> - Now there is no range that that can accommodate a 2G object. OOM.
just for clarification: it's a bit more elaborate than that to get
into this situation as G1 will try a full collection that will compact
these 1 byte "stuff" into a contiguous range of memory.
G1 at this time will never move "large" (>= heap region size / 2; at 4g
heap region size is 2M iirc) objects though. I.e. with a suitably placed
single "large" object in that 4g heap (like covering the middle center
regions of the heap, i.e. regions #1023 and #1024) you can make
allocation of that 2g object impossible.
Thanks,
Thomas
More information about the core-libs-dev
mailing list