[Request]: Can we have a stable interface for querying the amount of memory that is being used by the underlying virtual machine.
- Dominant language
- Swift
- Stars
- 49.9k
- Forks
- 1.8k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 22
Description
### Feature or enhancement request details
`container stats` only reports the memory that is being used by the processes in the container, not the amount that the container uses/claims from the host, which can be found by checking the memory used by the corresponding `com.apple.Virtualization.VirtualMachine` process ( `Virtual Machine Service for container-runtime-linux` in the Active Monitor).
Obtaining this number is a little cumbersome. I'm using `lsof` on `com.apple.Virtualization.VirtualMachine` to see what directory it opens in `~/Library/Application Support/com.apple.container/containers/` to get the container UUID.
Can we add a stable interface to it someway somewhere? Or is there already better ways of accomplishing this?
### Code of Conduct
- [x] I agree to follow this project's Code of Conduct
Contributor guide
Research direction
Start with the existing `container stats` command and investigate how it identifies containers under `~/Library/Application Support/com.apple.container/containers/`. Compare its process-level reporting with the `com.apple.Virtualization.VirtualMachine` process and determine what stable interface could expose host memory usage; done means the requested value is available without `lsof` or process inspection.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- cli, operating-systems
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100