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

Cleanup HttpResponseImpl back reference to HttpConnection

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 13
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b04

      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:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: