Is it a waste of time to free resources before I exit a process?

Posted by Martin on Programmers See other posts from Programmers or by Martin
Published on 2012-03-19T14:54:03Z Indexed on 2012/03/19 18:14 UTC
Read the original article Hit count: 278

Filed under:
|

Let's consider a fictional program that builds a linked list in the heap, and at the end of the program there is a loop that frees all the nodes, and then exits. For this case let's say the linked list is just 500K of memory, and no special space managing is required.

  • Is that a wast of time, because the OS will do that anyway?
  • Will there be a different behavior later?
  • Is that different according to the OS version?

I'm mainly interested in UNIX based systems, but any information will be appreciated. I had today my first lesson in OS course and I'm wondering about that now.

© Programmers or respective owner

Related posts about operating-systems

Related posts about study