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

Fix memory leak #3887

Merged
merged 3 commits into from
Jul 30, 2023
Merged

Fix memory leak #3887

merged 3 commits into from
Jul 30, 2023

Conversation

Jarred-Sumner
Copy link
Collaborator

What does this PR do?

We weren't freeing strong references. Everything using JSC.Strong leaked memory. The code using .protect() or .unprotect() is unaffected.

Fixes #3065

@github-actions
Copy link
Contributor

@Jarred-Sumner 3 files with test failures on linux-x64:

  • test/js/node/child_process/child_process-node.test.js
  • test/js/node/tls/node-tls-connect.test.ts
  • test/js/node/watch/fs.watch.test.ts

View test output

#d9062e9156f1a22d5272bbd138d7c36b5b76cee9

@github-actions
Copy link
Contributor

@Jarred-Sumner 2 files with test failures on linux-x64-baseline:

  • test/js/node/child_process/child_process-node.test.js
  • test/js/node/tls/node-tls-connect.test.ts

View test output

#d9062e9156f1a22d5272bbd138d7c36b5b76cee9

@Jarred-Sumner
Copy link
Collaborator Author

@cirospaciari can you update this test with a hardcoded local peer certificate to prevent it from being flaky going forward?

image

@Jarred-Sumner Jarred-Sumner merged commit 1db119e into main Jul 30, 2023
@Jarred-Sumner Jarred-Sumner deleted the jarred/leak-fixes branch July 30, 2023 09:03
@github-actions
Copy link
Contributor

@Jarred-Sumner 9 files with test failures on bun-darwin-aarch64:

  • test/js/bun/http/serve.test.ts
  • test/js/bun/spawn/spawn-streaming-stdout.test.ts
  • test/js/bun/spawn/spawn.test.ts
  • test/js/bun/test/test-test.test.ts
  • test/js/deno/crypto/webcrypto.test.ts
  • test/js/node/child_process/child_process-node.test.js
  • test/js/node/tls/node-tls-connect.test.ts
  • test/js/third_party/socket.io/socket.io-connection-state-recovery.test.ts
  • test/js/web/timers/setTimeout.test.js

View test output

#d9062e9156f1a22d5272bbd138d7c36b5b76cee9

trnxdev pushed a commit to trnxdev/bun that referenced this pull request Aug 9, 2023
* Fix memory leak

* Remove an extra copy

* Further fixes

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
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.

Memory usage keeps increasing while heapSize remains unchanged
1 participant