Subj : Re: the use of new; allocating memory To : borland.public.cpp.borlandcpp From : Andrue Cope Date : Tue Dec 09 2003 04:49 pm Howie, > So is the HM and the OS two seperate entities that work together or does one own the other? Is the HM a bios/inturupt type of thing? Where does the HM come into being? > The HM is just part of the runtime library that Borland wrote as part of the development suite. Pretty much every compiler writer will have written an HM as well. The problem is that most OSes don't inherently support the allocation model that most languages do (the allocation of vast numbers of odd and small sized chunks). It's a complex area and OSes would never be able to satisfy everyone so most don't even try. They just offer the simplest and fastest form of allocation and leave it up the application to improve on this - at the application's expense. If you want *you* can write an HM (Borland and even C++ itself fully support doing this) but compiler writers traditionally provide one which does a good job overall. One aspect of Borland's HM that isn't so good is that it appears to suffer fragmentation when you mix a lot of small allocations/deallocations with a few larger allocations/ deallocations. This can be seen by increasing memory consumption when looking at the Task Manager report and yet a memory checking tool will report no leak. -- Andrue Cope [Bicester, UK] .