OnSustainedMemoryPressureListener

Listener notified when critical native memory pressure persists despite the SDK's automatic recovery.

Under critical memory pressure the SDK recovers automatically: page caches are trimmed, in-flight page renders are aborted and backed off, and affected pages re-render once memory recovers. All of that is silent — transient pressure episodes never invoke this listener.

Only when pressure remains critical for several consecutive memory polls — meaning the automatic recovery could not bring memory back down, typically because the open document itself requires more memory than the device can sustain — is this listener invoked, once per pressure episode. The recommended response is to reduce memory at the source: close or replace the document (finish the hosting activity, swap the document, or remove the fragment). There is nothing to resume or undo — if the host takes no action, the SDK keeps operating in its degraded-but-safe mode (some pages may stay blank until memory recovers).

The listener is invoked on the main thread. Register via PdfFragment.setOnSustainedMemoryPressureListener.

Functions

Link copied to clipboard

Called on the main thread when critical native memory pressure has persisted across several consecutive memory polls despite automatic cache trimming and render backoff. Invoked at most once per pressure episode.