VirtualBox using all hosts physical RAM

Discussions related to using VirtualBox on Linux hosts.
Virtualizateron
Posts: 10
Joined: 21. Nov 2017, 16:28

VirtualBox using all hosts physical RAM

Post by Virtualizateron »

Hi there,

Whenever I leave the guest running, VIrtualbox in the host consumes more and more RAM (as measured by top) until over around 12 hours, the hosts physical RAM (8 gig) runs out and the swap file grows gigabytes large and the whole host system slows to a crawl.

Meanwhile, the ram usage reported by the guest OS remains relatively low (around 1 gig)

The guest OS is only running Nginx / PHP to manage an install of Nextcloud, however it's only used by one user (me). It's usually running KDE, but no apps X apps.

Shutting down and restarting the guest resets the memory usage and everything runs fine again for a while until the ram usage creeps up again.

Is there any info I can provide to help track down the issue?

Tech specs:

VirtualBox version:
5.1.30_Ubuntu r118389

Host:
Kubuntu 17.10 64 bit 8gig ram
RAM: 8gig;

Guest:
Debian 8.9 - 64 bit
Kernel: x86_64 3.16.0-4-amd64
Ram: 4988mb
CPU: AMD FX-8120 Eight-core @ 3.11Ghz
No guest extensions installed
Attachments
Debian-2017-11-21-10-48-56.zip
(27.6 KiB) Downloaded 27 times
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: VirtualBox using all hosts physical RAM

Post by Perryg »

I have not seen a memory leak like this for a long time. But you are not using the official version of VirtualBox. Yours is the distros version. So the choices for you is to ask them or remove theirs and install the one from virtualbox.org.
Virtualizateron
Posts: 10
Joined: 21. Nov 2017, 16:28

Re: VirtualBox using all hosts physical RAM

Post by Virtualizateron »

Ok, thanks for the response. I've actually been having this issue since I started with VB about 2 years ago. I'm fine with installing the version from virtualbox dot org, but the latest package for Ubuntu on the download page is for 16.04 while I'm on 16.10. Should that package still work OK?
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: VirtualBox using all hosts physical RAM

Post by Perryg »

https://www.virtualbox.org/wiki/Linux_Downloads

It has exactly what you want.

Code: Select all

Ubuntu 17.04 ("Zesty")  i386 |  AMD64
Ubuntu 16.10 ("Yakkety")  i386 |  AMD64
Ubuntu 16.04 ("Xenial")  i386 |  AMD64
Ubuntu 14.04 ("Trusty") / 14.10 ("Utopic") / 15.04 ("Vivid")  i386 |  AMD64 
Virtualizateron
Posts: 10
Joined: 21. Nov 2017, 16:28

Re: VirtualBox using all hosts physical RAM

Post by Virtualizateron »

So, you're saying the 17.04 "Zesty" release will still work fine with Ubuntu 17.10 Artful Aardvaark?
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: VirtualBox using all hosts physical RAM

Post by Perryg »

Hummm,
Your previous post:
Ubuntu on the download page is for 16.04 while I'm on 16.10 must have been a typo, but yes the 17.04 should work with 17.10.
Virtualizateron
Posts: 10
Joined: 21. Nov 2017, 16:28

Re: VirtualBox using all hosts physical RAM

Post by Virtualizateron »

Ok, thanks. Sorry for any confusion caused by that typo!
Virtualizateron
Posts: 10
Joined: 21. Nov 2017, 16:28

Re: VirtualBox using all hosts physical RAM

Post by Virtualizateron »

So I installed the version from the download page, but now on trying to run the VM and just getting the message:
The VirtualBox kernel modules do not match this version of VirtualBox. The installation of VirtualBox was apparently not successful. Executing

'/sbin/vboxconfig'

may correct this. Make sure that you do not mix the OSE version and the PUEL version of VirtualBox.

where: supR3HardenedMainInitRuntime what: 4 VERR_VM_DRIVER_VERSION_MISMATCH (-1912) - The installed support driver doesn't match the version of the user.
I ran the command with sudo, but I still get the message. I gather that this is because I installed the VM on the OSE version, and now I have the PUEL version installed. If one can't run VM's made in the other, then what was the point of installing the PUEL version? Am I missing something?
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: VirtualBox using all hosts physical RAM

Post by socratis »

The thing is that you got to make sure that the OSE is completely removed before you install the PUEL. You can't mix the two of them or their components.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Virtualizateron
Posts: 10
Joined: 21. Nov 2017, 16:28

Re: VirtualBox using all hosts physical RAM

Post by Virtualizateron »

So, I got the PUEL version up and running, but... I still get the same problem of the memory usage creeping up and up in the host while the guest memory usage stays low.

Time to file a bug report?
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: VirtualBox using all hosts physical RAM

Post by Perryg »

We need a new guest log file ( as an attachment ) and some indication of what exactly is using the memory in this fashion on the host.
Virtualizateron
Posts: 10
Joined: 21. Nov 2017, 16:28

Re: VirtualBox using all hosts physical RAM

Post by Virtualizateron »

OK, here's the guest log in a .tar.gz. I'm not exactly sure what you mean by "some indication of what exactly is using the memory". It's the process titled "VirtualBox" at /usr/lib/virtualbox/VirtualBox and the large amount of ram it's using is listed under the "shared memory" section. Is there further information I could provide that would help?
Attachments
VBox.guest.tar.gz
Log from VM using around 6gb of RAM before I shut it down
(35.5 KiB) Downloaded 22 times
Virtualizateron
Posts: 10
Joined: 21. Nov 2017, 16:28

Re: VirtualBox using all hosts physical RAM

Post by Virtualizateron »

OK, so I found the "detailed memory information" option in the system monitor app. Here's what it gave me, when VirtualBox was using 4.2GiB:

Code: Select all

4220960 KB	/dev/zero (deleted)
151488 KB	[heap]
356 KB	/usr/lib/virtualbox/VBoxVMM.so
264 KB	/usr/lib/virtualbox/VBoxDD.so
136 KB	/usr/lib/virtualbox/components/VBoxC.so
136 KB	/usr/lib/virtualbox/VBoxRT.so
56 KB	/usr/lib/virtualbox/VBoxDDU.so
44 KB	/memfd:pulseaudio (deleted)
40 KB	/usr/lib/virtualbox/VBoxXPCOM.so
40 KB	/usr/lib/virtualbox/VirtualBox.so
32 KB	/usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.9.5
28 KB	/usr/lib/x86_64-linux-gnu/libQt5XcbQpa.so.5.9.5
24 KB	/usr/lib/x86_64-linux-gnu/libQt5Core.so.5.9.5
20 KB	/usr/lib/x86_64-linux-gnu/libQt5Gui.so.5.9.5
12 KB	/usr/lib/virtualbox/components/VBoxXPCOMIPCC.so
12 KB	/usr/lib/x86_64-linux-gnu/qt5/plugins/styles/breeze.so
12 KB	/usr/lib/x86_64-linux-gnu/libKF5XmlGui.so.5.44.0
12 KB	/lib/x86_64-linux-gnu/libc-2.27.so
8 KB	/usr/lib/virtualbox/VBoxGuestControlSvc.so
8 KB	/usr/lib/virtualbox/VBoxDragAndDropSvc.so
8 KB	/usr/lib/x86_64-linux-gnu/pulseaudio/libpulsecommon-11.1.so
8 KB	/usr/lib/x86_64-linux-gnu/libpulse.so.0.20.2
8 KB	/usr/lib/x86_64-linux-gnu/qt5/plugins/xcbglintegrations/libqxcb-glx-integration.so
8 KB	/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.5600.1
8 KB	/lib/x86_64-linux-gnu/libpthread-2.27.so
8 KB	/lib/x86_64-linux-gnu/ld-2.27.so
8 KB	[stack]
4 KB	/[aio] (deleted)
4 KB	/usr/lib/x86_64-linux-gnu/qt5/plugins/platformthemes/KDEPlasmaPlatformTheme.so
4 KB	/usr/lib/x86_64-linux-gnu/libX11.so.6.3.0
4 KB	/usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0
4 KB	/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.25
You can see the impact on my ram usage and CPU usage when I shut the VM down in the image attached (even though it was essentially idling without doing anything at the time):
So... Any ideas?
Attachments
screenshot.jpg
screenshot.jpg (118.86 KiB) Viewed 3667 times
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: VirtualBox using all hosts physical RAM

Post by mpack »

In case it wasn't already clear above: if you want support for the Ubuntu fork of VirtualBox (which is what you are using), then please go to the Ubuntu forums.

This site only supports VirtualBox, not the tribute band versions.
Virtualizateron
Posts: 10
Joined: 21. Nov 2017, 16:28

Re: VirtualBox using all hosts physical RAM

Post by Virtualizateron »

mpack wrote:This site only supports VirtualBox, not the tribute band versions.
I *am* trying to use the Oracle version, not the Ubuntu version:
Virtualizateron wrote:So, I got the PUEL version up and running, but... I still get the same problem of the memory usage creeping up and up in the host while the guest memory usage stays low.
Just to be certain though, I once again ran sudo apt remove virtualbox* and then downloaded and installed the deb from https://www.virtualbox.org/wiki/Linux_Downloads. I've attached a screenshot of the Help > About screen. As I mentioned before, despite doing this, I'm still seeing the shared usage of Virtualbox creep up over time.

Is there something else I need to do, to be using the Oracle version?

If not, here's the memory breakdown, once again with /dev/zero appearing to be the source/symptom of the problem:
Private
hide
5302172 KB	/dev/zero (deleted)
25368 KB	[heap]
564 KB	/usr/lib/virtualbox/VBoxVMM.so
244 KB	/usr/lib/virtualbox/VBoxDD.so
176 KB	/usr/lib/virtualbox/VBoxRT.so
132 KB	/usr/lib/virtualbox/components/VBoxC.so
60 KB	/usr/lib/virtualbox/VBoxDDU.so
44 KB	/usr/lib/virtualbox/VirtualBox.so
40 KB	/usr/lib/virtualbox/VBoxXPCOM.so
32 KB	/usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.9.5
28 KB	/usr/lib/x86_64-linux-gnu/libQt5XcbQpa.so.5.9.5
24 KB	/usr/lib/x86_64-linux-gnu/libQt5Core.so.5.9.5
20 KB	/usr/lib/x86_64-linux-gnu/libQt5Gui.so.5.9.5
12 KB	/usr/lib/virtualbox/components/VBoxXPCOMIPCC.so
12 KB	/usr/lib/x86_64-linux-gnu/qt5/plugins/styles/breeze.so
12 KB	/usr/lib/x86_64-linux-gnu/libKF5XmlGui.so.5.44.0
12 KB	/lib/x86_64-linux-gnu/libc-2.27.so
8 KB	/usr/lib/x86_64-linux-gnu/pulseaudio/libpulsecommon-11.1.so
8 KB	/usr/lib/x86_64-linux-gnu/libpulse.so.0.20.2
8 KB	/usr/lib/x86_64-linux-gnu/qt5/plugins/xcbglintegrations/libqxcb-glx-integration.so
8 KB	/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.5600.1
8 KB	/lib/x86_64-linux-gnu/libpthread-2.27.so
8 KB	/lib/x86_64-linux-gnu/ld-2.27.so
8 KB	[stack]
4 KB	/usr/lib/virtualbox/VBoxREM.so
4 KB	/[aio] (deleted)
4 KB	/usr/lib/x86_64-linux-gnu/qt5/plugins/platformthemes/KDEPlasmaPlatformTheme.so
4 KB	/usr/lib/x86_64-linux-gnu/libX11.so.6.3.0
4 KB	/usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0
4 KB	/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.25
Attachments
virtualbox.jpg
virtualbox.jpg (68.1 KiB) Viewed 3621 times
Last edited by socratis on 7. Aug 2018, 08:54, edited 1 time in total.
Reason: Enclosed the information in [pre] tag for better readability
Post Reply