Article View: borland.public.cppbuilder.database.ado
Article #1057Re: Memory Leak
From: Viatcheslav V. Vassiliev
Date: Thu, 11 Nov 2004 22:00
Date: Thu, 11 Nov 2004 22:00
92 lines
3906 bytes
3906 bytes
SysFreeString frees BSTR (or WideString in Delphi/BCB). But for String, AnsiString, WideString this is done automatically. Why do you think that memory is not released - Task Manager is not tool to detect memory leaks? Try to execute SetProcessWorkingSetSize(GetCurrentProcess(), DWORD(-1), DWORD(-1)) and look does this help - it will return unused memory to system. Works for WinNT but not Win9x. //------------------------------------------ Regards, Vassiliev V. V. http://www.managed-vcl.com - using .Net objects in Delphi for Win32 + ADO.Net http://www.oledbdirect.com - The fastest way to access MS SQL Server, MS Jet (Access) and Interbase (through OLEDB) "Roberto" <roberto@dialtech.com.br> �������/�������� � �������� ���������: news:419351d6$1@newsgroups.borland.com... > Well, > > First of, I�m using BCB 5.0 Ent, W2000. > > I have a multithreaded software (aprox 150 threads) and one TADOConnection > for each thread. > > TADOConnection *x[190]; > > x = new TADOConnection(NULL); > > This array remains until the software stops. > > If I create one connection in design time (placing the component on the > form), the leak appears don�t occur. But the conns cannot handle the high > trafic of information. > > When I run the software in debug mode, step by step, I see the "new" working > and the memory grows but when the delete is called, the memory is not > released. > > > Question, when I create a String variable, I have to free this variable too > when the funcion terminates ?? > > Ex: > > String x; > > x = "Test"; > > SysFreeString(x); > > > Thanks, > > Roberto. > > > "Viatcheslav V. Vassiliev" <support@oledbdirect.com> wrote in message > news:41930ae4@newsgroups.borland.com... > > How do you detect that memory is allocated? > > > > //------------------------------------------ > > Regards, > > Vassiliev V. V. > > http://www.managed-vcl.com - using .Net objects in Delphi for Win32 + > > ADO.Net > > http://www.oledbdirect.com - The fastest way to access MS SQL Server, > > MS Jet (Access) and Interbase (through OLEDB) > > > > "Roberto" <roberto@dialtech.com.br> �������/�������� � �������� ���������: > > news:4192ea2e$1@newsgroups.borland.com... > > > Friends, > > > > > > We are having serious trouble with ADO. > > > > > > Seems that after any small or huge query (Using TADOQuery dinamically > > > created) memory remains allocated even after the "delete" command. > > > > > > Can anyone help ? > > > > > > thanks > > > > > > Roberto > > > > > > > > > > > >
Technical Details
Message-ID:
<4193e112$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!newsread.com!newsprint.newsread.com!63.218.45.10.MISMATCH!newshosting.com!nx01.iad01.newshosting.com!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!news-hub.cableinet.net!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<4192ea2e$1@newsgroups.borland.com> <41930ae4@newsgroups.borland.com> <419351d6$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,995d05ed431e005b X-Google-Attributes: gid10698b,public X-Google-Language: ENGLISH,ASCII From: "Viatcheslav V. Vassiliev" <support@oledbdirect.com> Newsgroups: borland.public.cppbuilder.database.ado References: <4192ea2e$1@newsgroups.borland.com> <41930ae4@newsgroups.borland.com> <419351d6$1@newsgroups.borland.com> Subject: Re: Memory Leak Date: Fri, 12 Nov 2004 01:00:43 +0300 Lines: 94 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 NNTP-Posting-Host: 213.234.218.42 Message-ID: <4193e112$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1100210450 213.234.218.42 (11 Nov 2004 14:00:50 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!newsread.com!newsprint.newsread.com!63.218.45.10.MISMATCH!newshosting.com!nx01.iad01.newshosting.com!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!news-hub.cableinet.net!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail