Delphi 2009 memory leak

I have a small app that uses dbExpress for MS SQL.  I have the apps ReportMemoryLeaksOnShutdown set to true.  Any time I use dbExpress to call a simple stored procedure (returns a single record with 2 fields) when I close the application memory leaks are reported.  I am unable to determine if there is a known memory leak with the dbExpress driver.  Can anyone help?  This is driving me nuts.

Here is the message text:
---------------------------
Unexpected Memory Leak
---------------------------
An unexpected memory leak has occurred. The unexpected small block leaks are:



21 - 28 bytes: UnicodeString x 1, Unknown x 2

29 - 36 bytes: TDBXBooleanValue x 4, TDBXInt32Value x 1, TDBXSingleValueRow x 1, UnicodeString x 3

37 - 44 bytes: UnicodeString x 1

69 - 76 bytes: TDBXValueType x 5


---------------------------
OK   
---------------------------


Thanks!
0
Lance
1/3/2009 4:54:31 AM
embarcadero.delphi.ide 3925 articles. 0 followers. Follow

8 Replies
1192 Views

Similar Articles

[PageSpeed] 36

Is there anyone who can try and replicate this?  I am using the most current D2009 update.  All it takes to replicate is using dbExpress to run a MS SQL 2005 stored procedure that returns a result set.

Thanks in advance,
Lance
0
Lance
1/5/2009 6:31:25 PM
Lance Olvey wrote:

> Is there anyone who can try and replicate this?  I am using the most
> current D2009 update.  All it takes to replicate is using dbExpress
> to run a MS SQL 2005 stored procedure that returns a result set.

What you can try is to download the stand-alone version of FastMM4 and
define FullDebugMode (under Project -> Options -> Delphi Compiler ->
Conditional defines). It will then generate a file with call stacks,
maybe that helps to determine where the memory for these items was
allocated and if this is indeed a Delphi problem or maybe not.

http://sourceforge.net/projects/fastmm/

Post results to the attachments group.

-- 
Pieter

"We are not retreating - we are advancing in another Direction."
 -- General Douglas MacArthur (1880-1964)
0
Pieter
1/6/2009 12:02:38 AM
Thanks,

I have downloaded FastMM.  I am still trying to figure out how to plug it in and make it work (is there a guide somewhere that can help?).  However, I am certain it is not a memory leak caused by me because I am doing nothing in my test project.  Here is how to replicate it.

1.  Create a new VCL Forms project.
2.  Drop a TSQLConnection component on the form and connect it to a MS SQL 2005 database.
3.  Drop a TSQLStoredProc component on the form and connect it to a simple stored procedure in your database.  I connect it to a stored procedure that does simple select statement from my database.
4.  Drop a TButton on the form.  In the OnClick put:
  SQLStoredProc1.Active:=True;
  SQLStoredProc1.Active:=False;
5.  In the project file put   ReportMemoryLeaksOnShutdown := True;
6.  Run the program, click the button, then close the program.

The following message will appear indicating a memory leak.  I believe this HAS to be a leak not caused by me since I have no code other than 2 lines in the button click.

---------------------------
Unexpected Memory Leak
---------------------------
An unexpected memory leak has occurred. The unexpected small block leaks are:



21 - 28 bytes: UnicodeString x 1, Unknown x 2

29 - 36 bytes: TDBXBooleanValue x 4, TDBXInt32Value x 1, TDBXSingleValueRow x 1, UnicodeString x 3

37 - 44 bytes: UnicodeString x 1

69 - 76 bytes: TDBXValueType x 5
0
Lance
1/6/2009 3:47:03 PM
Lance Olvey wrote:

> I have downloaded FastMM.  I am still trying to figure out how to
> plug it in and make it work (is there a guide somewhere that can
> help?).  

There are two text files in the download which should answer most
questions, but in short:

1) Make sure that Delphi can find the source files
   (add the FastMM4 folder to the library path).

2) Copy the pre-compiled FastMM_FullDebugMode.dll to
   a location so that you app can find it. I usually
   copy it to the Windows folder.

3) Put FastMM4 as the very first unit in the uses
   clause of the dpr (project) file.

4) Define FullDebugMode

Build and Run your application.


> However, I am certain it is not a memory leak caused by me
> because I am doing nothing in my test project.  Here is how to
> replicate it.

> 3.  Drop a TSQLStoredProc component on the

I do not have the required stuff available, maybe better ask in the
dbexpress group for someone to reproduce it.


-- 
Pieter

"If computers get too powerful, we can organize them into a 
 committee -- that will do them in." -- Bradley's Bromide.
0
Pieter
1/6/2009 8:58:56 PM
After working with Embarcadero there are 2 results:

1.  There is a fix you can perform yourself to fix this confirmed leak in Delphi 2009.

2.  It is officially fixed in Delphi 2010.
0
Lance
10/22/2009 4:36:52 PM
> {quote:title=Pieter Zijlstra wrote:}{quote}
> Lance Olvey wrote:
> 
> > Is there anyone who can try and replicate this?  I am using the most
> > current D2009 update.  All it takes to replicate is using dbExpress
> > to run a MS SQL 2005 stored procedure that returns a result set.
> 
> What you can try is to download the stand-alone version of FastMM4 and
> define FullDebugMode (under Project -> Options -> Delphi Compiler ->
> Conditional defines). It will then generate a file with call stacks,
> maybe that helps to determine where the memory for these items was
> allocated and if this is indeed a Delphi problem or maybe not.
> 
> http://sourceforge.net/projects/fastmm/
> 
> Post results to the attachments group.
> 
> -- 
> Pieter
> 
> "We are not retreating - we are advancing in another Direction."
>  -- General Douglas MacArthur (1880-1964)
0
Minh
11/12/2009 3:48:55 PM
> {quote:title=Lance Olvey wrote:}{quote}
> 1.  There is a fix you can perform yourself to fix this confirmed leak in Delphi 2009.

Where can we find this fix? I have also turned on Memory Leak reporting in my application and have exactly the same leak as you when using DBExpress, no leak however when removing DBX from a simplified core application.
0
Sebastian
12/18/2009 10:41:03 AM
> {quote:title=Lance Olvey wrote:}{quote}
> After working with Embarcadero there are 2 results:
> 
> 1.  There is a fix you can perform yourself to fix this confirmed leak in Delphi 2009.
> 
> 2.  It is officially fixed in Delphi 2010.

I have same problem as your. Where to get the fix in Delphi 2009?
0
dong
10/20/2010 4:13:53 AM
Reply:

Similar Artilces:

Delphi 2006 vs Delphi 2009 IDE stability
Hello, all. I have medium sized project which includes about 20Mb of source code (just size of *.pas files). I use Delphi 2006. There are third party component suites JVCL, DevExpress Bars, Pegasus Imaging. All updates applied. The main problem is IDE stability. About four..five times a day IDE become unstable after intensive usage of code insight functions (most often I press Ctrl+Space key). The best outcome is that I have to save everything and restart the IDE. The worst outcome is when IDE stalls or falls into endless loop of error messages and any unsaved work is lost. OS...

Delphi 2009 HTTPRIO Memory Leak
After wrestling with issues about when to and when not to free HTTPRIO objects created in code, I still have one problem: With Delphi 2009 I have a routine that calls a SOAP function derived from a WDSL call that returns a TXMLData objects (actually it is just some XML, but that is what was created by the interface). The HTTPRIO object is created in code. I am explictly freeing the returned TXMLData, but there remains some memory leaks which I am having problems tracking down. Are there any known gotchas for using this or are there other references I have to explicitly free? ...

Delphi 2009 memory consumption (leak?)
Hi! I'm converting an old project of a couple of hundred files to Delphi 2009. In the process, I'm also changing the policy so, that instead of adding all my folders with code files to search path, I add the code files directly to the project and keep the search path empty (this among other things because at least in older Delphi's the length of the search path was limited and I started hitting the limit). At the same time I want to clean the project so, that I only add the files really needed, since my folde rs contain lots of legacy code files also that are no longer used. ...

Re: Where is data form wizard in Delphi 2009? [pubic.delphi.ide]
This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. --JivePart=_21560.zeB8CwDOH5aMJzMl Content-Type: text/plain; charset="Utf-8" Sample picture showing drag and drop from persistent fields edit window. (Any TField in any TDataset should work, TSomeKindofTable, or TSomeKindofQuery. Warren --JivePart=_21560.zeB8CwDOH5aMJzMl Content-Type: image/jpeg; name="drag_and_drop_from_persistent_fields_editor.jpg" Content-Transfer-Encoding: base64 Content-Disposition: attachment; ...

Delphi 5 To Delphi 2009
I upgraded to Delphi 2009 from D5. The install says I can install Delphi and/or C++. Delphi installed OK but I see nothing of C++. What am I missing or does my upgrade not include C++? Thanks It depends on what you bought. If you bought Delphi 2009 only, that's what you get. If you bought Delphi 2009 and C++ Builder 2009 you get both. My guess is you got Delphi 2009 only. The simplest way to verify is look your invoice - it should say I would think. You could also go to members.embarcadero.com, login, then click on my registered products. There will be a textual description of...

Delphi 4 to Delphi 2009
Hello, Thanks to all who answered my previous question. That was a great help. And atlast our client agreed to upgrade our delphi version from 4 to Delphi 2009. *Sigh*. But before that, I need to give the estimation and cost regarding the migration to delphi 2009. Can anyone tell me is there any tool to migrate from delphi 4 to delphi 2009 or just I need to compile our Delphi 4 application in Delphi 2009. I have read from the delphi 2009 feature matrix that Delphi 1 through Delphi 2007 import is possible in delphi 2009. But i am not that sure considering the size of our application. ...

Delphi 2007 to Delphi 2009 Conversion
CharArrayPtr = ^CharArray; CharArray = array[0..MaxInt-1] of Char; How to convert to Delphi 2009? Bill Bill Miller wrote: > CharArrayPtr = ^CharArray; > CharArray = array[0..MaxInt-1] of Char; > > How to convert to Delphi 2009? > > Bill it depends heavelly on how it is used fearther down in your project and what you want to convert it to. I you want to simple convert the declarations ignoring UNicode altogether then the only think you have to change is the CharArray declaratin from a Char to an AnsiChar eg CharArrayPtr = ^CharArray; CharArray =...

is there a Delphi 2007
Would be nice to have a bundle of the latest Delphi packages. Gilbert Padilla wrote: > Would be nice to have a bundle of the latest Delphi packages. > I expect Delphi 2007 will only be on sale until the full RAD Studio 2009 edition is published, including Delphi 2009.net. W ...

Delphi 2009 alongside Delphi 2007
Hi all, I am about to install Delphi 2009 on the same development system as Delphi 2007, before I embark is there anything I should be aware of so as to not break my Delphi 2007 installation and projects ? Thanks JT John Taylor wrote: > Hi all, > > I am about to install Delphi 2009 on the same development system > as Delphi 2007, before I embark is there anything I should be aware > of so as to not break my Delphi 2007 installation and projects ? As long as you install into a separate folder there is no problem with the two versions getting into each other...

Upgrading to Delphi 2009 from Delphi 5
I've decided it's time to upgrade to Delphi 2009 Professional from my current Delphi 5 Professional which (according to the FAQ) makes me eligible for the upgrade pricing. However, I'd just like to clarify how this process works. My concern is that my Delphi 5 is not registered on the CodeGear site and this doesn't seem to be possible as far as I can tell. When installing the trial I noticed that Delphi 2009 registers itself with your CodeGear account so does this mean that the previous version must be registered there to verify you own a Professional edition? I plan to o...

Delphi 7 to Delphi 2009 conversion
Hello group, What do I need to do to comile the following code in D2009. Compiler error after the Else E2010: Incompatible Types 'AnsiChar' and 'Char' if isUnicode then SearchHandle := FindFirstFilew( PWideChar( fn ), FindDataW ) else SearchHandle := FindFirstFile( PAnsiChar( Ansistring( fn ) ), FindDataA ); <<<<<compiler error in the above line >>>>>>>>>>> Regards, Bryan > What do I need to do to comile the following code in D2009. > Compiler error after the Else > E2010: Incompati...

Convert Delphi 7 to Delphi 2009 [Edit]
Hi! Please, I have a code done in Delphi 7... Now I want to convert Delphi 7 to Delphi 2009 but I'm having problems when compile the code. Error message: +[DCC Fatal Error] Far.dpr(9): F2063 Could not compile used unit 'System.pas'+ Please can somebody help me? Source Download (349KB): http://rapidshare.com/files/256191328/FileManager.rar.html Mirror Source Download: http://www.megaupload.com/?d=12GYLPT0 Password: delphi Thank u so much! (sorry for my bad english, it is not my native language) Edited by: loquax loquax on Jul 15, 2009 12:24 PM Sorry, bu...

ShareMem Delphi 6 --> Delphi 2009
I have just upgraded from Delphi 6 to Delphi 2009. My software uses about 20 files, plus literally dozens more plug-ins. Every project has ShareMem as its first unit and borlndmm.dll is distributed with the software. I am aware that the Borland Memory Manager was replaced to use FastMM quite some time ago. Will I have to rebuild every EXE and DLL in DElphi 2009 that uses ShareMem, or will supplying the new borlndmm.dll be enough? i.e. I would like to just update the main application EXEs and DLLs, but leave the plug-ins alone. Will this work? Thanks, Jason. -- Jason Sweby So...

Question about Delphi 2009 vs Delphi 7
Hi, I was wondering if any of you can point me to a URLs that show the most important improvements between these versions of Delphi. The objective is convincing the powers-that-pay-the-bills that moving to D2009 (that we'd have to purchase) is a better idea than moving to D7 (for which we have licenses). Fire at will! -- Saluti, Alessandro Federici ------------------------------- "I have been through some terrible things in my life, some of which actually happened." (Mark Twain) Alessandro Federici wrote: > Hi, > I was wondering if any of yo...

Web resources about - Delphi 2009 memory leak - embarcadero.delphi.ide

Delphi - Wikipedia, the free encyclopedia
... an archaeological site and a modern town in Greece on the south-western spur of Mount Parnassus in the valley of Phocis . The site of Delphi ...

Delphi Automotive (@DelphiAuto) on Twitter
Log in Sign up You are on Twitter Mobile because you are using an old version of Internet Explorer. Learn more here Delphi Automotive @ DelphiAuto ...

Delphi Connect for Verizon on the App Store on iTunes
Get Delphi Connect for Verizon on the App Store. See screenshots and ratings, and read customer reviews.


Audi working with Delphi to develop autonomous car tech
Audi is developing an iPad-sized device that will pack all the necessary computing power for a self-driving car

US approves China company's acquisition of Delphi biz
The Committee on Foreign Investment in the United States has formally approved the acquisition of Delphi's global production of braking systems ...

Verizon And Delphi Officially Launch Vehicle Diagnostics Service - $250 For The Module, $5 A Month On ...
If you're a car nut, a paranoid parent, or a small business owner looking to do a little, uh, company vehicle economy analysis, Verizon's teamed ...

Watch out Google: Delphi gives Ars a ride in its self-driving car
The automotive components maker gave Ars a preview ride around the neighborhood. MOUNTAIN VIEW, CA—On Thursday morning I met with Delphi at its ...

The skinny on Delphi's autonomous road trip across the United States
Filed under: Green , Videos , Autonomous Last week, Delphi's autonomous car became the first to complete a coast-to-coast trip across the United ...

Delphi partners with WiTricity on automated wireless charging system
One could easily argue that parking between the white lines at any local hangout presents a challenge for some inexperienced drivers. So, why ...

Resources last updated: 1/21/2016 10:42:27 AM