11 hours ago
So I'm using Ubuntu for programming I use atom text editor with gcc compiler for C. I want to ask what will happen if I don't clear memory allocated by malloc or calloc? Will the OS take care of it or I have to clear it. In case I forgot.
32 hours ago
You will have to take care of freeing memory your self. C doesn't have automatic memory management like JAVA and others.
Allocated memory will be freed automatically when the process stops though.
But if you have a long running process, leaking memory by not free'ing it, can make your system run out of memory.