making my daemon share more memory
Quick refresher: when you’ve got a unix process and it forks, the new fork can share memory with its parent, unless it starts making changes. Lots of stuff is in memory, including your program’s code. This means that if you’re going to require
a lot of Perl modules, you should strongly consider loading them early, rather than later. Although a runtime require
statement can make program start faster, it’s often a big loss for a forking daemon: the module gets re-compiled for every forked child, multiplying both the time and memory cost.