Uploaded image for project: 'odlparent'
  1. odlparent
  2. ODLPARENT-175

add -XX:+DisableExplicitGC to ODL Karaf JVM options to prevent explicit System.gc()

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Medium Medium
    • 3.1.5, 4.0.3
    • None
    • None
    • None

      I'm looking at a Java Flight Recording obtained from (internal) scale lab testing, and see:

      23.5 % of the garbage collections were caused by System.gc(). Calling System.gc() might not be optimal, since it can cause an unnecessary amount of garbage collections. The garbage collectors usually handles this fine by themselves without being explicitly called.

      To fix this, remove unnecessary System.gc() calls in the code. If the calls are made by libraries where you can't change the source code, you can instead use the command line flag '-XX:+DisableExplicitGC'. This flag makes the JVM ignore all System.gc() calls.

      Searching for System.gc() in ODL code shows a few places where we do this, but most are in tests, or in old projects like nic and vtn; one is in netvirt.

      This issue proposes that we add -XX:+DisableExplicitGC to ODL Karaf JVM options to prevent explicit System.gc() - I don't see the disadvantage, so better safe than sorry, and prevent future problems.

            skitt Stephen Kitt
            vorburger Michael Vorburger
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: