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

Memory leak in HttpClient

XMLWordPrintable

    • x86_64
    • linux

      A DESCRIPTION OF THE PROBLEM :
      Using one HttpClient instance for consequtive requesting one host leads to cumulative collecting in jdk.internal.net.http.HttpClientImpl#subscribers and after some time the jvm crahes with out of memory exception.

      Normally the sunscriber removes itself via subscriber.onComplete() invocation in jdk.internal.net.http.Stream#schedule method but sometimes it not happened particulatrly when following branch visited:
          private void schedule() {
          private void schedule() {
      ...
                      } else {
                          if (stopRequested) break;
                          return;
                      }
      ...


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. Create a HttpClient instance,
      2. do many post requests
      3. observe unexpected subscriber instances in jdk.internal.net.http.HttpClientImpl#subscribers despite the requests have been finished

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      jdk.internal.net.http.HttpClientImpl#subscribers must be empty
      ACTUAL -
      jdk.internal.net.http.HttpClientImpl#subscribers cumulatively grow

      FREQUENCY : always


            jpai Jaikiran Pai
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: