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

Need support for explicitly cleaning up references for freeing up associated native resources

    Details

    • Type: Enhancement
    • Status: Open
    • Priority: P3
    • Resolution: Unresolved
    • Affects Version/s: hs19
    • Fix Version/s: tbd
    • Component/s: hotspot
    • Labels:
      None
    • Subcomponent:
      gc
    • CPU:
      generic
    • OS:
      generic

      Description

      Please refer to 6913047 "Long term memory leak when using PKCS11 and JCE exceeds 32 bit process address space" for more details.

      Here is a quick summary of the problem encountered:
      native resources/memory are allocated by native PKCS11 library and returned to java apps for use. These wrapper objects containing the native resources/memories are cleaned up by the weak reference queue mechanism. However, if GC isn't run, then these wrapper objects aren't en-queued for cleaning up and the associated native memories aren't freed. This may lead to an OOM situation whenever native PKCS11 library allocates memory faster than GC is called to free up the native resources.

      Thus, to avoid this kind of OOM situation, we need some way to be able to free up these native resources automatically. It is suggested that this may be addressed by having a separate set of APIs to trigger the weak reference processing (without doing the GC).

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                valeriep Valerie Peng
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Imported:
                  Indexed: