Solved

Why is my recompiled exe sooo huge?

Posted on 2006-07-03
10
390 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

867 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

12 Experts available now in Live!

Get 1:1 Help Now