Opened 9 years ago
Last modified 6 years ago
#14923 new defect
`guestcontrol run` memory leak in host
| Reported by: | iano | Owned by: | |
|---|---|---|---|
| Component: | guest control | Version: | VirtualBox 5.0.10 |
| Keywords: | Memory, leak | Cc: | |
| Guest type: | Windows | Host type: | Linux |
Description
#14850 is the only other open memory leak I can find. That looks like a guest side leak associated with disk IO, but this is a host side leak associated with vboxmanage <name> guestcontrol run
I'm running an Ubuntu host, and a Windows 7 (all updates installed) guest. The guest is given 1 CPU and 2GB of RAM, but I can get it to consume >8GB of RAM (enough to have the Linux OOM system kill it). I verified that the guest stabilizes at using ~650MB of RAM in this case, so the leak is definitely on the host side. To trigger the leak, I first start my VM:
ian$ vboxheadless -startvm win-7-pro-loaded-base
Then I run:
ian$ vboxmanage guestcontrol win-7-pro-loaded-base run --username administrator "C:\\Windows\\System32\\ping.exe" -- "-t" "localhost" 2>&1
You can accelerate the leak by running many of the vboxmanage commands in parallel. With 6 running, the vboxheadless process went from using 3GB to 5GB (RES in htop) RAM in 12 minutes.
Attached are the VBox.log from one occassion of running this, along with an image of vboxheadless memory use over time with 6 vboxmanage commands running, and an image of the stabilized guest memory.
I also attached a zip of running:
sudo strace -i -ff -p <vboxheadless first thread PID> -o strace_output/strace
for a few minutes while the 6 vboxmanage commands were running.
Let me know if there's more information I can supply, or if you'd like me to try anything. I started along the path of building and running virtualbox from source so I could poke around, but I'm having a few issues.
Thanks in advance for all of your help!
Attachments (4)
Change History (11)
by , 9 years ago
| Attachment: | vboxheadless_pinging-localhost-with-guestcontrol-run_VBox.log added |
|---|
by , 9 years ago
| Attachment: | host_memory_skyrockets.png added |
|---|
Plot of host vboxheadless memory usage over time. Total memory is 18GB, so in 15 minutes about 2.5GB are consumed. This continues on until OOM kicks in.
by , 9 years ago
| Attachment: | guest_memory_stabilized.png added |
|---|
Guest memory stabilized after a few minutes
comment:1 by , 9 years ago
My strace .zip is too large (11MB) to attach, so here's a link: https://drive.google.com/file/d/0B5Pxwih4KbQmTDZEbmZWNFhQNHc/view?usp=sharing
comment:2 by , 9 years ago
I can replicate this with virtualbox-5.0_5.0.10-104061-Ubuntu-precise_amd64.deb and the testing build VirtualBox-5.0.11-104602-Linux_amd64.run
comment:3 by , 9 years ago
I left the same VM running over the weekend without any vboxmanage guestcontrol ... run running, and it stays steady at 12.6 MEM% (RES=2204MB) in the host.
comment:4 by , 9 years ago
I can get this to occur with virtualbox-5.0_5.0.0-101573-Ubuntu-trusty_amd64.deb as well. It seems considerably worse in that version: after 25 minutes of 6x ping.exe running via guestcontrol ... run, vboxheadless consumes 7GB of RAM in the host.
comment:5 by , 9 years ago
I have virtualbox building, so I'm attempting to track this down on my own. I can't help but think it's something around memory allocation for STDOUT pumping, but I'm not familiar with the code base so it's slow moving.
Is there more information I can give to you that will help this ticket get noticed and make it easier to act on? Let me know!
by , 9 years ago
| Attachment: | vboxheadless_24GVirt+15GReal.png added |
|---|
htop of vboxheadless using 24G Virtual + 15G Real memory as a result of this bug
comment:6 by , 6 years ago
Can you please retry with latest 5.2.18 and check if the issue still persists? Thanks
comment:7 by , 6 years ago
pentagonik, don't you mean the latest test build? The 5.2.18 release didn't contain the fixes, it needs GAs r124533 or later.


VBox.log