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

Reduce stack usage #191

Closed
wants to merge 16 commits into from
Closed

Reduce stack usage #191

wants to merge 16 commits into from

Conversation

equals215
Copy link
Member

We are observing solid discrepancies between the heap usage as profiled by Pyroscope and what the system reports as used. As Pyroscope only profiles the heap (mem allocated by go runtime) it suggests that the stack is being used too much and is causing the OOMs observed. Most likely causes of an off-heap usage are :

  • Goroutine Stacks
  • CGO allocations
  • Memory-mapped files
  • Go Runtime Overhead

We are only using one CGO library : goada and a change was rolled to forcefully free any object allocated via this library (on the stack as the C++ code calls malloc())

Second line of investigation would be to troubleshoot WARC library as it's the top producer of goroutines and the profiler shows a lot of blocking : maybe the routines get stuck indefinitely and increase stack usage

@equals215 equals215 requested a review from CorentinB January 30, 2025 10:24
@equals215 equals215 self-assigned this Jan 30, 2025
@equals215
Copy link
Member Author

TODO :

  • Do a pass on context passing for stages to ensure that no critical part can be cut by a context cancelling (esp. HQ)

@equals215
Copy link
Member Author

Will not merge, splitting the PR in multiple PR with the change we want to keep

@equals215 equals215 closed this Feb 7, 2025
@CorentinB CorentinB deleted the v2/reduce-stack-usage branch February 7, 2025 15:58
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