-
Notifications
You must be signed in to change notification settings - Fork 60
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 iterator-related memory issues #620
Conversation
632588d
to
293f104
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, Gigon. It looks good to me. I left an optional suggestion regarding comments on the test cases
python/cucim/tests/performance/clara/test_read_region_memory_usage.py
Outdated
Show resolved
Hide resolved
Have merged PR: #618 Looks like there are some conflicts |
Signed-off-by: Gigon Bae <gbae@nvidia.com>
GIL is not acquired when using Python object. Signed-off-by: Gigon Bae <gbae@nvidia.com>
- Return a shared pointer of CuImageIterator, taking ownership of CuImageIterator instance, instead of returning a copy of CuImageIterator - Do not create new instance for CuImageIterator when __iter__ is called. Instead, return self. - Wait until all threads are finished in ThreadBatchDataLoader destructor Signed-off-by: Gigon Bae <gbae@nvidia.com>
- Throw StopIteration exception early - Do not set nullptr for 'raster_data_' in ThreadBatchDataLoader::next_data() - Setting nullptr prevents freeing memory in the destructor of ThreadBatchDataLoader Signed-off-by: Gigon Bae <gbae@nvidia.com>
293f104
to
cb03761
Compare
/merge |
I am seeing an error message regarding cpu memory usage: It is likely that it is intermittent issue (may need to increase the threshold > 1273671680 - 1223131136 = 50540544). |
Thanks Gigon! 🙏 Should we file a follow-up issue or PR? |
…est (#623) There is a case where memory usage check is not stable enough: #620 (comment) Instead of choosing index 1 and 4 (among 5 samples), choose 5 and 9 (among 10 samples) for memory leak check. Authors: - Gigon Bae (https://github.com/gigony) Approvers: - Gregory Lee (https://github.com/grlee77) URL: #623
Filed as issue: #625 |
MERGE after #618
Fix memory corruption issue in ThreadBatchDataLoader
Fix #592
__iter__
is called. Instead, return self.Fix memory leak in ThreadBatchDataLoader
Fix #598
raster_data_
inThreadBatchDataLoader::next_data()
Fix fatal errors for cache object
Add iterator-related test cases for memory issue