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

drcachesim memory leak in snoop filter #6893

Closed
brettcoon opened this issue Jul 19, 2024 · 0 comments · Fixed by #6906
Closed

drcachesim memory leak in snoop filter #6893

brettcoon opened this issue Jul 19, 2024 · 0 comments · Fixed by #6906
Assignees

Comments

@brettcoon
Copy link
Contributor

The drcachesim snoop filter tracks cache lines in a map of coherence_table_entry_t structs, one struct per cache line, to track the sharing state of each line. But once allocated, the struct is never removed from the map, causing the map to grow monotonically with the cumulative footprint of the trace, rather than being limited to the total line count of the tracked caches. For large traces this can cause out-of-memory errors.

Suggested fix is to delete the struct from the map once there are no caches sharing the line.

See

std::vector<bool> sharers;

@brettcoon brettcoon self-assigned this Jul 19, 2024
brettcoon added a commit that referenced this issue Aug 1, 2024
The snoop cache tracks sharing for each cacheline accessed.  The
prior code never deleted these tracking structures once they were
allocated, causing the tracking data to grow with every new
cacheline touched.  This change deletes cacheline trackers once
the cacheline is no longer present in any tracked cache.  It also
changes the container used for tracking from a vector of bools to
a set of cache IDs, to simplify snooped cache lookup and iteration.

Fixes: #6893
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant