Hi,You're likely just hitting a memory leak, Haskell DLLs and the RTS aren't designed to be unload-able, which is why you can't call hs_init again after you stop.The leak happens only when you do a foreign export because foreign exports create C wrappers to initializers for each function you export.
These are marked as static initializers, and as such the CRT will initialize them on DLL_PROCESS_ATTACH time. At DLL_PROCESS_DETACHtime the destructors would be run, but we don't have destructors for these initializers, so whatever they did will always persist.
Your use case is fairly uncommon, but file a bug report against the leaks anyway. Why do you need to keep loading and unloading the dll?