Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/IDE/Memory Issues    [ Add a report in this area ]  
Report #:  57701   Status: Closed
Huge memory leak in BDS.EXE
Project:  Delphi Build #:  11.0.2902.10471
Version:    11.2 Submitted By:   Remko Weijnen
Report Type:  Crash / Data loss / Total failure Date Reported:  2/1/2008 12:13:36 AM
Severity:    Serious / Highly visible problem Last Updated: 3/20/2012 2:24:39 AM
Platform:    All platforms Internal Tracking #:   257492
Resolution: Fixed (Resolution Comments) Resolved in Build: : 12.0.3147.16437
Duplicate of:  None
Voting and Rating
Overall Rating: (2 Total Ratings)
5.00 out of 5
Total Votes: 9
Description
When compiling a project that uses a resource file BDS.exe leaks exactly 34,1 MB of Virtual Memory. This goes on until the maximum amount of Virtual Memory a single process can allocate is reached (around 1.7 GB) and then BDS reports F2046 Out of Memory error.

The issues occurs in build 11.0.2804.9245 as well.

(the attached resource file is from the Jedi Security Library project, http://sourceforge.net/projects/jedi-apilib/)
Steps to Reproduce:
Create new (empty) project and add this line in the main unit:
{$R Jwscl.res}

Open taskmanager and add the Virtual Memory Size column via the View -> Select Columns menu. Record the current value of VM Size column.

Compile and when the compilation has finished you can see 34,1 MB extra Virtual Memory is allocated.

Compile again, 34,1 MB more is allocated. This continues with every compilation.

Memory is not freed when closing the project, only restarting the IDE helps.
Workarounds
None
Attachment
Jwscl.zip
Comments

Remko Weijnen at 2/1/2008 3:25:57 AM -
The leak can be reproduced by including the res file I attached. So just create an empty project and add this line:

{$R Jwscl.res}

This seems to be the cause:
This resource file uses several string tables, a string that is translated will have the same ID.

Delphi seems to allocate for every string table and ID memory.
But does only deallocate the memory for a single instance of an ID.

if ID 50.000 occurs 3 times. Delphi loads all 3 strings. But Delphi just deletes only one

Bart Bart at 2/1/2008 3:04:17 AM -
Confirm that bug.
It also occurs in D7.

Remko Weijnen at 2/1/2008 3:08:57 AM -
I tested on BDS2006, the leak doesn't seem to occur there.

Christian Seehase at 2/1/2008 3:11:49 PM -
Confirmed for BDS2006 (10.0.2288.42451 Update 2)

Remko Weijnen at 2/1/2008 3:49:57 AM -
Another confirmation for Delphi version 7.0 build 4.453

Christian Seehase at 2/1/2008 3:09:21 PM -
For Delphi 7.0 build 8.1 it is similar.
The the leak differs around 35 MB

Uwe Schuster at 2/1/2008 12:45:54 PM -
I can repeat it.

I removed the #include lines (resource.h and afxres.h) from the resource script and recompiled the resource with brcc32 and with this resource the memory leak does also exist.

Remko Weijnen at 2/1/2008 2:05:30 PM -
Uwe, could you include the Delphi version? Thank you!

Uwe Schuster at 2/2/2008 5:01:24 AM -
I can repeat it with RAD Studio 2007 Build 2902 (December 2007 Update).

By default I omit the version and build number if it is the same as in the report.

Remko Weijnen at 2/1/2008 2:05:08 PM -
This issue is confirmed by several people now on the following Delphi versions:
D5
D7
D2007/RAD Studio 2007

The following versions are confirmed to not have this issue:
BDS 2006

Wieland Wolf at 2/1/2008 3:22:46 PM -
Delphi 6 Patch 2 here, memory leak present.

Markus Humm at 2/2/2008 7:25:03 AM -
It was reported for BDS 2006 Update 2 so I think it's present in all versions starting at least from D5.

Remko Weijnen at 1/21/2009 4:52:57 AM -
It is unclear to me from the resolution tab, please clarify if and in what version(s) this was solved.

Tomohiro Takahashi at 1/21/2009 9:09:20 PM -
Please take a look at 'Resolved In Build' field. It is 12.0.3147.16437 which means Delphi 2009.

Remko Weijnen at 1/23/2009 5:37:05 AM -
I seem to have missed that ;-)
So does this mean there will be no fix for other Delphi versions?

Server Response from: ETNACODE01