Skip to content

SendGrid Client, Memory Leaks, and IDisposable #1216

Description

@larlewis

The BaseClient should implement the IDisposable interface as it contains a disposable HttpClient.
Internally, none of the references to HttpRequestMessage or HttpResponseMessage are properly disposed of, either in a using statement or explicitly.

This causes the underlying streams and sockets to hang around leading to memory leaks and socket exhaustion.

https://learn.microsoft.com/en-us/dotnet/fundamentals/runtime-libraries/system-idisposable

I'm not sure why this has been ignored, and for so long, but it has.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions