Recent

Author Topic: FILE TOO LARGE  (Read 13164 times)

geroj13051981

  • Newbie
  • Posts: 3
FILE TOO LARGE
« on: January 06, 2009, 08:01:48 pm »
I'm developing an application using lazarus, it's normal that the .exe file is too large (23,6) with just six forms?

Vincent Snijders

  • Administrator
  • Hero Member
  • *
  • Posts: 2661
    • My Lazarus wiki user page
Re: FILE TOO LARGE
« Reply #1 on: January 06, 2009, 08:53:10 pm »
Yes, that is more or less normal, if you include the debug information in your application. Please read more about it in the FAQ.

lazarillo

  • Guest
Re: FILE TOO LARGE
« Reply #2 on: January 06, 2009, 08:56:22 pm »
Hello,
If you change some options of the compiler the weight of the .exe will be much smaller.

Handoko

  • Hero Member
  • *****
  • Posts: 5507
  • My goal: build my own game engine using Lazarus
Re: FILE TOO LARGE
« Reply #3 on: January 29, 2009, 07:19:27 am »
I have a similar case.

I'm developing a simple inventory utility. Currently only 4 forms, the executable file size has reached 13,7 MB  :o. I think it's normal, because I use a lot of visual controls and self made units.

My suggestion is: try using strip.exe to make it slim. But only if you ready to release it, because the debug information will be strip off. I'm happy with the result: 1.85 MB (before was 13,7!)

8) My easy step to make it fat loss:
- Copy the strip.exe from C:\lazarus\fpc\2.2.2\bin\i386-win32
- Paste it to your project folder
- Using Command Prompt, type: strip YourProject.exe
- And be happy with the result.

JanRoza

  • Hero Member
  • *****
  • Posts: 731
    • http://www.silentwings.nl
Re: FILE TOO LARGE
« Reply #4 on: January 29, 2009, 08:08:43 am »
Like the other persons above already mentioned, change your compile options to exclude debug information and you will see the exe file is only some 2 Mb.
I keep the debug info included when developing and testing and after that I do one more compilation without debug info to get the small exe file which can easily be distributed.

 :)
Jan 
OS: Windows 11 / Linux Mint 22.2
       Lazarus 4.4 RC FPC 3.2.2
       CodeTyphon 8.80 FPC 3.3.1

Leledumbo

  • Hero Member
  • *****
  • Posts: 8833
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: FILE TOO LARGE
« Reply #5 on: January 30, 2009, 09:12:25 am »
I got a IMHO better solution. Since Lazarus uses fpc.cfg, why not use that? Here's part of mine:
Code: [Select]
#IFDEF OPTIMIZE
  -O3 # Maximum optimization, there's no -O4 yet
  -XX # Turn on smartlinking
  -Xs # Exclude debug information
#ENDIF

#IFDEF DEBUG
  -Crtoi # Turn on all checks
  -XS    # Use static linking, debugging doesn't go well with smartlinking
  -g     # Generate debug info
  -gl    # Generate line number debug info
  -gh    # Generate heap profiling
#ENDIF
You can then add -dOPTIMIZE to other options tab. Simple, isn't it? Btw, I also recompile my Lazarus with OPTIMIZE defined. With an exception that -O3 got replaced by -O1 (some LCL bug not yet resolved).

 

TinyPortal © 2005-2018