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()
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.voidonMemoryWarning(IMemoryWarningInfo*info)
Parameters
info
IMemoryWarningInfo* — Required
Information about the memory warning

