My program (a text-mode web browser) is dynamically allocating memory.
I do free unneeded blocks during runtime, of course. And I do free everything before normal te
Abnormal termination of your process does not lead to memory blocks that cannot be used by other processes (effectively meaning they are free), if they were allocated by it.
We allocate/free memory using OS-directives so that a non-buggy OS keeps track of mem chunks for each process and translates them into a contiguous virtual memory space. Upon a process-death, OS loader signals it, and all memory gets recalled. Things get complicated when processes share memory.
Peering processes, if not derived/launched/forked by you process (e.g. consider an external component serving many processes to access multimedia resources), may have created memory (e.g. buffer) to serve your process. Depending on the policy of ownership of these external components, that memory might not be free upon served-process death.
I advise you to try audit all memory committed before and after abnormal termination scenarios.