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

MemoryLimitExceededException

public final class MemoryLimitExceededException extends JavaScriptException


Indicates that a JavaScriptIsolate's evaluation failed due to exceeding its heap size limit. This exception is thrown when exceeding the heap size limit configured for the isolate via IsolateStartupParameters, or the default limit. It is not guaranteed to be thrown if the Android system as a whole has run out of memory before the JavaScript environment has reached its configured heap limit.

The isolate may not continue to be used after this exception has been thrown, and other pending evalutions for the isolate will fail. The isolate may continue to hold onto resources (even if explicitly closed) until the sandbox has been shutdown. Therefore, it is recommended that the sandbox be restarted at the earliest opportunity in order to reclaim these resources.

Other isolates within the same sandbox may continue to be used, created, and closed as normal.

Summary

Inherited methods

From java.lang.Throwable
synchronized final void
synchronized Throwable
synchronized Throwable
String
String
StackTraceElement[]
synchronized final Throwable[]
synchronized Throwable
void
void
setStackTrace(StackTraceElement[] stackTrace)
String

Public constructors

MemoryLimitExceededException

public MemoryLimitExceededException()

MemoryLimitExceededException

public MemoryLimitExceededException(@NonNull String error)