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

jjs should start with a larger heap

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: 10
    • Component/s: core-libs
    • Labels:

      Description

      I noticed that the default heap size might
      be excessively small (linux x64 on a machine with 2x8x2 threads and 64G RAM):

      exit.js:
      exit();

      jdk9/bin/jjs -J-Xlog:gc exit.js
      [0.026s][info][gc] Using G1
      [0,246s][info][gc] GC(0) Pause Young (G1 Evacuation Pause) 3M->0M(8M)
      (0,243s, 0,246s) 3,643ms
      [0,321s][info][gc] GC(1) Pause Young (G1 Evacuation Pause) 2M->1M(8M)
      (0,314s, 0,321s) 6,996ms
      [0,353s][info][gc] GC(2) Pause Young (G1 Evacuation Pause) 2M->1M(8M)
      (0,349s, 0,353s) 3,307ms
      [0,485s][info][gc] GC(3) Pause Young (G1 Evacuation Pause) 3M->1M(8M)
      (0,474s, 0,485s) 10,991ms
      [0,581s][info][gc] GC(4) Pause Young (G1 Evacuation Pause) 3M->2M(14M)
      (0,573s, 0,581s) 7,879ms
      [0,743s][info][gc] GC(5) Pause Young (G1 Evacuation Pause) 6M->2M(14M)
      (0,735s, 0,743s) 8,678ms

      real 0m0.960s
      user 0m4.984s
      sys 0m0.244s

      It appears jjs starts out with a tiny heap, leading to substantial
      time spent in GC just to bootstrap.

      A small bump to -Xms35m removes GC activity during bootstrap (for reference on this machine java defaults to start up with a heap around 140m if no tuning is made):

      time jdk9/bin/jjs -J-Xmx35m -J-Xlog:gc exit.js
      [0.026s][info][gc] Using G1

      real 0m0.823s
      user 0m3.020s
      sys 0m0.252s

      The story is similar on 8u, but there I had to increase it all the way
      to -Xms100m to get GC activity down to zero.

      Possible remedies would be a small increase of the minimum heap size or simply leaving things up to the default java ergonomics etc

        Activity

        Hide
        sundar Sundararajan Athijegannathan added a comment - - edited
        I went through launcher makefiles for all the jdk/bin tools. None of the tools (including AOT, javac, jshell... potentially memory hungry tools do not specify heap options.

        I recall the general advice on this has been:

        It is to be left to the default platform configuration based on ergonomics. If the user desires, s/he can always use -J VM option when invoking jjs (or any bin tool).
        Show
        sundar Sundararajan Athijegannathan added a comment - - edited I went through launcher makefiles for all the jdk/bin tools. None of the tools (including AOT, javac, jshell... potentially memory hungry tools do not specify heap options. I recall the general advice on this has been: It is to be left to the default platform configuration based on ergonomics. If the user desires, s/he can always use -J VM option when invoking jjs (or any bin tool).

          People

          • Assignee:
            sundar Sundararajan Athijegannathan
            Reporter:
            redestad Claes Redestad
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: