Stay organized with collections Save and categorize content based on your preferences.

IsolateStartupParameters

public final class IsolateStartupParameters


Class used to set startup parameters for JavaScriptIsolate.

Summary

Constants

static final long

Public constructors

Public methods

@IntRange(from = 0) long

Gets the max heap size used by the JavaScriptIsolate.

void
@RequiresFeature(name = JavaScriptSandbox.JS_FEATURE_ISOLATE_MAX_HEAP_SIZE, enforcement = "androidx.javascriptengine.JavaScriptSandbox#isFeatureSupported")
setMaxHeapSizeBytes(@IntRange(from = 0) long size)

Sets the max heap size used by the JavaScriptIsolate.

Constants

DEFAULT_ISOLATE_HEAP_SIZE

public static final long DEFAULT_ISOLATE_HEAP_SIZE = 0

Public constructors

IsolateStartupParameters

public IsolateStartupParameters()

Public methods

getMaxHeapSizeBytes

public @IntRange(from = 0) long getMaxHeapSizeBytes()

Gets the max heap size used by the JavaScriptIsolate. If not set using setMaxHeapSizeBytes, the default value is DEFAULT_ISOLATE_HEAP_SIZE which indicates no heap size limit.

Returns
@IntRange(from = 0) long

heap size in bytes

setMaxHeapSizeBytes

@RequiresFeature(name = JavaScriptSandbox.JS_FEATURE_ISOLATE_MAX_HEAP_SIZE, enforcement = "androidx.javascriptengine.JavaScriptSandbox#isFeatureSupported")
public void setMaxHeapSizeBytes(@IntRange(from = 0) long size)

Sets the max heap size used by the JavaScriptIsolate. A heap size of DEFAULT_ISOLATE_HEAP_SIZE indicates no limit.

If a value higher than the device specific maximum heap size limit is supplied, this limit will be used as the maximum heap size.

The applied limit may not be exact. For example, the limit may internally be rounded up to some multiple of bytes, be increased to some minimum value, or reduced to some maximum supported value.

Parameters
@IntRange(from = 0) long size

heap size in bytes