Bug 197884

Summary: System with zfs freezes if emulators/virtualbox-ose got all ram
Product: Ports & Packages Reporter: Vladimir Druzenko <vvd>
Component: Individual Port(s)Assignee: Virtualbox Team (Nobody) <vbox>
Status: Closed Overcome By Events    
Severity: Affects Only Me CC: hmbright, vsasjason, vvd, w.schwarzenfeld
Priority: --- Flags: bugzilla: maintainer-feedback? (vbox)
Version: Latest   
Hardware: amd64   
OS: Any   

Description Vladimir Druzenko freebsd_committer freebsd_triage 2015-02-21 22:42:08 UTC
10.1-p5 amd64, VirtualBox 4.3.12, 4.3.22, root on ZFS, virtual machines on ZFS.
Core 2 Quad Q6600, 8Gb RAM.
/boot/loader.conf have lines: 
vfs.zfs.arc_min="67108864"
vfs.zfs.arc_max="268435456"
vfs.zfs.prefetch_disable="1"

Run only 1 VM with different amount of RAM: 6.5Gb or 7Gb. VM is very active using RAM.

If 7Gb: after few days (hours?) after run rebuilding of any port, system freezes. Host replaying on ping (guest don't replay), but screen is black and no response on ssh console.
Command "VBoxManage controlvm VMNAME savestate" freezes system too.
Command top show "ARC: xxxM Total" with xxx < 256Mb (~160-230). Swap is used on ~50-100Mb. Free 10-50Mb.

If 6.5Gb: all work fine after many weeks - ports rebuilding are work without freezes, savestate and startvm work correctly too.
Command top show "ARC: xxxM Total" with xxx = 256Mb. Swap is used on ~0-50Mb. Free ~200Mb.

Few times got same freezes on other hosts: Core i7 920 24Gb RAM with ~10-15 started VMs (RAM usage was near 23Gb).

Didn't tested with UFS.

P.S. Sorry for my English.
Comment 1 Bugzilla Automation freebsd_committer freebsd_triage 2015-02-21 22:42:08 UTC
Auto-assigned to maintainer vbox@FreeBSD.org
Comment 2 Vladimir Druzenko freebsd_committer freebsd_triage 2015-02-21 22:45:38 UTC
Kernel GENERIC from freebsd-update.
VirtualBox builded from ports.

Bag is repeatable 100%.
Comment 3 don bright 2016-10-07 20:45:42 UTC
I have been experiencing a similar problem.

I am trying to compile OpenSCAD master git (http://www.openscad.org) on FreeBSD 10.3 p9 and/or freebsd 11.0 (it wont work with earlier patchlevels, link error) on various hosting providers and the system is completely locking during the build.

I have tried cariibou and digitialocean. 
I have tried both clang and gcc.

The problem at first was that it ran out of swap space. OpenSCAD uses CGAL which is an extremely large c++ template library, so builds can use more than 1 gigabyte of RAM sometimes. 

So I created a swapfile per the freebsd manual , and re-ran the compile. I had 'top' running in another window so I could monitor RAM usage. 

Even with Swap only at about 20% in use, the system still freezes during compilation. Like vvd, I can ping the machine, but otherwise it is completely unresponsive. I cannot ssh, I cannot 'ctrl-c' the build, etc. I have to do a hard shutdown from the hosting provider console. 

Sometime it freezes during the building of the openscad gui, sometimes it freezes when building the 'test suite' (cd tests ; cmake . ; make ) 

For a comparison, I can build OpenSCAD on FreeBSD inside a QEMU/KVM on my little laptop and there are no problems. 

Thanks for reading.
Comment 4 Vladimir Druzenko freebsd_committer freebsd_triage 2016-10-08 02:49:13 UTC
don bright, not same.
I have troubles on host with FreeBSD (with any host OS-es), but you on guest with FreeBSD.
Comment 5 Walter Schwarzenfeld freebsd_triage 2018-01-17 07:42:59 UTC
We have version 5.2.6. Is this still a problem?
Comment 6 Vladimir Druzenko freebsd_committer freebsd_triage 2018-01-17 18:11:35 UTC
(In reply to w.schwarzenfeld from comment #5)
> We have version 5.2.6. Is this still a problem?

Can't test yet - 5.2.6 can't start saved state of VM from 5.2.4:
> Waiting for VM "6a71cca4-c720-4939-b526-fc7227fb2998" to power on...
> VBoxManage: error: ich9pci#0: Device in slot 0xc0 has been removed! vendor=0x8086 device=0x2448 [ver=3 pass=final] (VERR_SSM_LOAD_CONFIG_MISMATCH)
> VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component ConsoleWrap, interface IConsole
But 5.2.4 can start saved sate of VM from 5.0.x and 5.1.x.
Comment 7 Vladimir Druzenko freebsd_committer freebsd_triage 2018-01-17 21:34:08 UTC
> Resolution: --- → Overcome By Events
What?
Comment 8 Walter Schwarzenfeld freebsd_triage 2018-01-17 21:40:40 UTC
Sorry!
Comment 9 Vladimir Druzenko freebsd_committer freebsd_triage 2020-01-27 10:41:31 UTC
Last year I got same situation (12.0/12.1 ams64 low memory + virtualbox + zfs) several times, but it never freezes. It was very slow, but still responsive, and after stopping one of VM it become fast again.
So close it.