JDK-8069351 : [TESTBUG] gc/memory/Nio_PageAlignDirectMemory fails: Allocating direct memory should not eat the heap!
  • Type: Bug
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 9
  • Priority: P3
  • Status: Resolved
  • Resolution: Cannot Reproduce
  • Submitted: 2015-01-20
  • Updated: 2017-02-10
  • Resolved: 2015-06-30
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9Resolved
Related Reports
Relates :  
Description
Time to time (not often, but quite regularly) the test gc/memory/Nio_PageAlignDirectMemory fails:

Exception in thread "main" gc.memory.Nio.Nio$Fault: Allocating direct memory should not eat the heap! Heap dumped to heapDump.hprof file.
 	at gc.memory.Nio.Nio.checkHeapIsNotAffected(Nio.java:138)
 	at gc.memory.Nio.Nio.run(Nio.java:52)
 	at gc.memory.Nio.Nio.main(Nio.java:28)


The test is executed with:  -XX:MaxDirectMemorySize=25m -Dsun.nio.PageAlignDirectMemory=true flags. It allocates all available direct buffer (25m) and heap is not growing.

But heap grows and test fails dumping heap.

Let's start with assumption that this is test issue.
Comments
This test hasn't failed for 6 months. So, I'm closing it as not reproducible. The more I look at the problem described in the test that more I think that this is not a test bug at all. I guess that something must have been changed in JDK and heap stopped consuming...
30-06-2015

According to Alan Bateman comment (JDK-8130076). Page alignment is not supported for direct memory... So it's very strange that PageAlignDirectMemory affects somehow the behavior...
30-06-2015

I=M (test failure) L=M (sometimes) W=H (unknown) --> P3
20-01-2015