Open mklement0 opened 7 years ago
Hey Michael, are you opening a workspace that contains a lot of files? I've seen this issue reported in such cases because we're scanning the workspace files to find symbol details for reference and definition searches. Seems we might be leaking file handles, so I'll need to look into that.
Thanks, @daviwil.
Looks like you've identified the problem on macOS: The problem only happens in a large directory subtree with 12336 files, although only 36 of the files are PS-related (*.ps1
/ *.psd1
/ *.psm1
).
Seemingly, all 12336 files are scanned and kept open, because even raising ulimit -n
to the macOS 10.12 maximum of 10240 doesn't help.
Note that the default ulimit -n
value is:
On Ubuntu I no longer see any problems after upgrading to 1.16 / 1.4.3
Thanks for the additional details! I'll see if I can figure out a better way to open those files to work around the handle leakage, might be able to ship an update in the next couple of days.
Hi @daviwil, just wondering if you were able to look into this at all? I'm getting the same 'Too many open files in system' issue and lsof
shows a huge number of files open under powershell processes.
I'm using VS Code 1.19.2, vscode-powershell 1.5.1 and MacOS 10.12.6.
Adding a note here that this issue is also impacting my setup. Hoping for some resolution when possible.
This is probably due to the reference resolver looking for definitions. @SeeminglyScience made a couple of great improvements in the references code to improve here. @glennsarti also added new file exclusion configurations coming in the next release that will help with that. Beyond that we might need to look into this further and find out if there's anything else we can do to limit file usage while still getting references.
System Details
$PSVersionTable
(on macOS):From macOS:
Issue Description
Things start to go wrong when the PS version cannot be determined and the version is assumed to be v5:
In effect, the Editor Services don't work properly on either platform, but some aspects still work on Linux, such as F8.
On macOS, the logs show additional failures:
Note that
ulimit -n
(number of files that can be open simultaneously) still defaults to256
as of macOS 10.12.6.Attached Logs
macOs.zip
ubuntu.zip