←back to thread

127 points warothia | 1 comments | | HN request time: 0s | source
Show context
openasocket ◴[] No.42167039[source]
Cool! Looks like is used dynamic loading. Which is certainly workable. One downside is that while dynamic loading is well-supported, dynamic unloading is generally not. Meaning if you are using dynamic loading and re-loading for hot updates the server process will start to accumulate memory. Not a huge issue of the server process is periodically restarted, but can potentially cause weird bugs.

You might be able to make something more robust by forking and loading the modules in a separate process. Then do something fancy with shared memory between the main process and the module processes. But I haven’t looked into this much

replies(3): >>42167215 #>>42167890 #>>42169759 #
shakna ◴[] No.42169759[source]
Doesn't dlclose unload things...?

> If the reference count drops to zero and no other loaded libraries use symbols in it, then the dynamic library is unloaded.

replies(2): >>42170707 #>>42171718 #
1. ◴[] No.42170707[source]