문제

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