public final class V8Flags
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
FLAG_ALLOW_NATIVES_SYNTAX
The constant FLAG_ALLOW_NATIVES_SYNTAX.
|
static java.lang.String |
FLAG_EXPOSE_GC
The constant FLAG_EXPOSE_GC.
|
static java.lang.String |
FLAG_EXPOSE_INSPECTOR_SCRIPTS
The constant FLAG_EXPOSE_INSPECTOR_SCRIPTS.
|
static java.lang.String |
FLAG_INITIAL_HEAP_SIZE
The constant FLAG_INITIAL_HEAP_SIZE.
|
static java.lang.String |
FLAG_JS_FLOAT_16_ARRAY
The constant FLAG_JS_FLOAT_16_ARRAY.
|
static java.lang.String |
FLAG_MAX_HEAP_SIZE
The constant FLAG_MAX_HEAP_SIZE.
|
static java.lang.String |
FLAG_MAX_OLD_SPACE_SIZE
The constant FLAG_MAX_OLD_SPACE_SIZE.
|
static java.lang.String |
FLAG_USE_STRICT
The constant FLAG_USE_STRICT.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getCustomFlags()
Gets custom flags.
|
java.lang.String |
getIcuDataFile()
Gets icu data file.
|
int |
getInitialHeapSize()
Gets initial heap size.
|
int |
getMaxHeapSize()
Gets max heap size.
|
int |
getMaxOldSpaceSize()
Gets max old space size.
|
boolean |
isAllowNativesSyntax()
Is allow natives syntax.
|
boolean |
isExposeGC()
Is expose gc.
|
boolean |
isExposeInspectorScripts()
Is expose inspector scripts.
|
boolean |
isJsFloat16Array()
Is js float 16 array enabled.
|
boolean |
isSealed()
Is sealed.
|
boolean |
isUseStrict()
Is use strict.
|
V8Flags |
seal()
Seal the V8 flags so that it is read-only.
|
V8Flags |
setAllowNativesSyntax(boolean allowNativesSyntax)
Sets allow natives syntax.
|
V8Flags |
setCustomFlags(java.lang.String customFlags)
Sets custom flags (space separated).
|
V8Flags |
setExposeGC(boolean exposeGC)
Sets expose gc.
|
V8Flags |
setExposeInspectorScripts(boolean exposeInspectorScripts)
Sets expose inspector scripts.
|
V8Flags |
setIcuDataFile(java.lang.String icuDataFile)
Sets icu data file.
|
V8Flags |
setInitialHeapSize(int initialHeapSize)
Sets initial heap size.
|
V8Flags |
setJsFloat16Array(boolean jsFloat16Array)
Sets js float 16 array.
|
V8Flags |
setMaxHeapSize(int maxHeapSize)
Sets max heap size.
|
V8Flags |
setMaxOldSpaceSize(int maxOldSpaceSize)
Sets max old space size.
|
V8Flags |
setUseStrict(boolean useStrict)
Sets use strict.
|
java.lang.String |
toString() |
public static final java.lang.String FLAG_ALLOW_NATIVES_SYNTAX
public static final java.lang.String FLAG_EXPOSE_GC
public static final java.lang.String FLAG_EXPOSE_INSPECTOR_SCRIPTS
public static final java.lang.String FLAG_INITIAL_HEAP_SIZE
public static final java.lang.String FLAG_JS_FLOAT_16_ARRAY
public static final java.lang.String FLAG_MAX_OLD_SPACE_SIZE
public static final java.lang.String FLAG_MAX_HEAP_SIZE
public static final java.lang.String FLAG_USE_STRICT
public java.lang.String getCustomFlags()
public java.lang.String getIcuDataFile()
public int getInitialHeapSize()
public int getMaxHeapSize()
public int getMaxOldSpaceSize()
public boolean isAllowNativesSyntax()
public boolean isExposeGC()
public boolean isExposeInspectorScripts()
public boolean isJsFloat16Array()
public boolean isSealed()
public boolean isUseStrict()
public V8Flags seal()
public V8Flags setAllowNativesSyntax(boolean allowNativesSyntax)
allowNativesSyntax
- allow natives syntaxpublic V8Flags setCustomFlags(java.lang.String customFlags)
customFlags
- the custom flagspublic V8Flags setExposeGC(boolean exposeGC)
exposeGC
- the expose gcpublic V8Flags setExposeInspectorScripts(boolean exposeInspectorScripts)
exposeInspectorScripts
- the expose inspector scriptspublic V8Flags setIcuDataFile(java.lang.String icuDataFile)
icuDataFile
- the icu data filepublic V8Flags setInitialHeapSize(int initialHeapSize)
initialHeapSize
- the initial heap sizepublic V8Flags setJsFloat16Array(boolean jsFloat16Array)
jsFloat16Array
- the js float 16 arraypublic V8Flags setMaxHeapSize(int maxHeapSize)
Currently, by default V8 has a memory limit of 512mb on 32-bit systems, and 1gb on 64-bit systems. The limit can be raised by setting --max-old-space-size to a maximum of ~1gb (32-bit) and ~1.7gb (64-bit), but it is recommended that you split your single process into several workers if you are hitting memory limits.
Please refer to One small step for Chrome, one giant heap for V8 for detail.
maxHeapSize
- the max heap sizepublic V8Flags setMaxOldSpaceSize(int maxOldSpaceSize)
maxOldSpaceSize
- the max old space sizepublic V8Flags setUseStrict(boolean useStrict)
useStrict
- the use strictpublic java.lang.String toString()
toString
in class java.lang.Object