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

Cleanup HttpResponseImpl back reference to HttpConnection

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b04
    • Verification:
      Not verified

      Description

      While looking at a heap dump I noticed that a lot of instances of SocketTubes where kept alive in memory. I was able to determine that the reason was that the test had retained all CompletableFuture returned by HttpClient, and there was a back reference from CF -> HttpResponseImpl -> HttpConnection -> SocketTube.

      The reference to HttpConnection from HttpResponseImpl is only needed when establishing a WebSocket, so maybe we should set it to null in the normal case to avoid keeping this objects alive when the returned HttpResponse is held and stored by user code?

        Attachments

          Activity

            People

            Assignee:
            dfuchs Daniel Fuchs
            Reporter:
            dfuchs Daniel Fuchs
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: