-
Notifications
You must be signed in to change notification settings - Fork 95
Fix memory leak issue when reset file in multi support mode #352
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
base: develop
Are you sure you want to change the base?
Conversation
Fix issue ecmwf/cfgrib#283 ecmwf/cfgrib#325 and ecmwf/cfgrib#429 |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #352 +/- ##
===========================================
- Coverage 88.41% 88.39% -0.02%
===========================================
Files 844 844
Lines 62721 62735 +14
Branches 11116 11119 +3
===========================================
+ Hits 55456 55457 +1
- Misses 7265 7278 +13 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Can you please provide a test which shows there is a leak. We have an example here: Running this with a multi-field input GRIB file shows no leaks
|
Here is a test in python lib. ecmwf/cfgrib#429
Whe I open a 50M size of grib2 file having 70 counts of values in one geom point will use 50*70=3.5G memory. |
Actually if I run my test with your proposed changes, then there is a leak! cd examples/C The current version of ecCodes does not leak (see above) So I think the leak is in cfgrib and not in the core library. |
I change my code and there is no memory leak. |
Thanks for providing the latest multi3.c
|
Description
In multi support, when reset file will only set file point as NULL, but not release the memory allocated to message.
This pr will release the message and gm memory and rebuild gm link array on grib context.
Need to merge ecmwf/cfgrib#428 as well to fix the bug.
Contributor Declaration
By opening this pull request, I affirm the following: