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

PtNDArray memory leak,ai.djl.pytorch.jni.PyTorchLibrary#torchIndexInit don't have matching method to delete index #2283

Closed
HuLaLaGa opened this issue Jan 4, 2023 · 1 comment · Fixed by #2300
Assignees
Labels
bug Something isn't working

Comments

@HuLaLaGa
Copy link

HuLaLaGa commented Jan 4, 2023

Description

PtNDArray.get(NDArray index)和PtNDArray.set(NDIndex index, NDArray value) cause memory leak

Expected Behavior

(what's the expected behavior?)

Error Message

memory leak

How to Reproduce?

try (final NDManager ndManager = NDManager.newBaseManager()) {
while (true) {
try (NDManager manager = ndManager.newSubManager()) {
NDArray a = manager.create(new int[1024 * 1024 * 1]);
final NDArray eq = a.eq(1);
a.get(eq);
}
}
}

Steps to reproduce

(Paste the commands you ran that produced the error.)

What have you tried to solve it?

  1. add a method to delete index memory which created by method ai.djl.pytorch.jni.PyTorchLibrary#torchIndexInit

Environment Info

Please run the command ./gradlew debugEnv from the root directory of DJL (if necessary, clone DJL first). It will output information about your system, environment, and installation that can help us debug your issue. Paste the output of the command below:

PASTE OUTPUT HERE
@HuLaLaGa HuLaLaGa added the bug Something isn't working label Jan 4, 2023
@frankfliu
Copy link
Contributor

This is duplicate of: #2281

@zachgk zachgk linked a pull request Jan 6, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants