This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Memory Leak using STL - gcc-3.2 and gcc-2.95.3
On Sat, 2002-10-05 at 03:35, Phil Edwards wrote:
> On Sat, Oct 05, 2002 at 01:14:37AM +0000, Stefan Jones wrote:
> > It just makes programs less elegant from the
> > malloc/free pair-up point of view.
>
> Unless you're doing embedded programming, there is often a relatively
> large amount of memory allocated but never freed, precisely because...
>
I've only ever seen it use a few bytes, a Kb at most, but then again I
haven't tested it that much.
> > The "solution" would be to make it get freed on program exit, but that
> > would serve no purpose except from an artistic view point.
>
> ..../all/ memory is freed -- returned to the system -- on program exit.
>
I know this fact, It must be so otherwise OS's would have to be rebooted
periodically, hence my comment that "explicitly" freeing it would surve
no purpose. All pages belonging to a program are returned to the kernel
on exit.
(sorry, had to reply to point out that I am not such an ignornant
programmer :-) )
Stefan Jones