Thank you @LostKobrakai @josevalim .
Code path pruning
I had skipped a rather important word when reading about code path pruning.
Code memory usage
Turns out running mix release.init creates rel/env.sh.eex which has the RELEASE_MODE option right at the top . I migrated from distillery, so it wasn’t obvious what I was looking for. Anyone starting off with a fresh project would easily find this option.
rel/env.sh.eex
# # Set the release to load code on demand (interactive) instead of preloading (embedded).
# export RELEASE_MODE=interactive
Also, this may not affect startup time in OTP 26.
Final results
Using interactive mode after going thru all the routes has reduced the memory:
Production is running at 23MB right now, but I expect it will grow to at least 30MB. Embedded mode which preloads everything had code memory usage at 48MB. Super-helpful when running on lower memory nodes. A MB saved is a MB earned. ![]()























