Enhancing j.l.Runtime/System::gc specification with an explicit 'no guarantee' statement

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P3
    • 13
    • Affects Version/s: 13
    • Component/s: core-libs
    • b24

        Current specifications for the following methods:

        https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/System.html#gc()
        https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Runtime.html#gc()

        might give a false impression that garbage collection is guaranteed to happen eventually.

        However garbage collection may never ever happen. It would be beneficial to add an explicit mention of this fact as some kind of a disclaimer, like the following:

        - "Please note that implementation of this method does not guarantee that garbage collection will be ever started"

        or

        - "Implementation of this method is allowed to not implement or trigger any memory reclamation mechanism"

              Assignee:
              Roger Riggs
              Reporter:
              Dmitry Bessonov
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: