VirtualBox

Ticket #3498 (closed defect: fixed)

Opened 5 years ago

Last modified 2 years ago

Possible memory leak during paused VM

Reported by: skidmarks Owned by:
Priority: major Component: other
Version: VirtualBox 2.1.4 Keywords:
Cc: Guest type: Windows
Host type: other

Description

I'm running the non-OSE version of VirtualBox 2.1.4. The VM guest is running WinXP Pro. If I boot the machine and then pause the guest, my system memory usage starts to increase. After a few hours all ram gets used up.

Immediately upon unpausing the VM, the ram is released. Below is a sequence of `free' commands from just before pausing, just before unpausing, immediately after unpausing, and then a few minutes later.

foo@bar:~$ date && free
Wed Mar  4 21:03:32 MST 2009
             total       used       free     shared    buffers     cached
Mem:       4054092    3018400    1035692          0      37476    1400648
-/+ buffers/cache:    1580276    2473816
Swap:      1951856       2208    1949648
foo@bar:~$ date && free
Wed Mar  4 21:16:20 MST 2009
             total       used       free     shared    buffers     cached
Mem:       4054092    3666676     387416          0      38628    1481980
-/+ buffers/cache:    2146068    1908024
Swap:      1951856       2208    1949648
foo@bar:~$ date && free
Wed Mar  4 21:16:27 MST 2009
             total       used       free     shared    buffers     cached
Mem:       4054092    3117800     936292          0      38640    1482028
-/+ buffers/cache:    1597132    2456960
Swap:      1951856       2208    1949648
foo@bar:~$ date && free
Wed Mar  4 21:21:13 MST 2009
             total       used       free     shared    buffers     cached
Mem:       4054092    3013084    1041008          0      39100    1377408
-/+ buffers/cache:    1596576    2457516
Swap:      1951856       2208    1949648

This is a major problem for me. I really like to have the VM open, as I use it to VPN, but I want to be able to pause because I run large optimizations too.

Attachments

VBox.log Download (55.8 KB) - added by skidmarks 5 years ago.
VBox.log-mb Download (47.5 KB) - added by burto 4 years ago.

Change History

Changed 5 years ago by skidmarks

comment:1 Changed 5 years ago by frank

So far I was not able to reproduce this. You log is not sufficient as it does not show if other processes eat memory. I have tried to reproduce and have paused a Win XP guest with two hostif network adapters for more than 30 minutes. There memory consumption of all related VBox-processes is very stable (i.e. does not change). Can you repeat the experiment and check the involved VBox processes with

/bin/ps aux|egrep "VirtualBox|VBox"

If you really experience an increase of the required memory it should show us which process is involved (VirtualBox or VBoxSVC).

comment:2 Changed 5 years ago by skidmarks

Okay, I tried looking at the processes as you requested and I didn't see any change in their memory usage. So, obviously it must be a kernel problem, right? Well, after some googling, the best I could come up with was slabtop. So, here's some grabs from before pausing, after 20 minutes, and immediately after unpausing:

 Active / Total Objects (% used)    : 827587 / 1142559 (72.4%)
 Active / Total Slabs (% used)      : 16051 / 16051 (100.0%)
 Active / Total Caches (% used)     : 61 / 66 (92.4%)
 Active / Total Size (% used)       : 71184.88K / 91935.82K (77.4%)
 Minimum / Average / Maximum Object : 0.01K / 0.08K / 16.12K

  OBJS ACTIVE  USE OBJ SIZE  SLABS OBJ/SLAB CACHE SIZE NAME                   
935544 675919  72%    0.04K   9172      102     36688K page_cgroup
 19169  12821  66%    0.55K    661       29     10576K radix_tree_node
 12684  12107  95%    0.75K    604       21      9664K ext3_inode_cache
 54000  15731  29%    0.11K   1500       36      6000K buffer_head
 23484  19113  81%    0.20K   1236       19      4944K dentry
  5540   5537  99%    0.77K    277       20      4432K shmem_inode_cache
 16859  16636  98%    0.17K    733       23      2932K vm_area_struct
   680    663  97%    4.00K     85        8      2720K kmalloc-4096
   295    295 100%    5.61K     59        5      1888K task_struct
  5850   5390  92%    0.31K    234       25      1872K ip_dst_cache
   752    571  75%    2.00K     47       16      1504K kmalloc-2048
  7413   6982  94%    0.19K    353       21      1412K kmalloc-192
  1360   1254  92%    1.00K     85       16      1360K kmalloc-1024
 14943  14943 100%    0.08K    293       51      1172K sysfs_dir_cache
    32     32 100%   12.00K     16        2       512K nv_stack_t
  1008    847  84%    0.50K     63       16       504K kmalloc-512



 Active / Total Objects (% used)    : 1457007 / 1779573 (81.9%)
 Active / Total Slabs (% used)      : 61833 / 61833 (100.0%)
 Active / Total Caches (% used)     : 61 / 66 (92.4%)
 Active / Total Size (% used)       : 825651.33K / 845798.37K (97.6%)
 Minimum / Average / Maximum Object : 0.01K / 0.47K / 16.12K

  OBJS ACTIVE  USE OBJ SIZE  SLABS OBJ/SLAB CACHE SIZE NAME                   
 92856  92847  99%    4.00K  11607        8    371424K kmalloc-4096
103488 103482  99%    2.00K   6468       16    206976K kmalloc-2048
322512 322501  99%    0.25K  20157       16     80628K kmalloc-256
 74464  74463  99%    1.00K   4654       16     74464K kmalloc-1024
935442 663105  70%    0.04K   9171      102     36684K page_cgroup
 54512  54495  99%    0.50K   3407       16     27256K kmalloc-512
 19169  12295  64%    0.55K    661       29     10576K radix_tree_node
 11886  11361  95%    0.75K    566       21      9056K ext3_inode_cache
 46512  11221  24%    0.11K   1292       36      5168K buffer_head
 21831  19020  87%    0.20K   1149       19      4596K dentry
  5540   5537  99%    0.77K    277       20      4432K shmem_inode_cache
  9675   9675 100%    0.31K    387       25      3096K ip_dst_cache
 16859  16633  98%    0.17K    733       23      2932K vm_area_struct
   290    281  96%    5.61K     58        5      1856K task_struct
  7413   6977  94%    0.19K    353       21      1412K kmalloc-192
 14943  14943 100%    0.08K    293       51      1172K sysfs_dir_cache



 Active / Total Objects (% used)    : 813211 / 1139368 (71.4%)
 Active / Total Slabs (% used)      : 16058 / 16058 (100.0%)
 Active / Total Caches (% used)     : 61 / 66 (92.4%)
 Active / Total Size (% used)       : 70588.45K / 94013.80K (75.1%)
 Minimum / Average / Maximum Object : 0.01K / 0.08K / 16.12K

  OBJS ACTIVE  USE OBJ SIZE  SLABS OBJ/SLAB CACHE SIZE NAME                   
935442 663194  70%    0.04K   9171      102     36684K page_cgroup
 19169  12322  64%    0.55K    661       29     10576K radix_tree_node
 11886  11361  95%    0.75K    566       21      9056K ext3_inode_cache
 46512  11221  24%    0.11K   1292       36      5168K buffer_head
 21831  19020  87%    0.20K   1149       19      4596K dentry
  5540   5537  99%    0.77K    277       20      4432K shmem_inode_cache
  1808    573  31%    2.00K    113       16      3616K kmalloc-2048
  9750   9694  99%    0.31K    390       25      3120K ip_dst_cache
 16859  16633  98%    0.17K    733       23      2932K vm_area_struct
   688    661  96%    4.00K     86        8      2752K kmalloc-4096
   290    281  96%    5.61K     58        5      1856K task_struct
  7413   6982  94%    0.19K    353       21      1412K kmalloc-192
  1392   1264  90%    1.00K     87       16      1392K kmalloc-1024
 14943  14943 100%    0.08K    293       51      1172K sysfs_dir_cache
  2608    525  20%    0.25K    163       16       652K kmalloc-256
  1056    829  78%    0.50K     66       16       528K kmalloc-512

also

 uname -a
Linux pengTyler 2.6.27-11-generic #1 SMP Thu Jan 29 19:28:32 UTC 2009 x86_64 GNU/Linux

nothing strange about the setup. plain 64 bit Ubuntu, up to date and I installed VirtualBox from your repositories...

thanks!

comment:3 Changed 5 years ago by skidmarks

If I make a new VM and set it to Linux (Ubuntu) it works fine, even if I boot the Windows image. No memory problems. Even if I switch it to Windows after creating the machine, all is fine.

If I make a new VM and set it to Windows, but boot off an Ubuntu CD, never even booting windows or going past the language selection menu for the ubuntu disk, it chews up memory. Changing the OS setting to Linux doesn't help at all.

So, the upshot is I have a work around for my problem. I'll just keep using the machine that I created with the OS set to Linux and switched to Windows...

No idea why this works...

comment:4 Changed 5 years ago by frank

Setting a different guest OS type during VM creation changes some settings. Which Windows type did you set? Compare the settings of both VM's:

  • VT-x/AMD-V enabled/disabled?
  • memory size?
  • the type of the network adapter?
  • I/O APIC enabled/disabled?

It should be easy to find the setting which makes the difference for your setup. Of course we would be interested in finding the problem.

comment:5 Changed 5 years ago by skidmarks

All settings were the same. I chose Win XP. In particular:

512 MB ram, 12 MB video ACPI, IO APIC, VT-x/AMD-V, and 3D Acceleration: enabled audio: pulseaudio nic: PCnet-FAST III

...ah bugger. There is one difference: NAT vs host networking and...yes. That's the one.

With the networking set to NAT it's fine. Host networking blows up. Makes sense, I suppose. Probably buffering network traffic for the VM...

Thanks!

comment:6 Changed 5 years ago by frank

One more question: What does this VM when it is not paused and are there any other clients which might want to contact the VM when it is paused?

comment:7 Changed 5 years ago by skidmarks

Sorry. The VM works just fine when it's not paused and no, there aren't any other machines directly trying to access this machine. It's not sharing any files or running any public services.

comment:8 Changed 5 years ago by sandervl73

  • Status changed from new to closed
  • Resolution set to worksforme

Please reopen if it still happens with 3.0.8.

comment:9 Changed 4 years ago by burto

Just found this ticket because tonight my paused Windows XP VM started gobbling up swap space until I unpaused it.

I'm using 3.0.8 on an AMD64 host running Ubuntu 8.4. The VM is using bridged networking.

Looks like the problem still lurks!

comment:10 Changed 4 years ago by frank

  • Status changed from closed to reopened
  • Resolution worksforme deleted
  • Summary changed from Possible memory leak in 2.1.4 on Ubuntu 8.10 amd64 to Possible memory leak during paused VM

burto, please could you attach a VBox.log file of such a session?

Changed 4 years ago by burto

comment:11 Changed 4 years ago by burto

I attached the log file, hope it tells you something useful.

comment:12 Changed 2 years ago by frank

  • Status changed from reopened to closed
  • Resolution set to fixed

Please reopen if still relevant with VBox 4.1.6.

Note: See TracTickets for help on using tickets.

www.oracle.com
ContactPrivacy policyTerms of Use