Closed Spulae closed 9 months ago
Very low memory limits tend to cause this condition. You can listen for onCatastrophicError
which will give you a way to kind of recover from the issue, but not really. I recommend at least 128mb memory limit though.
Node.js Version: v21.6.1
I need to enforce an 8MB memory limit while executing untrusted JavaScript code. Below is the code snippet I'm using:
However, when I run the program, it terminates unexpectedly with the following error message:
Shouldn't the
memoryLimit
option in theIsolate
constructor prevent this type of error? If not, how can I safely execute untrusted JavaScript code without causing my program to crash?