Skip to content

Add memory stress tests for JSObject and JSClosure #399

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

Closed
wants to merge 3 commits into from

Conversation

kateinoigakukun
Copy link
Member

Motivation

Memory management bugs in JavaScript interop often only surface under extreme allocation pressure (see PR #393 which required 10-30 million allocations to reproduce). Current tests only validate normal usage patterns and don't catch memory leaks or reference counting issues that appear at system boundaries.

Summary

Adds comprehensive stress tests that push memory allocation to limits and test system behavior under extreme pressure to catch real memory management bugs.

Test Coverage

  • Memory exhaustion: Allocates 25k+ objects until limits are reached
  • Heap fragmentation: Tests recovery from fragmented allocation patterns
  • Boundary conditions: Mixed allocation with exponentially increasing pressure
  • Non-FinalizationRegistry scenarios: Focuses on manual memory management paths

Implementation

Tests use aggressive garbage collection and expect/handle memory exhaustion failures to validate reference counting mechanisms under stress.

Tests memory exhaustion, heap fragmentation, and boundary conditions
without FinalizationRegistry to validate reference counting under
extreme allocation pressure.
@kateinoigakukun kateinoigakukun force-pushed the add-stress-tests-for-jsobject-jsclosure branch from f8f5291 to 42e879f Compare August 9, 2025 06:32
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.

1 participant