Skip to content

Expose best-effort native memory reclamation - #116

Merged
ivan-digital merged 1 commit into
mainfrom
feat/android-native-memory-release
Nov 10, 2026
Merged

ivan-digital merged 1 commit into
mainfrom
feat/android-native-memory-release

Conversation

@ivan-digital

Copy link
Copy Markdown
Member

Android allocators can retain unused native pages after inference or model close. Add explicit SpeechMemory.releaseUnused() backed by bionic mallopt(M_PURGE, 0), returning allocator support without closing models or changing allocator policy. Consumers own the idle scheduling and should call it on a worker thread.

Add a device regression that purges between repeated Parakeet decodes and verifies identical text and word times, then exercises repeated reclamation after close. Document the API and version 0.0.27 in all ten README languages.

Validation: 184 SDK JVM tests passed; 13 selected connected SDK tests passed on an arm64 Samsung SM-S918B, Android 16 / API 36, including the new live-model preservation case, Nemotron streaming, Sortformer and ReDimNet. Release and debug native packages build on arm64. No model weights, model pins or inference algorithms changed.

@ivan-digital
ivan-digital merged commit dd4e796 into main Nov 10, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant