public final class TerminationInfo


Information about how and why an isolate has terminated.

Summary

Constants

static final int

The isolate exceeded its heap size limit.

static final int

The whole sandbox died (or was closed), taking this isolate with it.

static final int

The isolate (but not necessarily the sandbox) has crashed for an unknown reason.

Public methods

@NonNull String

Get the message associated with this termination.

int

Get the status code of the termination.

@NonNull String

Describe the status code of the termination.

@NonNull String

Describe the termination.

Constants

STATUS_MEMORY_LIMIT_EXCEEDED

Added in 1.0.0-beta01
public static final int STATUS_MEMORY_LIMIT_EXCEEDED = 3

The isolate exceeded its heap size limit.

The isolate may continue to hold onto resources (even if explicitly closed) until the sandbox has been shutdown. If necessary, restart the sandbox at the earliest opportunity in order to reclaim these resources.

Note that memory exhaustion will kill the whole sandbox, so any other isolates within the same sandbox will be terminated with STATUS_SANDBOX_DEAD.

STATUS_SANDBOX_DEAD

Added in 1.0.0-beta01
public static final int STATUS_SANDBOX_DEAD = 2

The whole sandbox died (or was closed), taking this isolate with it.

STATUS_UNKNOWN_ERROR

Added in 1.0.0-beta01
public static final int STATUS_UNKNOWN_ERROR = 1

The isolate (but not necessarily the sandbox) has crashed for an unknown reason.

Public methods

getMessage

Added in 1.0.0-beta01
public @NonNull String getMessage()

Get the message associated with this termination. The content or format of these messages is not stable between JavaScriptEngine versions.

Returns
@NonNull String

a human-readable message about the termination

getStatus

Added in 1.0.0-beta01
public int getStatus()

Get the status code of the termination.

New status codes may be added with new JavaScriptEngine versions.

Returns
int

the status code of the termination

getStatusString

Added in 1.0.0-beta01
public @NonNull String getStatusString()

Describe the status code of the termination. These strings are not stable between JavaScriptEngine versions.

Returns
@NonNull String

a description of the status code of the termination

toString

public @NonNull String toString()

Describe the termination. The content or format of this description is not stable between JavaScriptEngine versions.

Returns
@NonNull String

a human-readable description of the termination