Solved

Why is my recompiled exe sooo huge?

Posted on 2006-07-03
10
396 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
Independent Software Vendors: 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 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

690 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