Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8146243

jimage usage of direct buffers eats into MaxDirectMemorySize

    Details

      Description


      The changes to jimage to remove substrate from the jimage code (
      http://hg.openjdk.java.net/jigsaw/jake/jdk/rev/67429f4af9da) is eating into the direct memory budget set by -XX:MaxDirectMemorySize.

      test/java/nio/Buffer/LimitDirectMemory.sh is failing as a result:

      Testing: -XX:MaxDirectMemorySize=10 -cp /w/testing/jake/JTwork/classes/0/java/nio/Buffer LimitDirectMemory true 10 1
      Error occurred during initialization of VM
      java.lang.OutOfMemoryError: Direct buffer memory
      at java.nio.Bits.reserveMemory(java.base/Bits.java:667)
      at java.nio.DirectByteBuffer.<init>(java.base/DirectByteBuffer.java:123)
      at java.nio.ByteBuffer.allocateDirect(java.base/ByteBuffer.java:311)
      at sun.nio.ch.Util.getTemporaryDirectBuffer(java.base/Util.java:174)
      at sun.nio.ch.IOUtil.read(java.base/IOUtil.java:195)
      at sun.nio.ch.FileChannelImpl.readInternal(java.base/FileChannelImpl.java:742)
      at sun.nio.ch.FileChannelImpl.read(java.base/FileChannelImpl.java:728)
      at jdk.internal.jimage.BasicImageReader.<init>(java.base/BasicImageReader.java:81)
      at jdk.internal.jimage.ImageReader.<init>(java.base/ImageReader.java:64)
      at jdk.internal.jimage.ImageReader.lambda$open$0(java.base/ImageReader.java:77)
      at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(java.base/ConcurrentHashMap.java:1711)
      at jdk.internal.jimage.ImageReader.open(java.base/ImageReader.java:75)
      at jdk.internal.jimage.ImageReader.open(java.base/ImageReader.java:93)
      at jdk.internal.jimage.ImageReaderFactory.get(java.base/ImageReaderFactory.java:55)
      at jdk.internal.jimage.ImageReaderFactory.getImageReader(java.base/ImageReaderFactory.java:74)
      at java.lang.module.InstalledModuleFinder.<clinit>(java.base/InstalledModuleFinder.java:88)
      at java.lang.module.ModuleFinder.ofInstalled(java.base/ModuleFinder.java:141)
      at jdk.internal.module.ModuleBootstrap.boot(java.base/ModuleBootstrap.java:93)
      at java.lang.System.initPhase2(java.base/System.java:1911)

      In addition to the test failures then the implementation needs a close review as startup appears to have regressed significantly.

        Attachments

          Activity

            People

            • Assignee:
              jlaskey Jim Laskey
              Reporter:
              alanb Alan Bateman
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: