HttpComponents HttpClient
  1. HttpComponents HttpClient
  2. HTTPCLIENT-841

potential memory leak when using ThreadSafeClientConnManager

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.0 Beta 2
    • Fix Version/s: 4.0 Final
    • Component/s: HttpClient
    • Labels:
      None
    • Environment:
      Leopard 10.5.6, Java 1.5.0_16, Jetty 6.1.7

      Description

      When using ThreadSafeClientConnManager and developing with Jetty using auto-redeploy feature eventually I run into a PermGen out of memory exception. I investigated with YourKit 8.0.6 and found a class loader circular reference in RefQueueWorker. Not really sure what I was doing I made the refQueueHandler non-final and nulled it in the shutdown method of RedQueueWorker. I don't seem to have the problem any longer with circular class loader references.

      Here is a diff from 4.0-beta2

      — httpclient/src/main/java/org/apache/http/impl/conn/tsccm/RefQueueWorker.jav(revision 763223)
      +++ httpclient/src/main/java/org/apache/http/impl/conn/tsccm/RefQueueWorker.jav(working copy)
      @@ -50,7 +50,7 @@
      protected final ReferenceQueue<?> refQueue;

      /** The handler for the references found. */

      • protected final RefQueueHandler refHandler;
        + protected RefQueueHandler refHandler;

      /**
      @@ -112,6 +112,8 @@
      this.workerThread = null; // indicate shutdown
      wt.interrupt();
      }
      +
      + refHandler = null;
      }

      1. HTTPCLIENT-841.patch
        27 kB
        Oleg Kalnichevski
      2. HTTPCLIENT-841-depr.patch
        21 kB
        Oleg Kalnichevski
      3. hs_err_pid21886.log
        21 kB
        Olivier Lamy (*$^¨%`£)

        Activity

          People

          • Assignee:
            Unassigned
            Reporter:
            Ted Slusser
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development