I suppose IZzz32 means that when a process terminates the OS deallocates all the process resources, also memory.
In your case seems that the process is still running and, maybe, only a thread aborts......
Exactly.
I would never take it as a guarantee that ANY OS is freeing memory on program termination. Normally they "should", but I think there are too many examples out there that this is not always the case.
If you have x86-64 protected mode OS, it would free memory. Just because of the way the protected mode and paging works.
And for non-x86 CPUs there's one obvious reason for OS to do that too: if your program crashes and OS does not free its memory, you'll get a memory leak, and the whole system should be rebooted to free that memory. Nobody wants this. Well, almost nobody: there is realtime/embedded programming, operating systems without process isolation and so on.
without properly cleaning up any previously allocated memory is (extremely) bad programming practice, just the way as it is not to close files as soon as they are not needed anymore...
I disagree. In a long-living process, you should free resources as long as you don't need them. It is right, it is ok. But for example if your program just allocates memory, does some calculations and writes results into the output file, there's no any practical reason to close an output file (as exit() guarantees to fflush/fclose/whatever) and/or to free memory. Btw if you have a big data structure constructed from the small pieces (a tree, for example), OS would free it many times faster than you do).
And yes, it is considered "bad programming practice" just because if you always remember to free resources, chances are that you wouldn't forget to do that when it is really required.
CommonTater, I was talking
only about freeing resources
before exit. Anyone understands, that you should not just throw your pointer away and continue running.
CommonTater, ok, got it. If I'll work for a big company I would always do free() before exit(), memmove() instead of memcpy(), fflush() before fclose(), and of course, I'll never forget to repeat assignment expressions triple times… just to be sure.