How do you set a limit for the memory an isolate can use and deal with it trying to go above that limit without killing your process?

149 views
Skip to first unread message

Zac Hansen

unread,
Sep 23, 2016, 2:33:24 AM9/23/16
to v8-users
https://bugs.chromium.org/p/v8/issues/detail?id=2726



I see that the second one was marked as resolved, but I don't see what the resolution was.

It makes sense to me that if you ever stopped an isolate from doing what it wants because it ran out of memory, that you wouldn't be able to guarantee any state for the isolate, but I don't understand why it would necessariliy be a problem across isolates or why it should absolutely stop the process immediately.  

Can someone speak to the current state of this?

Jakob Kummerow

unread,
Sep 23, 2016, 1:48:40 PM9/23/16
to v8-users
Handling (self-imposed, as opposed to OS-dictated) OOM without crashing is in theory possible, but in practice complicated enough that V8's current decision is not to support it. 

As issue 3060 says: if you have a patch that adds such support, is not overly complicated, and does not incur performance penalties in non-OOM situations, we would be happy to review it.


--
--
v8-users mailing list
v8-u...@googlegroups.com
http://groups.google.com/group/v8-users
---
You received this message because you are subscribed to the Google Groups "v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to v8-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mark Tarrabain

unread,
Sep 24, 2016, 10:58:36 AM9/24/16
to v8-users
While I could understand needing to unceremoniously abort an entire process if the entire process literally ran out of memory that the OS had allocated to it, it seems that it should certainly be possible, at least in theory, for an embedder to track heap allocations by an isolate, and to invoke a TerminateExecution on the isolate long before the process allocations exceed actual OS limitations. If an embedder does *NOT* attempt to terminate an isolate that it could so otherwise detect was behaving so inappropriately, then of course a crash might still be an appropriate response.   The embedder could detect via a TryCatch that the isolate cannot continue, and so handle what could be detected as an out of memory condition in that way.  

I don't know of any mechanism in the embedder's api for tracking absolutely all of an isolate's heap allocations for its data, however, so there is no way that I can see for an embedder to do this, however.   I also can't see how this would have measurable performance impact above and beyond what already clearly exists for handling the case where TerminateExecution  is invoked on an isolate from another thread, which appears to be working just fine.
To unsubscribe from this group and stop receiving emails from it, send an email to v8-users+u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages