[omniORB] Memory leak resolution in MFC?

Duncan Grisby dgrisby@uk.research.att.com
Mon, 02 Oct 2000 12:11:24 +0100


On Monday 2 October, Jeroen.Dobbelaere@MMR.be wrote:

> You allocate such data once (using new or malloc), but never free
> them. So, strictly spoken, they _are_ memory leaks (but of a nice
> kind, they don't grow in time).  (Btw, In the past there happened to
> be os's where memory was not automagically passed back to the os
> when a program ends (Amiga).  On such systems, this behavior would
> create a real memory leak.)

That isn't true. On the Amiga, the Exec library's AllocMem() function
did not free memory on process exit, but malloc() as provided by the C
runtime library _did_ free the memory. There's a blast from the past.
Does anyone fancy porting omniORB to the Amiga?  :-)

Anyway, we agree that it would be nice if all memory dynamically
allocated by omniORB was freed on exit. However, it is not a major
priority for us, since all the operating systems we support do have
the ability to clean up after a process. The important thing is not to
have dynamic memory leaks which grow over time.

A proper solution to this "problem" should integrate nicely with the
architecture, rather than being bolted on the side as a quick hack.

Cheers,

Duncan.

-- 
 -- Duncan Grisby  \  Research Engineer  --
  -- AT&T Laboratories Cambridge          --
   -- http://www.uk.research.att.com/~dpg1 --