Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-3612

Developer's Guide needs correction on garbage collection

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 10.3.2.1
    • 10.4.2.0, 10.5.1.1
    • Documentation
    • None

    Description

      In a comment on DERBY-3585, Martin Zaun pointed out the following error:

      devguide/tdevdvlp20349.dita

      • found a flatly wrong statement but did NOT correct here since
        unrelated to server shutdown authentication:
        "You cannot explicitly request that the JVM unload a class, but you
        can ensure that the EmbeddedDriver class is unloaded by using a
        System.gc() to force it to garbage collect classes that are no longer
        needed. Running with -nogc or -noclassgc definitely prevents the class
        from being unloaded and makes you unable to restart Derby in the same
        JVM."

      System.gc() is only a suggestion to the Runtime to garbage-collect, it
      cannot be enforced, and there's no guarantee whatsoever that GC has
      run and any classes been unloaded. Likewise it's most probably not
      guarantueed that -nogc or -noclassgc definitely prevent a class
      from being unloaded (a JVM may ignore these options...)

      This needs to be fixed. Thanks, Martin.

      One more question: are -nogc and -noclassgc java command line options, or options to some other command? I can't find them in the java command documentation – http://java.sun.com/javase/6/docs/technotes/tools/windows/java.html. There is an -Xnoclassgc option, however.

      Attachments

        1. DERBY-3612.diff
          2 kB
          Camilla Haase
        2. tdevdvlp20349.html
          5 kB
          Camilla Haase

        Activity

          People

            chaase3 Camilla Haase
            chaase3 Camilla Haase
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: