ClearScript Library
ClearScript Library
ClearScript Library Reference
Microsoft.ClearScript.V8
V8ScriptEngine Class
V8ScriptEngine Properties
CpuProfileSampleInterval Property
EnableRuntimeInterruptPropagation Property
FileNameExtension Property
Global Property
MaxRuntimeHeapSize Property
MaxRuntimeStackUsage Property
RuntimeHeapSizeSampleInterval Property
RuntimeHeapSizeViolationPolicy Property
Script Property
SuppressExtensionMethodEnumeration Property
SuppressInstanceMethodEnumeration Property

# V8ScriptEngineMaxRuntimeHeapSize Property

Gets or sets a soft limit for the size of the V8 runtime's heap.
Namespace: Microsoft.ClearScript.V8
Assembly: ClearScript.V8 (in ClearScript.V8.dll) Version: 7.5.0
Syntax
C#
VB
C++
F#
Copy

    public UIntPtr MaxRuntimeHeapSize { get; set; }

    Public Property MaxRuntimeHeapSize As UIntPtr
    	Get
    	Set

    public:
    property UIntPtr MaxRuntimeHeapSize {
    	UIntPtr get ();
    	void set (UIntPtr value);
    }

    member MaxRuntimeHeapSize : UIntPtr with get, set

#### Property Value

UIntPtr
Remarks

This property is specified in bytes. When it is set to the default value, heap size monitoring is disabled, and scripts with memory leaks or excessive memory usage can cause unrecoverable errors and process termination.

A V8 runtime unconditionally terminates the process when it exceeds its resource constraints (see V8RuntimeConstraints). This property enables external heap size monitoring that can prevent termination in some scenarios. To be effective, it should be set to a value that is significantly lower than MaxOldSpaceSize. Note that enabling heap size monitoring results in slower script execution.

Exceeding this limit causes the V8 runtime to behave in accordance with RuntimeHeapSizeViolationPolicy.

Note that ArrayBuffer memory is allocated outside the runtime's heap and is therefore not tracked by heap size monitoring. See MaxArrayBufferAllocation for additional information.

See Also

#### Reference

V8ScriptEngine Class
Microsoft.ClearScript.V8 Namespace

Copyright © Microsoft Corporation. All rights reserved.

Send comments on this topic to Microsoft