in reply to Loading/Unloading perl modules
Once code is compiled, it stays around in memory. If the module built up large data structures, you could try to find a way to destroy them. But even if your program is no longer using the memory, it is unlikely that your operating system will be able to take the memory back before you expire.
If you really, really need to do this, then the simplest approach is to launch another process (or fork), have that one load the module, do what needs to be done, then exit. Since the memory was tied up in a process that exited, it is all freed at once.
|
|---|