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

Native resources cached in thread locals not released when FJP common pool threads clears thread locals

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 25
    • 24, 25
    • core-libs
    • b26

      Thread locals have unbounded lifetime and don't play well with thread pools. A ForkJoinPool can optionally be created with worker threads that clear thread locals between tasks, thus avoiding a build up of thread locals left behind by tasks executed in the pool. The common pool is setup to do this. Clearing all thread locals can lead to memory leaks for thread locals that are keeping native memory alive and don't have a Cleaner or other means to free the memory. This is the case with TerminatingThreadLocals that no longer have a Cleaner since JDK-8344882.

            alanb Alan Bateman
            alanb Alan Bateman
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: