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

Free Layer has a Memory Leak #8885

Closed
bernardobreder opened this issue Feb 13, 2024 · 0 comments · Fixed by #8902
Closed

Free Layer has a Memory Leak #8885

bernardobreder opened this issue Feb 13, 2024 · 0 comments · Fixed by #8902

Comments

@bernardobreder
Copy link

bernardobreder commented Feb 13, 2024

I am using the library of darknet and I have to create a network and free with a number of times. But, if I do it, I can see a leak memory with this loop (create network and layers and free them). I was debugging the alloc and free code and I found I bug in the free code. I expected that the free code check the null value of each layer fields and if it not null, than free it and set to null. But, there is some field that it set wrong field to null, like in the image.

A problem example: When the function free the weights_ema, it set the weights to null, that it not correct.

Captura de Tela 2024-02-13 às 11 43 55
Captura de Tela 2024-02-13 às 11 44 20

The correct changes is, with before (top) and after (bottom):

Captura de Tela 2024-02-13 às 12 21 29

@bernardobreder bernardobreder changed the title Layer free has a memory leak Free Layer has a Memory Leak Feb 13, 2024
@cenit cenit mentioned this issue May 3, 2024
cenit added a commit that referenced this issue May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant