-
Notifications
You must be signed in to change notification settings - Fork 207
Have a watchdog restarting hie on high memory usage #806
Comments
This will need some kind of command line parameter, or config setting to decide on the criteria for restart, |
I tried to implement this but found a couple roadblocks:
Given those 2 issues, the experience of restarting the server will be significantly worse than consuming too much memory, so canning this for the time being. |
@lorenzo, the workaround I posted some time ago in the other issue does partially what you want:
I don't agree with that. Having OS unresponsive is very bad. I am working on not so small 35k LOC project and as soon as HIE uses more than ~4 GB memory my OS (macOS) starts to get sluggish and unresponsive. This is not out of memory condition, but HIE and kernel task are using all CPU (probably this is related to some memory allocation routines). |
@kfigiela I'm not saying the issue should be ignored, only that after trying a restart in vscode and neovim, in both cases I had to restart the editor. That's no different to having the user just do that. |
If using Tools like earlyoom are a big cannon but may help alleviating the symptom. |
A common complaint about hie is its unbounded memory consumption. This can be due to many different factors, but probably mostly to the famously known memory leak in GHCi, which has mostly been solved in the upcoming GHC 8.6.
For many the road to using 8.6 is far away in the future, so we should mitigate the issue with some other measures. One strategy can be having a separate thread in hie checking on the memory usage and making the server restart when it exceed a certain threshold.
Before restart, hie can send a
window/ShowMessage
explaining what it is doing.The text was updated successfully, but these errors were encountered: