Skip to content

Integrate tracer to detect memory leaks #151

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

Open
aryanjassal opened this issue May 20, 2025 · 1 comment · May be fixed by #153
Open

Integrate tracer to detect memory leaks #151

aryanjassal opened this issue May 20, 2025 · 1 comment · May be fixed by #153
Assignees
Labels
development Standard development

Comments

@aryanjassal
Copy link
Member

Specification

For almost a year now, the Polykey seednodes have had a memory leak. This can be observed at https://mainnet.polykey.com, where the memory consumption can be seen to spike, then the node fails and the container is restarted.

This leak does not happen on https://testnet.polykey.com which, at the moment, does not have any nodes directly connecting to it. This means that the memory leak happens due to leaks in the connection process.

@tegefaulkes ran a script which opened a connection and created and immediately destroyed tens of thousands of streams. He observed a noticable increase in memory consumption, when the whole operation should have net zero memory change. Going over the javascript code does not reveal anything obvious, so this issue is likely to lie in the native layer.

The role of tracer will be to track events and lifecycles of other objects during the test to narrow down on the precise layer where we have leaks. Our current theory is that quiche might itself have a memory leak, but this effort will be to confirm the source and attempt a fix.

Additional context

Tasks

  1. Integrate tracing from js-logger
  2. Apply to object lifecycles and functions where possible
  3. Run tests to run the code and confirm tracer can output valid data
  4. Run the repeat stream test to trace the memory leak
@aryanjassal aryanjassal self-assigned this May 20, 2025
@aryanjassal aryanjassal added the development Standard development label May 20, 2025
Copy link

linear bot commented May 20, 2025

ENG-626

@aryanjassal aryanjassal linked a pull request May 21, 2025 that will close this issue
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
development Standard development
Development

Successfully merging a pull request may close this issue.

1 participant