Memory leak useConpty: true
- [x] Version is 3.1.4
- [x] Does not seem to be a duplicate
- ** Issue is reproducible without any plugins
Issue
Start powershell.exe (not using Hyper)
Enter command:
[System.IO.Directory]::GetFiles("\.\pipe\", "conpty")
(This should not produce anything)
Start hyper. In the powershell.exe terminal repeat the command. (This should now result in something like...) \.\pipe\conpty-3699378.300112908-in \.\pipe\conpty-3699378.300112908-out
These are the in/out pipes used by conPty.
Back to Hyper... Split the terminal (any direction) In the powershell.exe terminal repeat the command again. (This should result in something like...) \.\pipe\conpty-3699378.300112908-in \.\pipe\conpty-3699378.300112908-out \.\pipe\conpty-9116907.052751396-in \.\pipe\conpty-9116907.052751396-out
Back to Hyper... Close the split pane. In the powershell.exe terminal repeat the command one last time. (This should result in something like...) \.\pipe\conpty-3699378.300112908-in \.\pipe\conpty-3699378.300112908-out \.\pipe\conpty-9116907.052751396-in \.\pipe\conpty-9116907.052751396-out
...so the last two pipes have remained open. This leads to a leak (unfreed resources).
If you repeat this enough times, you'll reach an open file limit of Windows (granted, maybe 8000+ of them).
Attached is an automated test (index.js) that opens and closes a split pane repeatedly. The left open pipes can be seen with powershell as above while it runs.
Additional notes
With useConpty: false, repeat the test but use the command: [System.IO.Directory]::GetFiles("\.\pipe\", "winpty")
You'll see winpyt pipes are closed properly.
Seems to be coming from node-pty upstream https://github.com/microsoft/node-pty/issues/471
Yes I noticed this during testing. I was wondering if there is an updated node-pty you could move to that maybe fixes it.
we're on the latest build I think
ah ok, thanks