Skip to content

[TS] Implement near-heap-limit termination#4777

Open
coolreader18 wants to merge 2 commits intomasterfrom
noa/v8-heap-limit-cb
Open

[TS] Implement near-heap-limit termination#4777
coolreader18 wants to merge 2 commits intomasterfrom
noa/v8-heap-limit-cb

Conversation

@coolreader18
Copy link
Copy Markdown
Collaborator

Description of Changes

Uses Isolate::add_near_heap_limit_callback to prevent unbounded heap growth. Upon nearing the heap limit, we will now:

  1. Call Isolate::terminate_execution.
  2. Request that v8 double the heap limit.

Then, upon finishing a function call, we lower the heap limit back down.

This should hopefully fix the issue where v8 hits the heap limit and crashes the whole process.

Expected complexity level and risk

2

Testing

  • Manual testing with memory-leaky modules

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