8000 tsdb: zero out Labels and memSeries pointers in pool by bboreham · Pull Request #13712 · prometheus/prometheus · GitHub
[go: up one dir, main page]

Skip to content

Conversation

bboreham
Copy link
Member
@bboreham bboreham commented Mar 5, 2024

So that the garbage-collector doesn't see this memory as still in use.

To explain a little further, the block of memory in the pool will be seen as a zero-length slice when used, but it might have previously contained 10,000 series. Unless we zero out those pointers, or re-use that block for a new scrape of length 10,000, they will all continue to be seen as valid references by the garbage-collector.

This is more noticeable when using -tags dedupelabels, but still relevant before.

@bboreham bboreham requested a review from jesusvazquez as a code owner March 5, 2024 20:07
@bboreham bboreham force-pushed the zero-pooled-slices branch from e4a4135 to df456ca Compare March 6, 2024 09:36
So that the garbage-collector doesn't see this memory as still in use.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
@bboreham bboreham force-pushed the zero-pooled-slices branch from df456ca to f68a4ce Compare March 6, 2024 11:46
Copy link
Member
@beorn7 beorn7 left a comment

Choose a reason for hiding this comment

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

I'll fix my nits myself here in the PR.

beorn7 added 2 commits March 6, 2024 13:36
Signed-off-by: Björn Rabenstein <github@rabenste.in>
Signed-off-by: Björn Rabenstein <github@rabenste.in>
@beorn7 beorn7 merged commit bbe39af into prometheus:main Mar 6, 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.

2 participants
0