Quote Originally Posted by nuzzle View Post
The programmer is right, a process may not give back memory to the OS ....
Sorry to disagree.. But if the Program is written correctly, and has a proper Memory management, it should return unused memory to the OS. There are some older memory managers that may not return all Freed up memory to the OS, but that was quite some time ago..

The Proggy obviously does have a memory leak.. Even if he's using older Memory management, the proggy should be reusing this pre-allocated memory irrespective..

There are some programming techniques that can cause a problem with the Heap if memory is not passed back to the OS.. IE:
Code:
 //Pseudo code
define Outlist as Array of Dataobject
Datareader = SQLQuery("Select * from table order by ID asc")
For Each DRItem in Datareader
    Redim Outlist (Outlist.lastindex + 1)
    Outist (Outlist.lastindex).id = DRItem.Selectcolumn("ID")
    Outist (Outlist.lastindex).Name = DRItem.Selectcolumn("Name")
    Outist (Outlist.lastindex).Address = DRItem.Selectcolumn("Address")
    ......... //etc.
Next
Return Outlist
While this code looks well refined and will only use the QTY of memory needed for all the Data read from SQL, it has one Glaring Problem.
Every Redimming of the array (Size adjustment) requires more memory that the previous one.. This will lead to heap fragmentation like nuzzle describes.

The programmer is trying to blow smoke up someone's as, if he thinks that he can blame incorrect memory management to the OS...

have a look at this for more info about correct memory management (Note this piece is from back in 2004)