Skip to content
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

BUG: memleak part 4 #825

Merged
merged 2 commits into from
Oct 5, 2022
Merged

Conversation

shanedsnyder
Copy link
Contributor

@shanedsnyder shanedsnyder commented Oct 3, 2022

  • dup() returned record name and destroy the name record hash table and all associated memory in functions darshan_log_get_name_records() and darshan_log_get_filtered_name_records()
  • free allocated array of record_id,record_name tuples passed back from above functions in CFFI backend
  • free individual record names passed back frome above functions in CFFI backend

Fixes #824

* dup() returned record name and destroy the name record hash
  table and all associated memory in functions
  darshan_log_get_name_records and
  darshan_log_get_filtered_name_records
* free allocated array of record_id,record_name tuples passed
  back from above functions in CFFI backend
* free individual record names passed back frome above functions
  in CFFI backend
@shanedsnyder
Copy link
Contributor Author

Memory profile looks much flatter now for reproducer in #824.
image

Although, you do see some slight increase over time, looks like basically a couple of MiB.

Extending the iterations:
image

Not sure what's going on as it seems to periodically reset, then rise again. Is it some sort of artifact of garbage collection happening in CFFI or something like that?

@tylerjereddy tylerjereddy added the bug Something isn't working label Oct 3, 2022
Copy link
Collaborator

@tylerjereddy tylerjereddy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Python side looks good to me at least. I also confirmed a fix to the memory leak with ior_hdf5_example.darshan and the reproducer in the matching issue, after accounting for likely garbage collection oscillations:

image

Copy link
Contributor

@carns carns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, I just have a minor suggestion to add comments to help remember what's going on here in the future. I think there are two instances to put it on. Otherwise looks good to me.

Copy link
Contributor

@carns carns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@shanedsnyder shanedsnyder merged commit 17997fe into main Oct 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pydarshan
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Another memory leak in PyDarshan
3 participants