Solved

Why is my recompiled exe sooo huge?

Posted on 2006-07-03
10
388 Views
Last Modified: 2010-04-05
Hi my dear friends!

When using the same source files and recompiling a project I noticed my exe had become huge....I dont know with which version the orignal project was compiled or whether the exe was compressed. (will do so later on cause even with aspacking my new exe it still is twice as hugeas teh original supplied by the project)

The original exe being 87.583 kB of size.

Now when using the same source files adding 5 lines of code and recompiling it, my exe becomes 409.600 kB of size and even after Aspacking it it still is 170 kB of size....abacadabra how can this be?

Regards Paul

ps it is not too big an issue...but I just wonder what causes this.
0
Comment
Question by:PeterdeB
  • 3
  • 3
  • 2
  • +2
10 Comments
 
LVL 17

Expert Comment

by:TheRealLoki
ID: 17034081
first way to reduce the complied size is to use BPLS (alt-project-options -> packages -> cuild with runtime packages)
This means you have to ship those bpls though....
2nd way is to make sure you have turned off the debug information as this can bloat your exe (alt-project-options -> compiler)
If you are using a 3rd party tool to assist in debugging such as Eureka Log, this can also increase  your exe size

Finally, you can use UPX to shrink your exe size
http://upx.sourceforge.net/
0
 
LVL 17

Expert Comment

by:TheRealLoki
ID: 17034083
another thing that can bloat is if you have added images/imagelists or similar
0
 
LVL 11

Expert Comment

by:calinutz
ID: 17034234
You could paste here the 5 lines of code that you added that made your application size explode... We could give you a more accurate opinion

Regards
0
 
LVL 12

Expert Comment

by:Ivanov_G
ID: 17035291
Probably these 5 lines add a lot of stuff. For example

var
  CDS : TClientDataSet;

will cause all MIDAS package to be added in your EXE.
0
 
LVL 16

Expert Comment

by:CodedK
ID: 17035412
Check the uses list.
The source you've probably downloaded had only the necessary in uses list.

Check the compiled exe with PeiD to see if it is packed :
http://peid.has.it/

Hope this helps.
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 

Author Comment

by:PeterdeB
ID: 17041746
Hi Folks!

Thanks for all the replies! I PEID'd the app, it was UPX'd. But still when I pack my exe (I Aspacked it and PeCompacted it) the size still is double the size of the original exe supplied.

The uses clause was entirely identical and the code I added used two procedures coming from one of the units supplied by the downloaded source. So still I have no clue what causes this.

Also when I simply recompile it without any modifications it still grows twice as big as the original (after Aspacking)

Regards Paul
0
 
LVL 12

Accepted Solution

by:
Ivanov_G earned 125 total points
ID: 17041875
It is because the VCL packages are larger. For example Delphi 3 produce 300KB empty EXE file, while Delphi 2006 (Win32) a bigger one. Try to compile it using lower Delphi version and the compress it.
0
 

Author Comment

by:PeterdeB
ID: 17042716
Hi Ivanov_G I believe your reply to be the answer to my question. It's the only thing left that could have caused it in my opinion. So my question is answered.

Regards Paul :)
0
 
LVL 12

Expert Comment

by:Ivanov_G
ID: 17042763
I am grad I helped. Few years ago I made some tests:

1) Delphi 3, 4, 5, 6
2) Compile empty EXE file and check size
3) Compile empty EXE file with run-time packages and check size
4) Create empty EXE with Win32 API functions and check size

Delphi 6 was producing almost twice bigger exe files. I think it will be interesting to post it here (if I find it of course).
0
 

Author Comment

by:PeterdeB
ID: 17043998
Well I'm glad you posted it here :)

Regards Paul
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
This video discusses moving either the default database or any database to a new volume.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now