-
Notifications
You must be signed in to change notification settings - Fork 69
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
remove H5close call, introduce specific hdf5 object H5xclose calls #397
Conversation
I have been running a simdetector IOC with two instances of HDF5 plugins for a while and have not noticed any memory leaks with these changes. An example of the test run:
|
Script used in the test: |
I have not tested these changes with attributes or layout XML files supplied to any plugin. |
Thanks for putting in the effort on this one @hinxx - its really very much appriciated!
Yikes! Good reason for this PR then 👍 From a quick glance at the changes it looks like we have consistently forgotten to close hdf5 datatype objects - and one instance of a dataspace object.
That does make it clear what paths you have tested - but we should remove those comments before merging. As a hint for the future: you can actually write these kind of comments 'inline' on the Pull Request here on github... |
I will test this today and if it seems to fix the problem I will merge it, removing the comments. |
I don't think so, no. I'll raise an issue for that one.
Memory leaks in error paths are probably less critical but still it would be good to eliminate. I see you have raised issue #393 to deal with that. |
That was something I spotted the first time looked around the code to find places for |
The initial fix for memory leaks that added a call to H5close() was not proper. It caused IOC crashes if two HDF5 plugin instances were used (#390 (comment)).
This set of changes removes the call to H5close() and adds localized resource freeing that should result in no memory leaks.
I added comments to the code paths that I've seen taken (
// HK OK
). Some other cases I did not test or verify (i.e. error branches) and for those the comment reads// HK test
.Someone needs to go over my changes and verify the correctness.