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

Cleanup HttpResponseImpl back reference to HttpConnection

    XMLWordPrintable

Details

    • b04
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: