Hello maefe,
Hauptwerk itself does indeed release the memory whenever you unload an organ (and also whenever you exit Hauptwerk). (There are definitely no 'memory leaks' in Hauptwerk.)
However, Windows may or may not make that memory available again immediately. Also, memory may become 'fragmented' (non-contiguous ) over time, as it's used and re-used by Hauptwerk and/or other applications and/or background processes, so there might be less contiguous chunks that can usefully used over time. Rebooting occasionally will help with that, as will making sure that you always try to avoid filling up your PC's RAM excessively, i.e. making sure that you keep a certain amount of RAM free at all times.
(Also make sure that you have all available Windows updates installed, as well as all current driver updates, and the latest version of Hauptwerk, for good measure.)