Вопрос

I have been wondering lately what happens when a process is killed (either explicitly or unintentionally) using something like task manager or killing in code. What does the O/S do in terms of memory allocation and etc.

It seems to me that most if not all memory is usually freed upon termination, how does this occur and what can break this (if anything)?

Это было полезно?

Решение

Depends on the application. Some applications allow developers to detect when the application is being killed (even via task manager) and allows them to run code for cleanup, etc. If the program is accessing unmanaged resources (files, streams, database, etc) and does not explicitly handle cleaning those up then it is possible for them to be littered in memory.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top