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

After "ulimit -v", the JVM can not start without extra GC command line args.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Fix
    • P4
    • 9
    • 9
    • hotspot
    • None
    • gc
    • linux

    Description

      If virtual memory has been limited with "ulimit -v", and the server has a lot of RAM, then the JVM can not start without extra command line arguments to the GC.

      Both XX:MaxHeapSize and XX:CompressedClassSpaceSize have to be specified. (there may be other combinations that work, I have not tried all)
      It would be good if the jvm could start without extra command line args, even if virtual memory has been limited.
      There is an old bug for this that was resolved in jdk8, but it is still failing in jdk9.


      This log is from a server with 32G ram:

      // Before "ulimit -v", it works ok.
      $ java -version
      java version "1.9.0-ea-fastdebug"
      Java(TM) SE Runtime Environment (build 1.9.0-ea-fastdebug-b10)
      Java HotSpot(TM) 64-Bit Server VM (build 25.0-b62-fastdebug, mixed mode)

      // After "ulimit -v" The jvm does not start with default command line.
      $ ulimit -S -v 4194304
      $ java -version
      Error occurred during initialization of VM
      Could not allocate metaspace: 1073741824 bytes

      // Different command line args gives different error messages.
      $ java -XX:CompressedClassSpaceSize=64m -version
      Error occurred during initialization of VM
      Cannot create VM thread. Out of system resources.

      $ java -XX:MaxHeapSize=512m -version
      #
      # There is insufficient memory for the Java Runtime Environment to continue.
      # pthread_getattr_np
      # An error report file with more information is saved as:
      # /home/egahlin/mtobiass/hs_err_pid24449.log[thread 139641639245568 also had an error]
      [thread 139641638192896 also had an error]
      [thread 139641637140224 also had an error]
      [thread 139641636087552 also had an error]
      [thread 139641635034880 also had an error]
      Error occurred during initialization of VM
      java.lang.OutOfMemoryError: unable to create native thread: possibly out of memory or process/resource limits reached

      // This command line works.
      $ java -XX:MaxHeapSize=512m -XX:CompressedClassSpaceSize=64m -version
      $ java version "1.9.0-ea-fastdebug"
      Java(TM) SE Runtime Environment (build 1.9.0-ea-fastdebug-b10)
      Java HotSpot(TM) 64-Bit Server VM (build 25.0-b62-fastdebug, mixed mode)

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              mtobiass Mattias Tobiasson (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: