We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
memoryLimit
Using the test code from https://github.com/laverdet/isolated-vm/blob/main/tests/catastrophic-error.js#L14, I'm testing as to the behaviour of OOM conditions. However, when running the following (e.g. just with node example.mjs), the memorySize limit isn't applied and the node process continues using 100% CPU and consuming memory until manually killed.
node example.mjs
memorySize
node
import ivm from 'isolated-vm'; for (const run of [ context => context.eval('ivm.lib.testOOM()'), ]) { const isolate = new ivm.Isolate({ memoryLimit: 128, onCatastrophicError: message => { console.log(message); }, }); const context = isolate.createContextSync(); context.global.setSync('ivm', ivm); run(context); }
By comparison, running the example from https://github.com/laverdet/isolated-vm/?tab=readme-ov-file#examples behaves as the example shows, with the process ending with RangeError. Decreasing the memorySize in the example works - dropping the limit to 8MB sees the script end after 10MB.
RangeError
isolated-vm
gcc --version
Apple clang version 15.0.0 (clang-1500.1.0.2.5) Target: arm64-apple-darwin23.3.0 Thread model: posix InstalledDir: /Library/Developer/CommandLineTools/usr/bin
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Using the test code from https://github.com/laverdet/isolated-vm/blob/main/tests/catastrophic-error.js#L14, I'm testing as to the behaviour of OOM conditions. However, when running the following (e.g. just with
node example.mjs
), thememorySize
limit isn't applied and thenode
process continues using 100% CPU and consuming memory until manually killed.By comparison, running the example from https://github.com/laverdet/isolated-vm/?tab=readme-ov-file#examples behaves as the example shows, with the process ending with
RangeError
. Decreasing thememorySize
in the example works - dropping the limit to 8MB sees the script end after 10MB.Versions
isolated-vm
v4.7.2gcc --version
:The text was updated successfully, but these errors were encountered: