PDA

View Full Version : strange exe size?



seiferalmasy
15-11-2007, 02:59 PM
System: Windows XP Sp2, Intel core2 E6600
Compiler/IDE: Delphi 6
API: DirectX 9c

The above didn't matter to this problem on all 3 other computers. problem remains the same.

I have had a long standing problem since delphi 4 that whenever I add a picture, compile then remove the picture, the exe remains larger than what it was before I added the picture (might be same with any added data). Almost as if the data was not removed?

Happened just then with delphix. Added png 100 KB, before exe was 3.00 MB then went to about 3.1. removed png and replaced with one at 5 KB and it is still 3.1MB??

Robert Kosek
15-11-2007, 03:15 PM
You could always delete the executable and force a complete rebuild. Otherwise it is because the "dead" space that was taken isn't truncated from the file.

You might glance at the Help Me! forum rules before this topic is locked, too.

seiferalmasy
15-11-2007, 11:31 PM
I will try that, see what happens...

If the info isn't being deleted from the source how can I sort that?

edit:

well, same size now. My source files come to: 1.2 MB

The exe coems to: 3.3 MB

Maybe I am imagining it and all those uses are doing it? I dunno, but where is this extra 2.1MB coming from? I suppose a better question would be, what things increase the exe from a uses clasuse point of view

(I have debugging and linking disabled btw)

Robert Kosek
16-11-2007, 12:10 AM
Okay, the trouble is DelphiX + VCL. If you add images to the file they aren't forgotten that simply. You're better off extracting all images, deleting the storage component, and replacing it.

But even then I don't know if that'll reduce the size. I doubt it.

seiferalmasy
16-11-2007, 12:16 AM
It is ok I have found the culprit:)

But...yes, image files are a pain in delphi. Anyone know how I can get some of the sapce back (the rest is due to uses)

I will try what ^ suggested :)

seiferalmasy
16-11-2007, 12:23 AM
oh and main bulk 1MB is taken by absolutedatabase, but that is worth it. No more bde!

:)

Jimmy Valavanis
16-11-2007, 06:09 AM
The exe size grows even if you remove the picture because when adding an image Delphi includes in the uses section (in interface) some more units: For example if you place a TImage control in a form Delphi IDE adds ExtCtrls unit. If you load a jpeg image in the TImage control and compile, Delphi IDE adds the the jpeg unit also. Now, if you delete the TImage control the two units mentioned above don't 'dissapear' for the uses section. These unit have some code in initialization and finalization section that is linked into your executable, even if you don't use anymore any jpeg images. Does that help?????

seiferalmasy
16-11-2007, 02:49 PM
Yes I think I get it;)

Cheers!

VCL is so big. before I even start my game I have 2 MB of exe for all the packages I will use.

Exe compressors I suppose are ok, aspack, gets mine from 3.3 to 1.3...