You can configure the maximum heap size via command line flags or the API
("ResourceConstraints").You cannot configure non-heap memory (mostly consumed by parser and compiler). For CPU time, you can implement your own watchdog thread. You can use a TerminationException to interrupt execution without having to kill the thread. On Tue, Jun 26, 2018 at 3:57 AM Gonzalo Diethelm <[email protected]> wrote: > I have reviewed previous posts and it seems this has been discussed > before, but the answer seems to be very dependent on the V8 version. > > Is there a way to configure V8 prior to a call to script->Run(context), so > that there are hard(ish) limits on the amount of memory allocated by V8 > during the call, as well as on the amount of time spent running that code? > > If this is not (currently) possible, is it planned at all for V8 in the > (near) future? > > If it is not planned, are there any suggestions as to how to do this? > Should it be done externally to V8? For instance, is the recommendation to > spin off a thread running the code and somehow to monitor / kill that > thread if one or both of the limits are reached? Of course, killing threads > brings its own whole lot of problems to the discussion... > > Thanks for any hints, > Gonzalo > > -- > -- > v8-users mailing list > [email protected] > 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 [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- -- v8-users mailing list [email protected] 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
