VirtualBox

Ticket #7097 (closed defect: fixed)

Opened 4 years ago

Last modified 3 years ago

excessive memory allocated by VirtualBox on host

Reported by: costing Owned by:
Priority: critical Component: other
Version: VirtualBox 3.2.6 Keywords:
Cc: Guest type: Linux
Host type: Linux

Description

Host: Ubuntu 10.04, VirtualBox 3.2.6, 16 cores, 32GB

13 guests: single cores, several Linux flavors (RHEL5 clones, Ubuntu, 32 and 64 bit), all running GA 3.2.6

The problem is that the processes on the host are allocating up to 2x more memory than what is specified in the configuration. There is no correlation between the guest OS or 32/64bit. But also it doesn't seem to grow to more than exactly twice the guest size.

Below is the "top" line for a machine that has 2GB allocated:

PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+ COMMAND
8698 vms       20   0 4349m 4.0g 4.0g S   33 12.8 938:31.41 VBoxHeadless

I still have a couple of servers running VB 3.0 and by comparison their memory allocation is very close to what is defined in the guest configuration (RES part of course). And SHR is close to zero there.

The worst part is that while the sum of the guests' memory allocations is quite far from the server's physical memory, the processes allocate in fact so much more that they are killed by the kernel with out of memory messages in dmesg... There is nothing funny in the VB logs, but I can attach them if needed.

I first noticed this after upgrading to 3.2.6, previous 3.2.x didn't cause any noticeable problems, but I can't guarantee that the problem was not present even then.

Attachments

VBox.log Download (61.9 KB) - added by costing 4 years ago.
2GB configured, 4GB used on host

Change History

comment:1 Changed 4 years ago by frank

Please attach a VBox.log file of one at least of these VMs. I assume that the configuration of all of your VMs is more or less the same, correct?

Changed 4 years ago by costing

2GB configured, 4GB used on host

comment:2 Changed 4 years ago by costing

I've attached the log for the same process ID (8698). Since yesterday it is flat at exactly the same values in the original report, exactly double the amount of ram requested.

comment:3 in reply to: ↑ description Changed 4 years ago by wschan

I'm not sure if the problem I am having is related to this one. For my case, the memory allocation grows only when the VM is connected with a remote desktop client. Once the remote desktop connection closes, the memory allocation will stop growing.

comment:4 Changed 4 years ago by costing

I'm not using remote desktop at all. The guests do not even have graphics mode but are only accessed by ssh, so I don't think it's related to rdc.

comment:5 Changed 4 years ago by costing

Looking again at the server, a couple of virtual machines went above the 2x threshold, one in particular is at 5.6GB (both RSS and Virtual), while its setting is 2GB. Another similar one is "only" at 5GB... What's going on guys? My host is dying now ...

comment:6 Changed 4 years ago by frank

Sorry, but I have absolutely no idea. It could be one of your VM-related settings which triggers this memory leak so as a first step you could try disabling devices which you don't need.

comment:7 Changed 4 years ago by faulebutter

I experience the same problem with VB 3.2.8 PUEL on F13 host with heavy network load (VMDK on an NFS share and VRDP session with video running). The VM gets killed by kernel due to memory overallocation. (I've also posted this on forums:  http://forums.virtualbox.org/viewtopic.php?f=7&t=34702&p=155557#p155557).

comment:8 Changed 4 years ago by frank

This problem might be addressed with the next maintenance release, please check when 3.2.10 is out (will take some more time).

comment:9 Changed 4 years ago by shaibn

I'm using v3.2.10 r66523 and am having the same issue.

comment:10 Changed 3 years ago by koma77

I'm having this problem with 3.2.10, linux host + linux guest, and I have a great way to reproduce the issue.

Just install (for example) Ubuntu 10.10 as a guest OS. Then, in the guest, install sun Java and Freenet. Start up freenet and wait a couple of hours. The memory on host will be consumed by virtualbox rahter quickly.

I have even tried this procedure without installing the guest additions, and the problem is still there, so maybe that means that guest additions do not cause this issue.

If you want to watch the memory disappear, cd into /proc/'virtualbox pid' and run:

cat maps | gawk --non-decimal-data 'BEGIN {FS="[- ]"; tot = 0} {tot += ("0x"$2 ) - ("0x"$1 )} END {print tot}'

That sums up the different memory mappings done by virtualbox. Run it a couple of times and you will see the never ending increase. Now, I know that a memorymapping is not the same as allocated memory, but it seems to correlate anyway.

I don't know what Freenet does that triggers this so badly. Maybe it is the frequent net access. Maybe the disk access. Or maybe it is Java that does something strange.

Anyway, since this can potentially make VirtualBox unusable, I guess someone who knows how to debug VirtualBox memory allocations can help out.

comment:11 follow-up: ↓ 12 Changed 3 years ago by frank

koma77, you didn't attach a log file, is NAT networking involved? In that case it might be a duplicate of #6918.

comment:12 in reply to: ↑ 11 Changed 3 years ago by koma77

Replying to frank:

koma77, you didn't attach a log file, is NAT networking involved? In that case it might be a duplicate of #6918.

Hmm, indeed I use NAT. I'll test without NAT! Thanks for the advice.

comment:13 Changed 3 years ago by koma77

Just for the record: I was indeed hit by bug #6918. Using bridged mode solved my problem.

comment:14 Changed 3 years ago by frank

  • Status changed from new to closed
  • Resolution set to fixed

Please reopen if still relevant with VBox 3.2.12. The NAT memory leak was definitely fixed.

Note: See TracTickets for help on using tickets.

www.oracle.com
ContactPrivacy policyTerms of Use