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

use lru cache compileunit and we can configure cache size #583

Closed
wants to merge 1 commit into from

Conversation

anjiahao1
Copy link

In some larger ELF files, traversing the CUs may cause an OOM use lru and set a cache size, can avoid it

In some larger ELF files, traversing the CUs may cause an OOM
use lru and set a cache size, can avoid it

Signed-off-by: anjiahao <[email protected]>
@sevaa
Copy link
Contributor

sevaa commented Dec 6, 2024

Thank you. In general, a memory saving mode is something users have requested in the past. That said, I am not convinced that memoizing this particular function is the right way to do it. When scrolling through a CU, the library will retain DIE objects in ways other than _dielist/_diemap - for example by keeping _parent. Also, the LRU caches that you build will be accounted on per-CU basis - that technically does not clamp the global memory consumption.

If your scenario involves scrolling through all CUs in a binary, consider force-clearing the CU cache in the DWARFInfo once you are done with it. You will get more memory saving from that.

And also, please do not submit PRs before the autotest passes.

@eliben
Copy link
Owner

eliben commented Dec 7, 2024

@sevaa how about moving this discussion to a separate issue to collect it all in one place

@sevaa
Copy link
Contributor

sevaa commented Dec 7, 2024

#586

@anjiahao1
Copy link
Author

ok, thanks @sevaa @eliben

@anjiahao1 anjiahao1 closed this Dec 17, 2024
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 this pull request may close these issues.

3 participants