Network Data Transfer Memory Leak

Discussions related to using VirtualBox on Windows hosts.
bkloppenborg
Posts: 3
Joined: 29. Dec 2008, 04:42

Network Data Transfer Memory Leak

Post by bkloppenborg »

I am running VirtualBox 2.1.0 on a Windows XP SP3 Host. The Host is an Athlon XP 3000+ processor with 1 GB of RAM. I run Ubuntu 8.04 in a VM (with 400 MB of RAM and 128 MB of VRAM) in headless mode. The VM is attached to one of two Host Interfaces using the new host interface driver introduced in 2.1.0 (although this problem existed in VirtualBox 2.06). The host interface in question is an older PCI network adapter. I have not tried the VM setup with the on-board Ethernet adapter.

I have noticed that while the VM is running, the system starts with ~600 MB free and then slowly decreases, at about 50 KB per second. I have also noticed that if I transfer files over the network (i.e. VM to another machine on the network) the available system memory decreases, almost bit per bit, while the file transfer is in progress. This continues until ~11 MB of memory is left at which time the Windows Host either hangs or blue screens.

Upon stopping the VM, all of the memory is freed (the 400 MB that is allocated, plus any additional memory). Does this sound like a memory leak? To whom should this be reported?

Thanks.
TerryE
Volunteer
Posts: 3572
Joined: 28. May 2008, 08:40
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS
Contact:

Post by TerryE »

You need to register for a wiki user account (this is different to a forum account sorry) and then you can use the public Bugtracker to raise tickets for reporting problems in VirtualBox and make suggestions for improvements.
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
bkloppenborg
Posts: 3
Joined: 29. Dec 2008, 04:42

Post by bkloppenborg »

For future reference this issue has been submitted to BugTracker:

http://www.virtualbox.org/ticket/2918
jaylittle
Posts: 11
Joined: 5. Jan 2009, 20:07

Post by jaylittle »

I think it's a real shame that the bug tracking issue has been closed. This is a very real issue that I myself have been experiencing ever since the upgrade to 2.1.0. Physical Memory usage will steadily increase far beyond what is expect. I have 4 gigabytes of memory on a Vista x64 host. Prior to starting the VM, my memory usage is 1.5 gigs. The VM has a 32 bit installation of Windows XP and is configured to use 1.0 gigs. After starting the machine (which is used for Visual Studio 2003 development work), within two - three hours my host physical memory usage will be at 98% - 99%. My host machine gets very sluggish. There is no legitimate reason for the VM to take up this kind of memory as it has only been allocated a gig. In this instance it eventually occupies 2.5 gigs of memory.

Shuting down or suspending the VM frees the memory back up. This is a Virtual Box issue. At this point I'm considering downgrading to 2.0.6 and/or switching over to VMWare Workstation and wiping my hands clean of this issue. As it stands now, Virtualbox is a great product but it has way too bugs that never seem to be actual resolved (i.e. memory leaks) to be taken seriously for the serious work I need to do.
TerryE
Volunteer
Posts: 3572
Joined: 28. May 2008, 08:40
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS
Contact:

Post by TerryE »

jaylittle, you are always free to open a wiki account and reopen the ticket. However, if you do so you need to provide clear instrumentation to show that this is a VBox related bug and a clear supporting argument. The developers won't disregard a well argued case. One approach might be to use perfmon in record mode to collect process and other stats during this "memory take-over" as you describe. You need to give the developers a repeatable test case, because without this they won't know how serious a problem this is, and how to diagnose it to create a fix.
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
sandervl
Volunteer
Posts: 1064
Joined: 10. May 2007, 10:27
Primary OS: MS Windows Vista
VBox Version: PUEL
Guest OSses: Windows, Linux, Solaris

Post by sandervl »

jaylittle: why are you complaining that we've closed the ticket if the original reporter asked to do so? Concluding from this that we leave bugs unresolved is remarkably strange.

Like Terry said, if you have a genuine problem to report, then please open a ticket.
jaylittle
Posts: 11
Joined: 5. Jan 2009, 20:07

Post by jaylittle »

sandervl wrote:jaylittle: why are you complaining that we've closed the ticket if the original reporter asked to do so? Concluding from this that we leave bugs unresolved is remarkably strange.
The original poster is outright wrong, that is why. My memory usage never significantly decreases after VBox eats more RAM. It simply gets bigger and bigger. Unfortunately, the task manager never seems to show VBoxs actual memory usage, so it isn't a whole lot of help there beyond the physical memory percentage that I refer to.

All I know is that when I shutdown/suspend a virtual machine that has been allocated 1 gig of RAM and 12 megs of video ram in virtual box that has been running for three to four hours, the physical memory usage issue is cleared up and 2.5 gigs of RAM are mysteriously released back to the system.

I'm not sure the issue is even network related. It happens on host networking as well as NAT networking. I had no such problems using 2.0.6. I have tried a variety of emulated network cards, still no dice.

I have reinstalled VirtualBox 2.1.0 from scratch and the Toolset inside the XP Virtual machine. I have even recreated the Virtual Machine (only reusing the Virtual Hard Disk). None of this makes a difference. Virtual Box will still eventually eat all of my physical RAM when it is in use.
Like Terry said, if you have a genuine problem to report, then please open a ticket.
Honestly over the last few months I've spent so much time on your people's bugs, I'm seriously considering just switching to VMWare workstation and calling it a day. I tried to do this VM thing for free, but obviously it just isn't working out.
TerryE
Volunteer
Posts: 3572
Joined: 28. May 2008, 08:40
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS
Contact:

Post by TerryE »

Jay, Windows has a couple of tools which can help you diagnose this. Taskmanager has a View -> Select Columns option which allows you to get a better view of memory usage. As I said earlier, there is also the Perfmon utility which allows you to record the similar information and a lot of other performance counters. You have three options here: moving back to 2.0.6; helping to diagnose this issue; trying an alternative product such as VMware.

If you aren't happy with VirtualBox, then why not just switch to VMware. There is little value in threatening to.
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
jaylittle
Posts: 11
Joined: 5. Jan 2009, 20:07

Post by jaylittle »

Which columns would I show? On a 64 bit Vista host, I have never seen actual memory usage reflected in the VBoxSvc or VirtualBox processes within task manager regardless of what memory related columns are displayed.

Here is my host task manager with the related VBox processes and every memory related task manager column I could see displayed:

Image

Here is the Task manager from the Guest OS (32 bit XP) I was running:

Image

Now praytell, where is this memory usage supposed to be reflected on the host? Is this a 64 bit Vista Host thing? What exactly am I missing here?
TerryE
Volunteer
Posts: 3572
Joined: 28. May 2008, 08:40
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS
Contact:

Post by TerryE »

Hummn, your VMM process is the first in the list. This looks very typical. It doesn't look as if this is what it soaking memory. I wonder if this is a resource leak in the new Host network driver?
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
jaylittle
Posts: 11
Joined: 5. Jan 2009, 20:07

Post by jaylittle »

TerryE wrote:Hummn, your VMM process is the first in the list. This looks very typical. It doesn't look as if this is what it soaking memory. I wonder if this is a resource leak in the new Host network driver?
Perhaps. If it is then a similar issue exists in regards to the new NAT engine as switching to NAT seemed to make things even worse when I tried it a few days ago.
jaylittle
Posts: 11
Joined: 5. Jan 2009, 20:07

Post by jaylittle »

TerryE wrote:Hummn, your VMM process is the first in the list. This looks very typical. It doesn't look as if this is what it soaking memory. I wonder if this is a resource leak in the new Host network driver?
Is there a way to track the memory usage of this driver?
sandervl
Volunteer
Posts: 1064
Joined: 10. May 2007, 10:27
Primary OS: MS Windows Vista
VBox Version: PUEL
Guest OSses: Windows, Linux, Solaris

Post by sandervl »

I've just noticed a rapidly decreasing amount of available physical memory when using NAT in 2.1.0. This behaviour goes away when disabling the network adapter in the guest VM settings.

This memory doesn't appear to be assigned to any process, so the VirtualBox process itself is not leaking memory. It might be leaking kernel resources though (sockets perhaps).

Note that Vista's memory usage is quite notorious. It will cache so much file system data that you end up wondering where all your memory has gone.

Also note that the guest RAM, VRAM and additional virtualization memory is not assigned to the VM process. We still need to correct that.
TerryE
Volunteer
Posts: 3572
Joined: 28. May 2008, 08:40
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS
Contact:

Post by TerryE »

sandervl wrote:This memory doesn't appear to be assigned to any process, so the VirtualBox process itself is not leaking memory. It might be leaking kernel resources though (sockets perhaps) ... Note that Vista's memory usage is quite notorious. It will cache so much file system data that you end up wondering where all your memory has gone.
Sander, you and I seem to be thinking along the same lines. Almost every MS presentation I've been to when they announce a new OS, the key "functional enhancement" has been improved usability, stability and uptime compared the previous generation — until that is Vista came along. Well at least is has set a low bar for Windows 7 to jump over :lol:
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
jaylittle
Posts: 11
Joined: 5. Jan 2009, 20:07

Post by jaylittle »

So lets blame Vista, nice. VBox leaks memory like a sieve on a Windows x64 Vista platform. Using Host Networking and NAT. It's funny how you mentioned that Vista was/is noticeably worse than it's predecessor because I was just thinking the exact same thing about VirtualBox 2.1.0.

Nonetheless I solved my problem today. VMWare has a holiday special for VMWare workstation. You can get it for half price (94.50 USD) if you use the coupon code VMWHAPPYHOLIDAYS at checkout. This offer lasts until January 15th, 2009.

The most disturbing part about this process isn't the fact that VirtualBox on Vista hosts seems to get worse and worse with every new version. It is the fact that converting VDI images to something usable by another VM program that the world cares about is near impossible with converting them to raw images first (and hence using a lot of disk space if you have large images with a lot of unused space).

Why did you guys feel the need to use a proprietary image format? What good does it do? Why not use the compressed qcow format from the OSS product you forked? Why does your VBOXManage binary provide the capability to convert a VDI image into VMDK but fail miserably at producing a VMDK image that works in VMWare?

Nevermind. I think it's ironic though that at the end of the day, the free quasi-OSS product I was using suffers from a greater amount of Vendor Lock In than the pay product that I should've purchased to begin with. It took a truckload of wasted effort trying to convert those VDI images before I got the bright idea to use partimage to pull my Windows XP partitions off VBox and get them into VMWare.

Of course I couldn't use VBox to transfer the images over the network because doing so resulted in VBox eating up all of the physical memory on my host within 7 minutes. That is a massive memory leak. How 2.1.0 x64 got released into the public boggles my mind as a developer.

Thanks for your efforts, but no thanks.
Post Reply