Opened 9 years ago
Closed 9 years ago
#14850 closed defect (invalid)
Memory Leak on 5.0.10 r104061
Reported by: | GRRivLar | Owned by: | |
---|---|---|---|
Component: | other | Version: | VirtualBox 5.0.10 |
Keywords: | memory leak, linux guest, windows host | Cc: | |
Guest type: | Linux | Host type: | Windows |
Description
I've created a linux VM (Ubuntu 15) in 5.0.8 it had no problems. Upgraded to 5.0.10 and all of a sudden this particular VM started to eat out all RAM (using up to 90% out of 16GB host). If I go back to 5.0.8 the memory leak won't act up. I've checked out the problem (which is been reported several times before) and discarded driver problems, update problems, I/O problems and "ReadyBoost" problems. It's been narrowed down to VirtualBox, this particular VM, and it can be reproduced if in this VM you run any process that make heavy I/O use (creating a database or encrypting a drive), that will eat the RAM away.
CONSIDERATION: This VM is HEAVILY encrypted as is being tested for data encryption performance. It simulates RAID0 on four different VDI files, each with a different VBox password, and is using internal linux file encryption, this guarantees heavy I/O disk usage.
Host: Windows 8.1 64 bit, 16GB RAM, Intel i5 Guest: Lubuntu 15.10 32 bit, 8GB RAM, 1 CPU Accel: VT-x/AMD-V, Nested paging, PAE/NX, KVM paravirtualization VRAM: 8MB Remote: disabled V-Cap: disabled Storage: 4 VDI files AES-XTS256-PLAIN64 encryption Sound: host directsound ICH AC97 Network: NAT IntelPro/1000MT USB: OHCI, EHCI Shared folders Bidirectional Clipboard
Attachments (5)
Change History (11)
by , 9 years ago
Attachment: | OuterBuntu-2015-11-17-04-14-49.log added |
---|
comment:1 by , 9 years ago
Unable to reproduce. We tried this on several systems. How do you measure the memory consumption of the VirtualBox process?
It is normal that the VirtualBox process increases the memory consumption when you do heavy disk I/O. The guest memory is allocated lazy (when needed) up to the amount of the configured value (8GB in your case). Once allocated the memory is permanently assigned to the VM process. When the guest does heavy disk I/O, memory is allocated for disk buffers. Therefore it is completely normal if the memory consumption increases from a few hundred MBs to ~9.5GB in your case (8GB for guest memory, ~1.5GB overhead for VM maintenance like guest page tables). At the same time, the Windows host will allocate memory for disk buffers.
Also (probably unrelated), why do you disable VT-x for this VM? In your description you say that VT-x/AMD-V + nested paging is enabled but this is actually not true according the log files you provided.
comment:2 by , 9 years ago
I've added a screenshot of the VM configuration, VT-x is enabled, although I did disable/re-enable it and other flags to see if I could solve this issue myself, to no avail.
Using host built-in task manager, I could see RAM being eaten up (I will later upload a screenshot of this to back the claim up). Even if I powered VM off, RAM would still NOT be released until I closed all VirtualBox processes (manager and VMs). I did expect the VM to use about 9GB of memory, yet it claimed about 14GB, way above the RAM specs. Yet the lazy allocation DOES work well, if VM is idle or not using that many I/O processes, VM would use about 50%~80% allowed RAM (4~6GB) tops usually would not even go about 1GB itself.
This can't be reproduced on v5.0.8
comment:3 by , 9 years ago
Waiting for the screenshot which should show how the memory is assigned to the VirtualBox processes.
comment:4 by , 9 years ago
Added screenshots and log. Placed VM before, during and after using memory. At some point the VM reaches its cap and stays stable, then it starts using extra amount for VDI - this is where the leak occurs. Lazy mode won't use RAM until I/O starts.
Gonna try to take same screenshots using 5.0.8 to show it remains stable.
Also, I realized this usage occurs ONLY when using files contained in the VDI's - if I mount a HOST shared folder and work the data there, RAM will not be used.
comment:5 by , 9 years ago
Which one of the pictures you posted shows the memory leak? Having a look at 013vbmlHostramCAPdown.jpg. I assume you took this picture when you just terminated the VM and the left side of the picture shows the RAM consumption in the past (before you terminated the VM, about 7x1.6GB = 11.2GB) and the right side shows the current RAM consumption (VM is terminated, a little bit below 3GB, perhaps 2.9GB as printed below). 11.2GB-2.9GB = 8.3GB, that would be completely normal for a VM with 8GB guest RAM.
Regarding shared folders: Shared folders are not a normal file system. The caching is different, ie it doesn't use the file system cache of the guest properly (something which should be fixed eventually). Therefore comparing the memory consumption of a guest using shared folders with another test when using the guest local file system is like comparing apples and oranges.
To get better test results I suggest you to do the following:
VBoxManage setextradata OuterBuntu VBoxInternal/RamPreAlloc 1
This will disable the lazy memory allocation. Starting your guest will take a bit longer but it will allocate the guest memory immediately. The memory consumption of the host might still increase over the time but this will be caching effects on the host.
comment:6 by , 9 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
VBox Log File