Skip to content

WinHttpRequestState memory leak when cancelling requests #17392

Closed

Description

@davidsh

(reported by ASP.NET team).
cc: @DavidObando

There is a memory leak of WinHttpRequestState (and related objects) when the outstanding http request is canceled prior to it completing with an HttpResponseMessage.

Activity

  1. self-assigned this
    on May 24, 2016
  2. davidsh commented on May 31, 2016

    @davidsh
    ContributorAuthor

    After analyzing this, the size of the WinHttpRequestState memory leaks are orders of magnitude smaller than the memory fragmentation caused by issues in the Kestrel server.

    Moving to post RTM.

  3. DavidObando commented on May 31, 2016

    @DavidObando
    Member

    @davidsh that's true as long as the cancellation token is freed.

  4. davidsh commented on May 31, 2016

    @davidsh
    ContributorAuthor

    that's true as long as the cancellation token is freed.

    I will submit a PR for RTM to fix just that. This issue, though, will cover the overall problem which still isn't 100% fixed.

  5. davidsh commented on May 31, 2016

    @davidsh
    ContributorAuthor

    Switching this issue to RTM for now until dotnet/corefx#8896 gets merged. Then the issue will move to post RTM to fix the remaining leaks.

  6. karelz commented on Feb 23, 2017

    @karelz
    Member

    Check out more details in closed dupe dotnet/corefx#11674.

  7. karelz commented on Feb 23, 2017

    @karelz
    Member

    Next step:

    • Run again the repro to see if there is anything left (it was at least partially mitigated by other changes
  8. karelz commented on Apr 18, 2017

    @karelz
    Member

    Triage: The impact on 2.0 is expected to be low if any. The cost is high, moving to Future.

  9. karelz commented on May 19, 2018

    @karelz
    Member

    Should be addressed in 2.1 with new default handler: SocketsHttpHandler, closing.

  10. transferred this issue fromdotnet/corefxon Jan 31, 2020
  11. added this to the 3.0 milestone on Jan 31, 2020
  12. ghost locked as resolved and limited conversation to collaborators on Dec 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-System.Net.Httpbugos-windowstenet-reliability

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions