From: David B. <db...@fi...> - 2005-08-25 15:38:48
|
Harald Armin Massa <har...@gm...> writes: > thank you for sharing this receipt. In my experiments some time ago with UPX > I got the impression, that the files are quite smaller on disk (with reduced > download time & reduced loading time across networks), but did take in fact > more memory in RAM; so the payoff was negative. Well, in terms of actual memory usage needed for a given file when loaded, no, it's no different than the original because the decompression engine operates "in-place." But in terms of application working set memory usage or instantaneous memory usage, the answer is more complicated. What you may be thinking of is the fact that if you UPX a shared file (such as a DLL, or an EXE that will run more than once) under Windows, having it UPXed will defeat Windows ability to share that file among multiple processes. Normally Windows maps the file itself into the process space (effectively using the file as part of the swap space), but with UPX the DLL itself isn't the code image but is data operated on at load time, so Windows does have to load it in. Since the normal load process is based on demand paging from the file, if you have a file that would normally only page in a portion of itself, you may have a higher working set on an instant to instant basis with UPX since it has to decompress the whole file initially. But the working set will soon settle down to actual usage based on code, and if Windows needs the memory, it'll just swap out the unused portion to the page file. In the context of py2exe the sharing aspect of this is probably unimportant, since py2exe is already locking down imports to its runtime location, and you're not going to share those extension modules (or the python dll itself) with any other process anyway. Unless you're constructing multiple targets with a common runtime, in which case you would want to consider this issue. For many of my applications, I'm packaging up a single executable (or service) which will be installed on a target machine and then run as an individual application (or automatically as a system service). Thus there will be no sharing needed, and I've little to lose (except perhaps a slightly some additional usage of the page file on disk) with the compressed versus uncompressed version. -- David |