Closed ntr5090Vitro closed 1 month ago
Hi @ntr5090Vitro
Thanks for reporting the issue. I can confirm you, that the Harvesters 1.4.2 release contains a bug resulting in a memory leak. A fix is already implemented and merged in the main branch of the repository (https://github.com/genicam/harvesters/pull/402)
The next release will coming soon including the fix for this issue. I will inform you here. In the mean time, you could use Harvesters 1.4.0 or checkout and use the current main branch of Harvesters.
Thank you so much for your response. I will look out for your announcement about the new version release.
Version 1.4.3 is now released and available on PyPI.
I would expect, that this issue is solved. So I will close it now. If you observe further issues or memory leaks, please feel free to reopen it or crate a new one.
Thanks for reporting and the detailed issue description!
Describe the Issue We are utilizing harvesters inside a Docker container that uses two Teledyne linescan cameras to take images. We have noticed that after about a half hour the container has grown to 32+GB in size and is eventually killed due to lack of system memory. I then ran tracemalloc to find where exactly the memory leak was coming from. The memory leak appears to come from line 2589 in harvesters core.py. See screenshots below.
Sample Code I can show a piece of code that demonstrates the reported phenomenon:
If yes, please provide a sample code: Pseudocode + code pieces is all I can present at the current moment:
the threads are created and the above function is run every time we need to take pictures with the cameras and then joined back to the main process which runs in an infinite loop (by design)
Expected Behavior No more memory leak
Screenshots tracemalloc output of top 10:![tracemalloc output of top 10](https://github.com/genicam/harvesters/assets/127967253/b054932a-4261-48d9-aada-efa198ad170c)
place in harvesters.core:![place in harvesters core](https://github.com/genicam/harvesters/assets/127967253/470f9df0-641c-4e2f-a7bf-358f030e78bd)
Configuration
Reproducibility
This phenomenon can be stably reproduced:
Every 30 minutes approximately
If applicable, please provide your observation about the reproducibility.
Actions You Have Taken
Additional context Add any other context about the problem here.