VirtualBox

Opened 11 years ago

Last modified 4 years ago

#12279 reopened defect

Memory leak: VBoxService.exe slowly eats up RAM

Reported by: maxchen Owned by:
Component: other Version: VirtualBox 4.3.0
Keywords: Memory leak Cc:
Guest type: Windows Host type: Linux

Description

version 4.3 host: Ubuntu 10.04 x64 guest: windows xp sp3 with VB addition ver 4.3, running in headless

the VBoxService.exe starts leaking memory once the VM is login through remote desktop (mstsc, not vrdp). If the VM is not running in headless mode, no leaking.

the fixed in https://www.virtualbox.org/ticket/12072 seems not working here this ticket is https://www.virtualbox.org/ticket/10970 , however, seems yet to be fixed.

Attachments (1)

VBox.log (60.0 KB ) - added by maxchen 11 years ago.

Download all attachments as: .zip

Change History (28)

by maxchen, 11 years ago

Attachment: VBox.log added

comment:1 by maxchen, 11 years ago

if you can access my vm through IPv6, by first ping6 xm.us.to on linux or ping xm.us.to on windows then I will provide you an account to login

comment:2 by maxchen, 11 years ago

I've installed a brand new XP English sp3 (under VB4.3 with 4.3 addin), running in headless mode, mstsc remote login through internet. This new XP vm also leaking, at 1MiB per hour. It seems that the leaking speed is faster than before (1MiB every 2hours)

comment:3 by pentagonik, 11 years ago

Could you please look up the file version information of the file "Wtsapi32.dll" on the guest where this leak is happening? Also, did you apply all latest updates to the guest, e.g. did you already run Windows Update on it?

Please also note that the initial fix only is available in the next upcoming 4.2 maintenance version. 4.2.18 does *not* include the fix.

comment:4 by maxchen, 11 years ago

file version information of the file "Wtsapi32.dll": 5.1.2600.5512 (xpsp.080413-2111)

no, the Windows Update is disable as soon as the system is installed and first boot up

It is VirtualBox 4.3, not 4.2 series

comment:5 by maxchen, 11 years ago

OH! VBoxTray.exe is leaking too!

c:\usr\gg>net statistics workstation | find "since"
Statistics since 11/1/2013 10:42 AM
c:\usr\gg>tasklist
Image Name                   PID Session Name     Session#    Mem Usage
========================= ====== ================ ======== ============
System Idle Process            0 RDP-Tcp#6               0         28 K
System                         4 RDP-Tcp#6               0        236 K
smss.exe                     272 RDP-Tcp#6               0        392 K
csrss.exe                    400 RDP-Tcp#6               0      4,528 K
winlogon.exe                 424 RDP-Tcp#6               0      5,192 K
services.exe                 468 RDP-Tcp#6               0      3,240 K
lsass.exe                    480 RDP-Tcp#6               0      5,848 K
VBoxService.exe              632 RDP-Tcp#6               0     11,408 K
svchost.exe                  676 RDP-Tcp#6               0      5,620 K
svchost.exe                  740 RDP-Tcp#6               0      4,192 K
svchost.exe                  804 RDP-Tcp#6               0     19,568 K
svchost.exe                  844 RDP-Tcp#6               0      3,484 K
svchost.exe                  888 RDP-Tcp#6               0      4,376 K
spoolsv.exe                 1088 RDP-Tcp#6               0      4,488 K
alg.exe                     1488 RDP-Tcp#6               0      3,560 K
csrss.exe                    348 Console                 2      2,908 K
winlogon.exe                 372 Console                 2      5,588 K
rdpclip.exe                  972 RDP-Tcp#6               0      4,088 K
explorer.exe                1324 RDP-Tcp#6               0     22,492 K
VBoxTray.exe                 736 RDP-Tcp#6               0     12,700 K
taskmgr.exe                 1984 RDP-Tcp#6               0      1,788 K
notepad.exe                  340 RDP-Tcp#6               0      3,660 K
logon.scr                   2068 Console                 2      1,760 K
cmd.exe                    27284 RDP-Tcp#6               0      2,916 K
wmiprvse.exe               27268 RDP-Tcp#6               0      6,020 K
tasklist.exe               27836 RDP-Tcp#6               0      4,292 K
Last edited 10 years ago by Frank Mehnert (previous) (diff)

comment:6 by pentagonik, 11 years ago

Could you please run Windows Update to update the guest OS? For that to try out you can first make a snapshot and re-run your tests again. I have the suspicion that you're running with an unpatched "Wtsapi32.dll" file, which causes the leak. After performing the update, can you please re-post the new version number of "Wtsapi32.dll"? Thanks!

comment:7 by maxchen, 11 years ago

I like to share my latest try

  1. for the clean xp sp3 installation (I install it fresh again), not able to do a windows update, the update redirect to help page of microsoft
  1. on the xp sp3 guest os, if run on GUI (thr VB interface, not headless), the VBoxService.exe use constant RAMs, however, every a few seconds, VBoxTray.exe eat 4KiB rams (hope somebody can replicate this, I upgrade VB to 4.3.2 and the addition to guest xp also 4.3.2)
  1. for the headless mode, I completely remove the additions. Then there is no problem of VBoxService.exe and VBoxTray.exe . Since I only access them by remote desktop, the ADDITION doest not give any help, but ask me to restart the vm every week, otherwise, they eat up the RAM and the VMs hang up. The memory leak have been lating for more than 15 months, now I am free of this leaking by remove the addition on the headless VMs.
Last edited 10 years ago by Frank Mehnert (previous) (diff)

comment:8 by Frank Mehnert, 10 years ago

Confirmed that VBoxTray.exe 4.3.6 leaks handles.

comment:9 by Fox7, 10 years ago

Confirmed that VBoxTray.exe 4.3.6 leaks memory (~ 4KB in minute, VBoxTray.exe 4.3.0 no memory leaks) Host: CentOS 6.4 Guest: Windows Server 2008 R2 Enterprise SP1

Last edited 10 years ago by Fox7 (previous) (diff)

comment:10 by Frank Mehnert, 10 years ago

Could you confirm that the leak is fixed in this build?

comment:11 by Fox7, 10 years ago

Can i install VBoxGuestAdditions_4.3.7-91532.iso on VirtualBox_4.3.6-91406 ?

comment:12 by Frank Mehnert, 10 years ago

Yes, you can. Install the Guest Additions in the guest. The guest with these 4.3.7 Additions will run fine on VirtualBox 4.3.6.

comment:13 by Fox7, 10 years ago

Ok, no memory leaks.

comment:14 by Michael, 10 years ago

Still leaking in VBox 4.3.14.

comment:15 by grazvi, 10 years ago

Same here VBox 4.3.14! Using Win7 as host Debian as guest. The guest seams still to see the lost memory and shows as free but the host remain always full once all allocated memory is used by guest. So after releasing memory in guest the host still shows all memory is in use.

Last edited 10 years ago by grazvi (previous) (diff)

comment:16 by Frank Mehnert, 10 years ago

Could you provide some numbers? How did you measure the memory consumption of VBoxService?

comment:17 by Michael, 10 years ago

I am looking at Task Manager. After 3 days of system uptime VBoxService.exe is using 49MB.

The process is consuming 4kb of memory approximately every 30 seconds. Here are three screenshots taken 30 seconds apart.

http://i.imgur.com/MyhVn3e.png

http://i.imgur.com/cJwkGLy.png

http://i.imgur.com/C7u4GeF.png

By the time I finished writing this message VBoxService is now consuming 49,324 K and climbing. Yes, the 4.3.14 additions are installed.

comment:18 by sunlover, 10 years ago

mooninite, which guest exactly is that? Windows version and is it 32 or 64 bit.

Does it leak memory when you connect to the guest via RDP (as the original reporter) or also when you run the guest in VirtualBox GUI?

It would be interesting to know if disabling vm statistics service helps:

  • start regedit and open HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\VBoxService
  • edit the ImagePath value and add " --disable-vminfo", i.e. it will be something like:

"system32\VBoxService.exe --disable-vminfo"

  • reboot the guest
  • check if VBoxService still leaks memory

Thanks.

comment:19 by Michael, 10 years ago

It is Windows XP Pro, SP3, 32-bit

The VM is being run headless. I have logged in via both the system's RDP and VRDP.

I just applied the registry change and rebooted the VM. The memory usage is now remaining constant, but I'll check it after 24 hours.

comment:20 by grazvi, 10 years ago

I measure the RAM usage on the host by opening task manger and starting some RAM intensiv programs on the guest. More over got the RamMap from MS. The memory allocated to guest is marked as Driver Locked. Easiest way to make the guest use maximum allocated ram is to copy some huge files form some external source like server or shared folder. 4.3.14 additions are installed also.

comment:21 by Frank Mehnert, 10 years ago

grazvi, please don't mix this defect with the lazy RAM allocation. Let me explain: VirtualBox does lazy RAM allocation, that is, not the complete amount of RAM is allocated when the guest is started. Over the time the guest is using more memory and at this time the amount of memory consumed by the VM process will increase. The typical behavior is that the process grows until a certain limit. Also, on Windows it's also sometimes not clear if the memory is really used by the process or for I/O buffers.

Therefore to be sure that there is a memory leak you should ensure that the guest started some bigger application and/or does a lot of I/O. At some time the amount of memory assigned to the VM process shouldn't increase anymore. I have no values but a rule of thumb is that there is 30% virtualization overhead, e.g. if you assigned 1GB as guest RAM the process will eventually occupy 1.3GB. Again, this is a rule of tumb.

The observation from mooninite is actually interesting.

comment:22 by grazvi, 10 years ago

Oh ok. So it is normal that once the allocated memory is used the host sees it as always used independent of actual needs of guest? Like if the guest after closing all programs reports Gigs of free memory the host still sees it as used and it can not be used for host needs. There is no way to overcome this? And yes after the guest reach maximum allocated memory it stays constant for host. Thank you very much.

comment:23 by Michael, 10 years ago

It hasn't been a full 24 hours yet, but checking the VM today shows no sign of memory leaking. VBoxService memory usage is still the same as it was yesterday. I'm satisfied that --disable-vminfo is a workaround and possible cause of the leak.

comment:24 by aeichner, 8 years ago

Resolution: obsolete
Status: newclosed

Please reopen if still relevant with a recent VirtualBox release.

comment:25 by RalfFriedl, 7 years ago

Resolution: obsolete
Status: closedreopened

I can confirm that the problem still happens, almost exactly the same constellation.

VirtualBox 5.1.26 running on Linux Host.
VirtualBox Guest Addition 5.1.26 running in Windows XP.

I'm using RDP to connect to the RDP Server in the Windows Guest (not to the VirtualBox RDP Server). I just had to restart the VirtualBox Guest Additions Service because it used more than 600MB of virtual memory, more than the memory of the virtual machine. Now, after the restart, it uses 3.5MB or 1.4MB, depending on which column of the Windows task manager I prefer.

While it would be nice to have this leak fixed, an option to restart the service every week or so would be sufficient. At the moment, I need admin rights to restart the service, which I don't usually have.

PS:
Now, about 24 hours later, the memory usage has increased to about 24MB / 22MB, which is slightly below 1MB per hour. I don't yet know whether it depends on what I do in the VM, or if I have to leave the RDP session open at all. As it is the VBoxService.exe and not VBoxTry.exe, I think it should not be related to user activity.

According to the help files, the meaning of the two sizes is resident memory and allocated virtual memory. This is consistent with the observation that the value for allocated virtual memory tends to go up, while the resident memory is eventually constrained by the available real memory. Why and how resident memory can be more than the allocated virtual memory is a mystery. Maybe the size of the executable is not included in the allocated memory, but in the resident memory.

Last edited 7 years ago by RalfFriedl (previous) (diff)

comment:26 by astrohart, 4 years ago

Hi,

I am utilizing v6.1.4 and am experiencing the same issue. I just have been utilizing it for approximately 90 minutes and already it eats 40% of my available RAM after opening and shutting down a VM. I click Shut Down on the Windows 10 start menu inside the VM and do not simply close the window.

After just once using my VM, the drag-and-drop stops working the next time I run it.

comment:27 by aeichner, 4 years ago

Please attach a VBox.log of the affected VM.

Note: See TracTickets for help on using tickets.

© 2023 Oracle
ContactPrivacy policyTerms of Use