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

pkg/perf: Prevent intermediate perfmap/jitdump entry lists #2325

Merged
merged 1 commit into from Dec 1, 2023

Conversation

brancz
Copy link
Member

@brancz brancz commented Nov 30, 2023

Why?

Previously we maintained multiple lists of perfmap and jitdump entries as well as all related strings. This caused somewhat large memory spikes when a lot of these have to be loaded frequently.

What?

Prevent anything that doesn't have to happen on heap to go onto the heap in the first place.

How?

Now strings are never on heap and are directly written to the optimized symtab file, and only entries are loaded into memory once so they can be sorted and deduplicated easily and then without any further intermediate lists directly written to the optimized symtab file.

Test Plan

Tested locally against jitdump and perfmap workloads.

Further notes

If this is also not sufficient the next optimization would be to read perfmap files from the back and directly write entries that are read if they don't conflict with any already written memory ranges.

@brancz brancz requested a review from a team as a code owner November 30, 2023 19:22
@brancz brancz force-pushed the symtab-mem-usage branch 2 times, most recently from 63be869 to defdd55 Compare December 1, 2023 09:07
Previously we maintained multiple lists of perfmap and jitdump entries
as well as all related strings. This caused somewhat large memory spikes
when a lot of these have to be loaded frequently.

Now strings are never on heap and are directly written to the optimized
symtab file, and only entries are loaded into memory once so they can be
sorted and deduplicated easily and then without any further intermediate
lists directly written to the optimized symtab file.

If this is also not sufficient the next optimization would be to read
perfmap files from the back and directly write entries that are read if
they don't conflict with any already written memory ranges.
@brancz brancz merged commit d8f08a5 into main Dec 1, 2023
22 checks passed
@brancz brancz deleted the symtab-mem-usage branch December 1, 2023 10:47
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.

None yet

1 participant