oakes / Nightlight

An embedded editor for Clojure
https://sekao.net/nightlight/
The Unlicense
788 stars 35 forks source link

Number of Threads increasing (possible memory leak) #16

Closed Goldritter closed 7 years ago

Goldritter commented 7 years ago

I had the issue that my memory was running out after a prolonged usage of nightlight. When I inspect the memory and thread behaviour in the Java Visual VM, I noticed, that for every reload up to 2 new Threads were started, but the old Threads does not stop and wait. After a few reloads I ended up with 62 total started Threads and 58 Daemon Threads. And the number is increasing for every (re-)load.

Is it somehow possible to close/kill this unused Threads?

Update: The Thread inceasing happens when I reload the REPL. If I'm in a name space and hit reload the Threadcount remains stable.

oakes commented 7 years ago

I think this is because when you reload Nightlight, it will create a new REPL session for you on the server, but it doesn't actually kill the old one. I'll look into a way to do so.

oakes commented 7 years ago

Fixed in 0d176aa87cf236756d3eefc3d2281e28647aac01, thanks!