Fugitive Thought

Login | Register | RSS | Help

Saving Space

small logo

Removing comments, stripping debug info, compressing executables


posted by: Steve




The below comment was posted at the zipit development forum[groups.yahoo.com] at yahoo groups. Given that the zipit has a paltry 2 megabytes of flash ROM, space is at an extreme premium for those who have not modified their zipits for extra storage. Therefore, saving space is exceptionally important. The bulk of what follows is my reply.



---------

mythrowaway4 wrote:
>I also looked at the binaries and it seems to me that they're quite
>large for
> a ZipIt (lynx=1.4MB, lynx.cfg 142KB). Does this mean that I'd need an
> MMC card to use it?

As is evident from the lynx.cfg example, configuration files can take up quite some space - all of which is quite dear with the zipit (even with an mmc modification). It would be highly recommended to remove all comments and other superflouous information from these files. Additionally, libraries and executables are also hogs of storage space. So then..how do we remedy this situation?

First and foremost, to remove comments from a text file, one can do one of the following, depending upon system abilities or preference:



Remember, ALWAYS make a backup!

Going back to the lynx.cfg example, here is a comparison of file sizes:

> ls -alh lynx*
-rw-r--r-- 1 root root 137K 2006-01-13 00:26 lynx_original.cfg
-rw-r--r-- 1 root root 5.1K 2006-01-13 02:04 lynx_stripped.cfg

In order to slim down libraries and executables, which when compiled often contain large amounts of cruft, we can use the strip utility to minimize their memory footprint. Using strip is simple:

For libraries: For executables:

The space saved by stripping in this manner will be highly dependent upon the setup of your system,

/** YELL AT STEVE SO HE UPDATES THIS **/
And finally, I imagine we could even compress executables using gzexe (which then at runtime uncompress themselves, though at a loss in initial initialization speed.) This is something I have yet to try. Has anyone attempted this or know anything about whether it would work?
About Us | Site Map | Privacy Policy | Contact Us | ©2006 Justin DeMaris & Steven Maresca