VirtualBox

Opened 11 days ago

Last modified 10 days ago

#22056 new defect

Disk access in guest causes severe memory leak in host

Reported by: snowflake Owned by:
Component: virtual disk Version: VirtualBox-7.0.14
Keywords: Cc:
Guest type: BSD Host type: Mac OS X

Description

Host is macOS Sonoma 14.4.1 with 32 GB memory and Intel processor. Guest is FreeBSD 15.0 with 8 GB memory.

I've noticed for many months now that, when building FreeBSD from source, the memory usage for VirtualBoxVM process steadily increases from 8 GB to more than 25 GB. Sometimes it exceeds the physical memory on the host.

Disable the network cards on the guest and boot it up.

Monitor the host memory usage with top or ps

How to repeat on the guest by running this command:

dd if=/dev/random of=bigfile bs=1024 count=5000000

This is designed to write a 5 GB file as inefficiently as possible to simulate building large source trees. Wait about 5 minutes for it to complete.

When I ran the test the results were 9277 MB at the beginning and 14737 MB at the end.

It may be that VBox 7.0.16 may have fixed this leak, but I'm reluctant to test it due to the warning about crashes.

Attachments (1)

VBox.log (204.8 KB ) - added by snowflake 11 days ago.
log file

Download all attachments as: .zip

Change History (3)

by snowflake, 11 days ago

Attachment: VBox.log added

log file

comment:1 by Klaus Espenlaub, 11 days ago

For this VM the update would be super safe because it has no network adapter. Just saying (having a network adapter configured with 'NAT' would also work without crashes). Not that I have much reason to believe that the leak you're observing is fixed with 7.0.16.

virtio-scsi is the newest (and therefore least tested) storage controller. Especially with more rare OSes...

comment:2 by snowflake, 10 days ago

I have a collection of several VMs I can test.

First one is SMP Debian 5.10.178-3 (2023-04-22) x86_64 GNU/Linux. This is installed from an official CDROM.

It only has 6 GB of disk. Controller is SATA AHCi.

I first tested:

ls -laR /

It should give a listing of all files on the disk. However there was no output and I could not reset or power off the VM. I had to use "Force Quit" from macOS.

The next test was:

dd if=/dev/sda1 of=/dev/null bs=4096 count=5000000 

The test completed in 10 seconds and the memory increased by 6 GB. However, it appears to be using the memory as a buffer cache, as a second run showed no increase.

The third test was:

find / -type f

The system hung with spinning beach ball and there was no output. top on the host showed the memory was increasing at a rate of 1 MB/sec.

It's all a bit of a mystery. :-)

Note: See TracTickets for help on using tickets.

© 2023 Oracle
ContactPrivacy policyTerms of Use