🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #2615

Re: Memory Leak - TForm or TStringGrid or DynamicArray

#2615
From: Remy Lebeau (TeamB)
Date: Tue, 06 Feb 2007 01:41
18 lines
1661 bytes
"Dan Mayo" <dmayo@dickey-john.com> wrote in message
news:45c7810f@newsgroups.borland.com...

> However, when I close the form, when is then followed by a delete
> operator, the memory doesn't appear to be freed (looking at the
> Virtual Size of the program via the task manager).

You are not taking into account that the VCL uses its own memory
manager that allocates larger amounts of memory from the OS and then
buffers it out for its own allocations inside the application.  Memory
that is freed in code is not released back to the OS immediately.  It
is cached for later re-use.  The Task Manager can only show memory
that is allocated at the OS level, so you can't use it for tracking
memory leaks in the VCL.  That is what CodeGuard is for instead.


Gambit
Technical Details
Message-ID: <45c7dc8d$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!homer!news.glorb.com!news-spur1.glorb.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <45c7810f@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,191a7d21d69bde32
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <45c7810f@newsgroups.borland.com>
Subject: Re: Memory Leak - TForm or TStringGrid or DynamicArray
Date: Mon, 5 Feb 2007 17:41:19 -0800
Lines: 20
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
NNTP-Posting-Host: 75.83.34.171
Message-ID: <45c7dc8d$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1170726029 75.83.34.171 (5 Feb 2007 17:40:29 -0800)
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!homer!news.glorb.com!news-spur1.glorb.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail