Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Exe Size Debug/Release almost the same (XE5)


This question is answered.


Permlink Replies: 3 - Last Post: Aug 10, 2015 1:36 AM Last Post By: Nico Callewaert
Nico Callewaert

Posts: 22
Registered: 5/9/02
Exe Size Debug/Release almost the same (XE5)  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 28, 2015 2:56 AM
Hi,

When I compile my application (around 300 forms + 200 units), I notice not so much difference between debug and release build (76 MB vs. 75 MB). I'm wondering how this is possible. Another small project shows a bigger difference : 35 MB vs. 22 MB. I'm just puzzled. In both applications I use the same components (DB connectivity, DevExpress & ReportBuilder). In both applications I don't use runtime packages and I didn't change any compile settings. I'm using Delphi XE5 update pack 2.
Any ideas what could be the reason ?

Many thanks in advance, Nico Callewaert
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: Exe Size Debug/Release almost the same (XE5)
Correct
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 28, 2015 10:59 AM   in response to: Nico Callewaert in response to: Nico Callewaert
Nico wrote:

When I compile my application (around 300 forms + 200 units), I notice
not so much difference between debug and release build (76 MB vs. 75
MB). I'm wondering how this is possible.

You likely have your project configured to store the extra debug info in
an external .TDS file instead of in the .EXE itself.

--
Remy Lebeau (TeamB)
Nico Callewaert

Posts: 22
Registered: 5/9/02
Re: Exe Size Debug/Release almost the same (XE5)  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 28, 2015 2:15 PM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Remy Lebeau (TeamB) wrote:

You likely have your project configured to store the extra debug info in
an external .TDS file instead of in the .EXE itself.

--
Remy Lebeau (TeamB)

Hi Remy, yes indeed, that was the reason. Thanks !
Nico Callewaert

Posts: 22
Registered: 5/9/02
Re: Exe Size Debug/Release almost the same (XE5)  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Aug 10, 2015 1:36 AM   in response to: Nico Callewaert in response to: Nico Callewaert
Hi,

I was too fast to say the problem is solved. The exe got smaller because I've built with runtime packages. Forgotten to turn it off. The exe changed again back to it's 75 MB.
I've found on the internet that RTTI seems to be the troublemaker. The solution as explained on stackoverflow is to include the floowing lines :

{$WEAKLINKRTTI ON}
{$RTTI EXPLICIT METHODS([]) PROPERTIES([]) FIELDS([])}

As explained on stackoverflow, from Delphi XE5 on, those lines have to be inserted in EVERY unit of the project. I've inserted it just after the interface keyword, so just before the upper uses clause.
When I've first inserted it on the main form, the exe shrinked from 75MB to 71MB. Adding those lines to other units doesn't shrink the exe any further. So far, those 2 lines are inserted now in approx. 40 units, but the size of the exe is not changing anymore. But maybe having such a large exe is not really a problem, but it just looks weird.

Thanks again, Nico
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02