Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Object-Pascal / Delphi-Language (https://www.delphipraxis.net/32-object-pascal-delphi-language/)
-   -   Prism Memory Manager in Delphi 2007 (https://www.delphipraxis.net/107883-memory-manager-delphi-2007-a.html)

FaNIX 4. Feb 2008 09:46


Memory Manager in Delphi 2007
 
Does anyone know if Delphi 2007 has it's own memory manager?

I want to check my application for memory leaks, so i wish to report all memory leaks when i close my application. Any help?


PS: I know the ReportMemoryLeaksOnShutdown works for Win32 Applications in Delphi2007, but im using a VCL.NET Application.

Thanks

Khabarakh 4. Feb 2008 10:09

Re: Memory Manager in Delphi 2007
 
There's no such thing as a memory leak in a (fully managed) .Net application. If you're experiencing some memory issues, could you describe them?
Whenever you have created, say, 20 new objects (i.e. generation 0 is full) since the last garbage collection, the garbage collector will reclaim any unreferenced objects (slightly simplified). The only thing you can do to help the GC is to dispose every IDisposable object as soon as you don't need it anymore.

FaNIX 4. Feb 2008 10:39

Re: Memory Manager in Delphi 2007
 
Zitat:

Zitat von Khabarakh
There's no such thing as a memory leak in a (fully managed) .Net application. If you're experiencing some memory issues, could you describe them?
Whenever you have created, say, 20 new objects (i.e. generation 0 is full) since the last garbage collection, the garbage collector will reclaim any unreferenced objects (slightly simplified). The only thing you can do to help the GC is to dispose every IDisposable object as soon as you don't need it anymore.


mmm ok, so if i do the following:

Delphi-Quellcode:
procedure TForm3.FormCreate(Sender: TObject);
begin

  oConn := TADOConnection.Create(nil);

end
in a VCL.NET Application, then that object will automaticly be disposed? So there is no need to FeeAndNil(oConn)?

Thanks


Alle Zeitangaben in WEZ +1. Es ist jetzt 07:48 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz