Amazon Developer

as

Settings
Sign out
Notifications
Alexa
Amazon Appstore
Ring
AWS
Documentation
Support
Contact Us
My Cases
Get Started
Design and Develop
Publish
Reference
Support
Native
Skip to main content

Interface IMemoryWarningHandler

interface IMemoryWarningHandler
Extends com.amazon.apmf.IStandard Handles memory warnings for application components. This interface notifies application components of changes to the system memory level or changes to the allowed memory usage of its process. Components must take appropriate actions upon receiving warnings to avoid forceful termination by Low Memory Killer (LMK). To receive memory warnings, application components implement both their primary component interface (IInteractiveComponent, IServiceComponent, or ITaskComponent) and this IMemoryWarningHandler interface.

Methods

onMemoryWarning()

void onMemoryWarning(IMemoryWarningInfo* info)
Called when a component should respond to a change in the device’s memory level. Components examine the warning information and take appropriate action to reduce their memory footprint based on the reported memory level. Failure to reduce memory usage appropriately may result in process termination by the Low Memory Killer (LMK). This method is always called on the main thread. The implementation must return quickly to avoid blocking the main thread. Any long-running operations should be performed asynchronously.

Parameters

info
IMemoryWarningInfo* — Required Information about the memory warning
Last modified on October 29, 2026