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

How to protect the JVM from (intentional) OOMs ? #428

Open
funkomatic opened this issue Oct 26, 2018 · 4 comments
Open

How to protect the JVM from (intentional) OOMs ? #428

funkomatic opened this issue Oct 26, 2018 · 4 comments

Comments

@funkomatic
Copy link

Hi,
It is very easy to write a small script that will go OOM in the JS layer, causing the JVM to crash.
For instance the following script :

var longstring="ec2ca74c-d91b-11e8-9e1d-db5bb294a325-ec2da822-d91b-11e8-afde-9b50161507bc-ec2ea02e-d91b-11e8-991e-73331350b545-ec2f9c90-d91b-11e8-8aa8-ff3f319915e9-ec309a28-d91b-11e8-a5ae-af9279087141-ec3197ca-d91b-11e8-ac5f-3b03eee727e2-ec329b02-d91b-11e8-9c93";
var a = [];
while (true) {
        a.push(longstring);
}

Will end up with following abort :

#
# Fatal javascript OOM in invalid array length
#
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGILL (0x4) at pc=0x00007fa15f938409, pid=28270, tid=0x00007fa1641d7700

Are there ways of protecting the JVM from exiting due to an abortion in the V8 library ?
Thanks

@irbull
Copy link
Member

irbull commented Jan 11, 2019

There might be a V8 API to add a handler when we are getting low on memory and then we can throw a Java OOM exception or something. I'll mark this as "Good First Issue", although it might be a challenging one :)

@irbull
Copy link
Member

irbull commented Jan 11, 2019

@ccomandini
Copy link

this topic is really interesting also on the product i am working

@baiyue00000
Copy link

I am also interested in this issue, our projects sometimes crash for this reason.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants