If your application does not contain very large data structures, the greatest factor in its size when delivered is usually the number of symbols left in it.
This is because function definitions (which are large) are usually associated with symbols. Only when these symbols are deleted can the associated function definitions be deleted. Until that happens, the garbage collector passes over them during delivery.
You should look for symbols that are left in the image, which do not need to be there. You can do this by starting the delivered image in level 4 (or with :keep-debug-mode
) with the argument -listener
. The image starts by interacting with the user. You can then check which packages and symbols are left.
list-all-packages
is one function you can use. Using the :call-count
keyword is another possibility.