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

[JVMCI] limit support for sharing a libgraal isolate between threads

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 22
    • hotspot

      JDK-8242440 added support for unloading libgraal isolates to save memory when compilation goes idle. The default use of this support is a 1:1 model (i.e., 1 libgraal isolate per compiler thread). However, it's possible to configure an M:1 model using a value JVMCIThreadsPerNativeLibraryRuntime other than 1 (i.e., M compiler threads share 1 isolate between them), along with the possibility for rebalancing sharing as compiler threads go idle and are stopped.

      This M:1 model adds a lot of complexity to the implementation. Furthermore, experience has shown that it doesn't bring any benefit. One of its main drawbacks compared to the 1:1 model is that a libgraal GC in one compiler thread will pause compilation for all other compiler threads sharing the same isolate. In addition, there's never a clear point at which it's optimal to schedule a libgraal GC. In the 1:1 model, the heap is mostly filled with garbage at the end of a compilation so scheduling a GC at that point significantly minimizes GC time. in the M:1 model, there's no such obvious point at which the heap is mostly garbage.

      With this experience in mind, it makes sense to simplify the isolate management code in JVMCI by limiting support for the M:1 model that implemented by JVMCIThreadsPerNativeLibraryRuntime=0 (i.e., all compiler threads share a single isolate).

            dnsimon Douglas Simon
            dnsimon Douglas Simon
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: