简体   繁体   中英

What happens to unreleased memory on the heap?

If we miss to free any memory allocated on the heap, is that memory going to be unavailable for ever? As it is the responsibility of the developer to free it? If not, at which point the freeing of memory will happen?

During program run yes that memory would be unavailable to you.

All memory would be freed up when your application exits.

Memory that is allocated by your app's process will be tied up until the process terminates. Android terminates SDK apps' processes from time to time, to free up system RAM for other processes. This will only occur while your process is in the background (eg, user presses HOME).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM