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

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

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P3 P3
    • tbd
    • hs19
    • hotspot
    • None
    • gc
    • generic
    • generic

      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).

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

              Created:
              Updated:
              Imported:
              Indexed: