Executable size lazarus / 11-Options ---------------------------------------------------------------------- HPF_BR · 2004-05-21 20:37 How can i decrease the size of an executable in Lazarous  :?: It´s curious because if i create an application that only shows a menu with Lazarous this is 9x bigger than application that only shows a menu created by the Freepascal IDE. ---------------------------------------------------------------------- derox · 2004-06-17 12:59 Yeah!! Me to =) I wrote a program on 100 lines or so and the *.exe filed took 4MB of space. There were no pictures or any large files in the project at all, actually just 2 shapes, 2 buttons and one label... Anyway, untill some smart guy give us the answer, you can use the handy program UPX http://upx.sourceforge.net/ ---------------------------------------------------------------------- fatg · 2004-06-17 14:26 Next time please use search, there are already at least 3 threads about executable size on the forum ... http://www.lazarus.freepascal.org/index.php?name=PNphpBB2&file=viewtop ic&t=264 http://www.lazarus.freepascal.org/index.php?name=PNphpBB2&file=viewtop ic&t=261 http://www.lazarus.freepascal.org/index.php?name=PNphpBB2&file=viewtop ic&t=66 ---------------------------------------------------------------------- ci00rix · 2005-08-01 11:38 I've read all these three threads, but didn't find any working answer. The problem is still the same; REALLY simple application; one standard frame with one button which does nothing (empty function connected). I've already followed your suggestions: -CX -Xs -XX ..... Windows executable still weights 5.81 MB. :cry: What did i do wrong? ---------------------------------------------------------------------- Vincent Snijders · 2005-08-01 11:58 You didn't call strip from the command line. ld is broken, so -Xs doesn't work. ---------------------------------------------------------------------- ci00rix · 2005-08-01 20:00 Thanks Vincent for quick reply But... If -Xs doesn't work.... Is there any other way to invoke this "Stripping"? ---------------------------------------------------------------------- Anonymous · 2005-09-27 01:49 Yes .... use the command line program called "strip" strip --strip-all I think that this program comes with Lazarus. After you do that your code will be reduced to about 40% Then you can use upx. Google for "upx". It is a really good source compressor. It will compress your program to about half the stripped size. So you can easy divide the program size by 5 or more using "strip" and then "upx" Felipe ---------------------------------------------------------------------- kmoffat · 2006-02-07 01:14 Wow, from over 5 megs down to 670k after using strip and upx. Nice. ---------------------------------------------------------------------- kmoffat · 2006-02-07 01:15 I see upx-ucl and upx-nrv in Debian; anyone know the difference? ---------------------------------------------------------------------- fab25 · 2006-02-26 03:31 Found this, although so far compression ratio was approx. the same for me : UPX-NRV is binary-only freeware that uses the NRV library for compression. UPX-UCL is open source, but compression is a bit less efficient. ---------------------------------------------------------------------- marien · 2006-02-28 14:53 I have made a small Lazarus program that does the reducing. I called it MakeMeSmall. You can find it on my homesite: http://members.home.nl/mvanwesten/lazarus.html ---------------------------------------------------------------------- WibblyTim · 2006-04-27 15:46 Downloaded your utility MakeMeSmall marien. After compiling on both Windows and Linux (Mandrake 2006) I got it to make itself small and now it has made the first beta of a little game I am writing very small indeed. It has gone from 7.3MB down to 413KB, fantastic. Thank you so much!!!!! ---------------------------------------------------------------------- vrull · 2008-02-20 00:33 MakeMeSmall is a great utility, I use it every time to reduce my programs to about 1/20th of their original sizes. Thanks very much, Marien! A couple of improvements I have made with my copy are: 1. check the size of the original file, before processing. If it has already been downsized, next pass will destroy it. 2. reduced nice value by 2 for both processes, like "nice -n 2 strip ...", otherwise the system looks frozen, until the processing is done. The above is for Linux, obviously. ---------------------------------------------------------------------- Gintas · 2008-02-20 07:25 Quote from: "WibblyTim" It has gone from 7.3MB down to 413KB, fantastic. Thats all what I need. This utility should be included in Lazarus . ---------------------------------------------------------------------- LazaruX · 2008-03-03 08:10 not again, please ---------------------------------------------------------------------- Gintas · 2008-03-31 12:28 Quote from: "Anonymous"Yes .... use the command line program called "strip" strip --strip-all :?: Should i type exe file name or pascal unit into strip command abow. ---------------------------------------------------------------------- LazaruX · 2008-03-31 13:26 the exe the exe. You want to reduce the exe size, not the unit size. Code: [Select] strip project1.exe Code: [Select] upx project1.exe ---------------------------------------------------------------------- dannydesiliva · 2009-09-19 05:59 Thanks for the info!! I'm going to have to play with it a little bit, but even 5k is better than 36k!! Thanks again