470,810 Members | 873 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,810 developers. It's quick & easy.

When a program crashes, is its memory reclaimed by the OS?

Dynamically allocated (malloc) memory is returned back to the OS when a

program terminates normally. But what if the program crashes? Is its
heap also freed? Thanks.

May 23 '06 #1
1 1451
D'artagnan wrote:
Dynamically allocated (malloc) memory is returned back to the OS when a

program terminates normally. But what if the program crashes? Is its
heap also freed? Thanks.


That depends entirely on the OS. The C++ standard has nothing to say
on the matter -- wrong jurisdiction. However, generally speaking, yes,
most OSes will reclaim all such memory.

Luke

May 23 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Scott Brady Drummonds | last post: by
3 posts views Thread by jy | last post: by
60 posts views Thread by Dominique Léger | last post: by
58 posts views Thread by Jorge Peixoto de Morais Neto | last post: by
reply views Thread by mihailmihai484 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.