Are there any downsides to using UPX to compress a Windows executable?

… there are downsides to
using EXE compressors. Most notably:

  • Upon startup of a compressed EXE/DLL, all of the code is
    decompressed from the disk image into
    memory in one pass, which can cause
    disk thrashing if the system is low on
    memory and is forced to access the
    swap file. In contrast, with
    uncompressed EXE/DLLs, the OS
    allocates memory for code pages on
    demand (i.e. when they are executed).

  • Multiple instances of a compressed EXE/DLL create multiple
    instances of the code in memory. If
    you have a compressed EXE that
    contains 1 MB of code (before
    compression) and the user starts 5
    instances of it, approximately 4 MB of
    memory is wasted. Likewise, if you
    have a DLL that is 1 MB and it is used
    by 5 running applications,
    approximately 4 MB of memory is
    wasted. With uncompressed EXE/DLLs,
    code is only stored in memory once and
    is shared between instances.

http://www.jrsoftware.org/striprlc.php#execomp

Leave a Comment