Skip to content

SendGrid Client, Memory Leaks, and IDisposableΒ #1216

@larlewis

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.

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