In this article
Memory callbacks can guide reclaimable-cache cleanup; durable accepted work must not depend on an assumed warning or termination hook.
The only saved state lives in a warning handler
A local assistant accepts a document and shows that summarization has started. Its only durable progress write sits inside a low-memory callback. When the process disappears, the next launch cannot determine whether the document was accepted, processed or abandoned. The defect is not merely a missing callback log. The application placed its persistence boundary behind an event it did not establish would occur. Distinguish disposable inference caches from work the interface has already promised to retain.
Read the current callback contract
The ComponentCallbacks2 reference describes opportunities to trim unneeded memory. Several historical pressure levels are no longer delivered since API level 34 and are deprecated at API level 35; onLowMemory is also no longer called from the former level. A design copied from an older sample can therefore await an observation absent from its current platform contract. Review the particular callback and level rather than assuming every named constant remains an active warning channel.
Termination is not a production cleanup hook
The Application reference states that onTerminate is for emulated process environments and is not called on production Android devices when processes are killed. No final user code runs through that path. Do not repair a fragile low-memory save by moving it into this method. The relevant engineering question is which state was already durable before the process vanished, not which convenient lifecycle name sounds closest to a last chance to write.
Assign caches and accepted work different policies
A decoded preview or reusable model cache may be reconstructible. The owner’s accepted document identity, committed output and unfinished-work marker serve another purpose. Persist those at explicit application transitions under the chosen storage contract, then let memory notifications release only data whose loss has defined recovery behavior. Avoid performing a large model reload or expensive archival export inside a pressure handler. Such work can increase the resource problem while still failing to establish that the final state reached durable storage.
Propose recovery without a final callback
In a disposable fixture, interrupt the process after each meaningful application transition without delivering the hypothetical final warning. On relaunch, inspect source identity, completed outputs and pending work before requesting inference again. Separately exercise supported trimming callbacks to verify that reconstructible caches disappear without corrupting active ownership. Acceptance is a defined recovery state and no false completion claim. This article did not kill a process or reproduce memory pressure; the fixture specifies what project evidence should establish.
Keep platform and incident explanations separate
Partial Linux worker loss concerns the scope of a different process-management mechanism. Offline package completeness concerns artifacts available after recovery. Neither supplies a final Android callback. Report callback support, durable application transitions and reconstruction requirements independently. A model that loads successfully after restart can still have lost the owner’s pending work; executable recovery and session continuity are distinct acceptance outcomes.
Earn rental income from GPUs
Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.