Skip to content

Behavior of the MaxRuntimeHeapSize property of V8ScriptEngine class has changed #571

Description

@Taritsyn

Hello!

In version 7.4.5 when the limit specified by the MaxRuntimeHeapSize property of V8ScriptEngine class is exceeded, an “ScriptEngineException: The V8 runtime has exceeded its memory limit“ exception is no longer thrown. You can check this by using the following console application:

using Microsoft.ClearScript.V8;

namespace TestClearScriptV8
{
    class Program
    {
        static void Main(string[] args)
        {
            const string input = @"var arr = [];

for (var i = 0; i < 10000; i++) {
    arr.push('Current date: ' + new Date());
}";

            using (var engine = new V8ScriptEngine { MaxRuntimeHeapSize = new UIntPtr(640 * 1024) })
            {
                engine.Execute(input);
            }
        }
    }
}

Activity

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

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions