MemoryPressureObserver

Source of OS low-memory signals (Android ComponentCallbacks2.onTrimMemory, iOS UIApplicationDidReceiveMemoryWarningNotification, …). Engines and the model manager subscribe to it to evict KV caches, model weights, and download buffers.

Inheritors

Properties

Link copied to clipboard

The most recently reported level, or MemoryPressureLevel.NORMAL if none has been reported.

Functions

Link copied to clipboard

Registers listener. Closing the returned handle unregisters it; closing it more than once is a no-op.