Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix memory leak in TensorflowTransform #4223

Merged
merged 3 commits into from
Sep 29, 2019
Merged

Conversation

KsenijaS
Copy link
Member

This PR fixes two memory leaks:

  1. After executing the graph, input tensor are not being freed
  2. When running multiple pipelines (sessions), graphs are not being freed.

This fixes #4134

@KsenijaS KsenijaS requested a review from a team as a code owner September 17, 2019 18:30
@dnfclas
Copy link

dnfclas commented Sep 19, 2019

CLA assistant check
All CLA requirements met.

Copy link
Member

@eerhardt eerhardt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this approach is fine for now. But as I discussed with @codemzs, we need to solve this issue all up in ML.NET. See #906 (which was closed for some reason?).

TensorFlow and Onnx transformers both have native resources that need to be cleaned up. And with #4157 we are adding even more transformers that require native resource clean up. Relying on Finalizers to do this cleanup is not ideal. Instead, we should allow users to dispose transformers that need disposing without relying on the Finalizer to do it.

Copy link
Member

@codemzs codemzs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@codemzs codemzs merged commit a072b5e into dotnet:master Sep 29, 2019
@ghost ghost locked as resolved and limited conversation to collaborators Mar 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Memory leak in the latest ML.NET 1.3.1
5 participants