Ticket #6045 (closed enhancement: fixed)
Double caching degrades performance
|Reported by:||theraven||Owned by:|
|Host type:||Mac OS X|
VirtualBox does not appear to be setting the F_NOCACHE fcntl() on virtual disk images. This means that every read by the guest results in memory used in the disk cache in the host. The guest OS is also caching the read data in its disk cache, so counting the copy given to the userspace program, you are using 12KB of RAM for each 4KB disk read. This makes resource allocation hard (a guest given 512MB of RAM on the host may also use another 512MB of kernel RAM for disk caching), gives no performance gain for the guest (because the guest is caching the disk access anyway, and there are very few occasions when the VM's cache is missed but the host OS's cache is hit), and seriously degrades performance of other apps by causing them to be swapped out in preference to pages mapped from the guest's disk image, which are not being accessed.