Fix a memory leak in trajectory sampler#4057
Conversation
…nd_file after regrid_accumulate
tclune
left a comment
There was a problem hiding this comment.
I'm not sure how this would be a memory leak. Yes, Regrid does more work than Redist, but both create a RouteHandle.
|
@metdyn I fixed up |
|
Query for @metdyn and @atrayano: I looked at MAPL and I see other places we do an In the first two, we do Store→Redist→Release, but in the |
|
Also, in In Trajectory we seem to do create → regrid → destroy on |
|
Hi @mathomp4, Thanks for pointing out the incomplete cycle in station sampler: Lastly but not the least, station sample does not vary with time, thus memory did not leak in this case, luckily. |
|
I wanted @atrayano to be aware that a PR is coming. |
|
@atrayano, |
|
Hi @mathomp4, |
|
@metdyn Okay. If it passes the CI tests, I'll merge into develop. |
|
Also, @metdyn, do you need a release for this? Or is working from |
Types of change(s)
Checklist
make tests)Description
Thanks to @atrayano for finding a bug in trajectory sampler code that is causing a big memory leakage. It shows up when repeatedly working on destroy grid, regenerate grid, regrid, then redist. Running ExtDadaDriver with synthetic data created an output on airs_aqua trajectory. A slice of 3D data shows reasonable value.
Related Issue