This project has moved. For the latest updates, please go here.

Instantiating V8Runtime with V8RuntimeConstraints crashes

Mar 19, 2015 at 5:37 PM
Hello!

I recently updated from ClearScript 5.4.0 to 5.4.1 and started receiving an AccessViolationException every time I create a v8Runtime instance witih V8RuntimeConstraints defined as follows:
 V8RuntimeConstraints v8RuntimeConstraints = new V8RuntimeConstraints
 {
        MaxExecutableSize = 24 * 1024 * 1024,
        MaxOldSpaceSize = 24 * 1024 * 1024,
        MaxNewSpaceSize = 24 * 1024 * 1024
 };

V8Runtime v8Runtime = new V8Runtime(v8RuntimeConstraints);
The exception did not come before the update. Do any of you know what could be wrong?
Coordinator
Mar 19, 2015 at 7:43 PM
Hi slyngel,

It looks like V8 now expects those constraints to be expressed in mebibytes, so try setting those properties to 24 instead of 24x1024x1024.

In general we no longer recommend that you use V8RuntimeConstraints unless your application has a Chrome-like multi-process architecture that withstands process crashes. You can find more information here.

We'll update the documentation in the next point release.

Thanks!
Mar 20, 2015 at 7:58 AM
Thanks for the info! Awesome answer. Keep up the great work!