Skip to content
This repository has been archived by the owner on Aug 23, 2023. It is now read-only.

fix ccache memory leak #1078

Merged
merged 1 commit into from
Oct 8, 2018
Merged

fix ccache memory leak #1078

merged 1 commit into from
Oct 8, 2018

Conversation

robert-milan
Copy link
Contributor

Copy link
Contributor

@replay replay left a comment

Choose a reason for hiding this comment

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

Those results look really great. Looking forward to see how this behaves in a prod env

@Dieterbe
Copy link
Contributor

Dieterbe commented Oct 3, 2018

for the record, this reverts cce8a97

@Dieterbe
Copy link
Contributor

Dieterbe commented Oct 5, 2018

i want a bit more time to dig into this

@woodsaj
Copy link
Member

woodsaj commented Oct 8, 2018

@Dieterbe the memory leak is a pretty big issue for production systems. I dont see any reason why this change should be blocked.

Copy link
Contributor

@DanCech DanCech left a comment

Choose a reason for hiding this comment

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

Looking at the benchmarks on cce8a97 I don't see that there were any meaningful gains. Unless I'm reading the benchmarks wrong I'd say go ahead and merge this, especially since it's just going back to previously-working code.

@Dieterbe
Copy link
Contributor

Dieterbe commented Oct 8, 2018

ok that's fair. especially since we now track time we block on the queue.
i don't see how this would fix #1058 though as in that issue cache limit is not reached and there are no evictions.
While we're not sure this will fix #1057 either, it should at least have a positive impact on memory in some cases. (it will allow to reclaim memory earlier than before and may lead to an overall reduced heap size)

PS @robert-milan please make it a habit to describe the problem and the solution in either the commit message or in the PR (if you put it in the former, it'll automatically go into the PR description as well if there's only 1 commin in the PR). personally i'm a fan of putting it in both.

@Dieterbe Dieterbe merged commit 58e3ba8 into master Oct 8, 2018
@Dieterbe
Copy link
Contributor

Dieterbe commented Oct 9, 2018

so basically:

  • previous behavior: range used 1 slice, memory could only be freed once all chunks in the range were evicted
  • new behavior: allocate chunks individually, allowing to free memory earlier / more granularly, as chunks for the range are being evicted. the payoff happens when chunks that were queried in the same range don't expire at the same time.

tradeoffs:

  • use a bit more cpu, may slow down requests, but probably negligible
  • more live pointers, may slow down GC (and hence requests)

we choose not do synthetic benchmarks to look into these trade-offs. with some luck our prod enviroments are not too noisy so we'll be able to tell from those.

@Dieterbe Dieterbe deleted the fix-ccache-mem-leak branch October 29, 2018 09:07
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants