Jack Scheible wrote:
>
> > I don't know if it is memory leak strictly speaking, but the
> > consequences are more or less the same:
> > if you don't ALLOCATE/DEALLOCATE in the LIFO order (last allocated,
> > first deallocated), you are likely to fragment the memory, even if
> > the deallocations work, in the same way than a hard disk is
> > fragmented after a long period of operation. So you may have a
> > large amount of free memory, but with only small contiguous areas,
> > and be unable to allocate a large object (on a fragmented hard disk
> > the filesystems are able to fragment a large file into several small
> > pieces).
>
> This is not something I would worry about. Most computers now
> automatically defragment memory, much as Unix systems automatically
> defragment hard drives.
Operating systems manage the memory required by the processes,
but I don't think (maybe I'm wrong) they are able to manage the
memory _inside_ each process, and this is very different.
My comparison to hard was not correct, it should be instead:
operating system equivalent to filesystem
one process ------------- one file
the filesystem can defragment the drive, but cannot do anything inside
one given file, even if there are some wasted memory.
--
Pierre Hugonnet Seismic Data Processing R&D
COMPAGNIE GENERALE DE GEOPHYSIQUE
mail: 1 rue Leon Migaux phone.....(33) 164 47 45 59
91302 MASSY fax.......(33) 164 47 32 49
FRANCE [log in to unmask]
My opinions are not necessarily those of CGG (nor those of JPII)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|