Post

Replies

Boosts

Views

Activity

Reply to File Handle Exhaustion Issue with com.apple.Virtualization.VirtualMachine in VZ Environment
@DTS Engineer It's still not fixed but Docker has commented on this issue via https://github.com/docker/desktop-feedback/issues/168#issuecomment-4410608279. ctalledo 16 hours ago · edited by ctalledo Hey, wanted to share some context on what's likely happening here. When VirtioFS serves the guest, Apple's Virtualization framework acts as the host-side virtiofsd — it's the one opening and holding host file descriptors on behalf of the VM. When a container stops, the guest kernel sends FUSE_RELEASE messages to signal those fds can be closed, but Apple's framework doesn't appear to be honoring them reliably. The fds accumulate until the host hits its limit, and only a Docker restart clears them because that tears down the entire VM. The gRPC FUSE workaround works precisely because it bypasses Apple's framework entirely — Docker's own Go server handles the fd management, and it closes fds correctly on FUSE_RELEASE. That the workaround is effective here suggests the issue is in Apple's Virtualization framework rather than Docker's own code. Unfortunately since the leak lives inside Apple's framework, Docker can't fix it directly. Worth noting this is still being reported as of late 2025 (see also #218, a newer report with much more severe fd counts), so it hasn't been quietly resolved upstream either. A related discussion was filed on the Apple Developer Forums back in 2023: https://developer.apple.com/forums/thread/741572
Topic: App & System Services SubTopic: Core OS Tags:
May ’26
Reply to File Handle Exhaustion Issue with com.apple.Virtualization.VirtualMachine in VZ Environment
Thank you for your insights. I conducted a test on macOS Sonoma and can confirm that the issue persists. Despite the maximum file descriptors being capped at 65,535, my experiment involved opening 70,000 file descriptors. While the count of open file descriptors never exceeded the maximum limit, the system still produced too many open files in system errors. This issue became evident when other processes on my macOS, such as iTerm, were affected, displaying the same error message. This leads me to believe that your suggestion about potential issues with the recycling of file descriptors might be accurate. It seems that the system isn’t effectively managing or recycling these descriptors, hence leading to the observed problem.
Topic: App & System Services SubTopic: Core OS Tags:
Nov ’23
Reply to File Handle Exhaustion Issue with com.apple.Virtualization.VirtualMachine in VZ Environment
@BenjaminApple thank you for your prompt response. I have upgraded to MacOS Sonoma as suggested this morning and conducted further testing to investigate the issue. File Creation: I generated a substantial number of files (70,000) on the Mac host using the command for i in {1..70000}; do touch "file_${i}.txt"; done. Listing Files in VZ VM: I navigated to the directory (cd ~/test-file-exhaustion) and listed all the files within the VZ VM. Initial File Handle Count: Upon checking with lsof, the initial count of file handles associated with com.apple.Virtualization.VirtualMachine was high: ❯ lsof | grep "$(pgrep com.apple.Virtualization.VirtualMachine)" | wc -l 58625 Subsequent Check after 30 Minutes: After a wait of 30 minutes, I rechecked the file handles. Only 482 file handles were closed by com.apple.Virtualization.VirtualMachine: ❯ lsof | grep "$(pgrep com.apple.Virtualization.VirtualMachine)" | wc -l 58143 This test indicates that the issue of excessive open file handles persists even on the latest MacOS version and can be consistently reproduced. I look forward to any guidance or suggestions you might have regarding this matter.
Topic: App & System Services SubTopic: Core OS Tags:
Nov ’23
Reply to File Handle Exhaustion Issue with com.apple.Virtualization.VirtualMachine in VZ Environment
@DTS Engineer It's still not fixed but Docker has commented on this issue via https://github.com/docker/desktop-feedback/issues/168#issuecomment-4410608279. ctalledo 16 hours ago · edited by ctalledo Hey, wanted to share some context on what's likely happening here. When VirtioFS serves the guest, Apple's Virtualization framework acts as the host-side virtiofsd — it's the one opening and holding host file descriptors on behalf of the VM. When a container stops, the guest kernel sends FUSE_RELEASE messages to signal those fds can be closed, but Apple's framework doesn't appear to be honoring them reliably. The fds accumulate until the host hits its limit, and only a Docker restart clears them because that tears down the entire VM. The gRPC FUSE workaround works precisely because it bypasses Apple's framework entirely — Docker's own Go server handles the fd management, and it closes fds correctly on FUSE_RELEASE. That the workaround is effective here suggests the issue is in Apple's Virtualization framework rather than Docker's own code. Unfortunately since the leak lives inside Apple's framework, Docker can't fix it directly. Worth noting this is still being reported as of late 2025 (see also #218, a newer report with much more severe fd counts), so it hasn't been quietly resolved upstream either. A related discussion was filed on the Apple Developer Forums back in 2023: https://developer.apple.com/forums/thread/741572
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
May ’26
Reply to File Handle Exhaustion Issue with com.apple.Virtualization.VirtualMachine in VZ Environment
Thank you for your insights. I conducted a test on macOS Sonoma and can confirm that the issue persists. Despite the maximum file descriptors being capped at 65,535, my experiment involved opening 70,000 file descriptors. While the count of open file descriptors never exceeded the maximum limit, the system still produced too many open files in system errors. This issue became evident when other processes on my macOS, such as iTerm, were affected, displaying the same error message. This leads me to believe that your suggestion about potential issues with the recycling of file descriptors might be accurate. It seems that the system isn’t effectively managing or recycling these descriptors, hence leading to the observed problem.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Nov ’23
Reply to File Handle Exhaustion Issue with com.apple.Virtualization.VirtualMachine in VZ Environment
@BenjaminApple thank you for your prompt response. I have upgraded to MacOS Sonoma as suggested this morning and conducted further testing to investigate the issue. File Creation: I generated a substantial number of files (70,000) on the Mac host using the command for i in {1..70000}; do touch "file_${i}.txt"; done. Listing Files in VZ VM: I navigated to the directory (cd ~/test-file-exhaustion) and listed all the files within the VZ VM. Initial File Handle Count: Upon checking with lsof, the initial count of file handles associated with com.apple.Virtualization.VirtualMachine was high: ❯ lsof | grep "$(pgrep com.apple.Virtualization.VirtualMachine)" | wc -l 58625 Subsequent Check after 30 Minutes: After a wait of 30 minutes, I rechecked the file handles. Only 482 file handles were closed by com.apple.Virtualization.VirtualMachine: ❯ lsof | grep "$(pgrep com.apple.Virtualization.VirtualMachine)" | wc -l 58143 This test indicates that the issue of excessive open file handles persists even on the latest MacOS version and can be consistently reproduced. I look forward to any guidance or suggestions you might have regarding this matter.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Nov ’23