?
Solved

Why is my recompiled exe sooo huge?

Posted on 2006-07-03
10
Medium Priority
?
399 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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
 

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 500 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
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 is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses
Course of the Month15 days, 2 hours left to enroll

771 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