I've uploaded a new version, I briefly described the issue here if you're interested: https://cach.itch.io/the-torture-game-2x/devlog/130388/memory-issues
As far as I can tell I am now freeing up all unused memory and I think that should fix it.
There is still a very slow increase in memory usage according to task manager, but I think that might be cached or system related and won't cause issues.