VirtualBox

Ticket #6646 (closed defect: fixed)

Opened 4 years ago

Last modified 4 years ago

memory leak if many smal files are written into a shared folder from linux guest

Reported by: emuh Owned by:
Priority: major Component: shared folders
Version: VirtualBox 3.1.6 Keywords:
Cc: Guest type: other
Host type: other

Description

If many files are copied to a shared folder for the linux guest, memory usage is increasing until "out of memory".

Host: MacOSX Guest: Linux (Kernel 2.6.24)

If many files are copied to the shared folder form the guest a memory leak occurs.

Reproduce: Load vboxguest and vboxvfs modules. Mount shared folder. Create 10000 files with 0kB Size. Copy the files to the shared folder Memory increases about 5MB

I have tested it with different versions of VirtualBox (2.2.4, 3.0.2 and 3.1.6). All tested Versions seem to have the problem.

I also could reproduce the error with Windows as Host. So I think its a problem of the Linux-Guest addition.

Change History

comment:1 Changed 4 years ago by frank

I cannot reproduce this memory leak. I assume you saw this leak on the host, right?

Please keep in mind that VBox does memory allocation on demand, that is, guest memory is assigned to the VM only if the guest is really accessing the memory. You will notice that the memory consumed by the VM will grow when the guest boots and it will grow further when you start some guest applications. It will grow until a certain limit which is defined by the amount of RAM you assigned to the guest and by the amount of RAM which is necessary to maintain that VM. So before you start this test make sure that the guest did really access each page of physical memory. You can do this by starting big applications. Keep an eye at the memory usage of the VM process. When it reached the maximum you start start your test.

I've tested this with a Linux guest on a Linux host and even copied several directories with 10000 ... 40000 files of zero length from the guest to the host -- the memory consumption by the VM process did not grow.

comment:2 Changed 4 years ago by emuh

My fault I was unclear in my discription. The Memory Leak occures on the Guest side.

To be sure its not a cache thing I let it run till no memory was left on the guest side, which let the Kernel drop an oom-killer. It seems to me, that the kernel allocates more and more memory and my impression is, that its the guest addition. If I copy the files with a normal samba share to the guest I have no problem.

Later on today I will try to reproduce it with a recent linux distribution as guest and host and report back with the results tomorrow.

Sry for my late response. I nearly forgotten about the bug.

comment:3 Changed 4 years ago by frank

Actually I spotted a very small memory leak but this leak will only waste some bytes every time a new directory is read from the shared folders and therefore I doubt that this is the same problem you observed. Though I would appreciate if you could check this fix: Please apply the following patch manually to /usr/src/vboxsf-*/utils.c.

--- utils.c      (revision 62467)
+++ utils.c      (working copy)
@@ -752,7 +752,7 @@
                         break;
                 }
         }
-        return 0;
+        err = 0;

  fail1:
         kfree (mask);

Then recompile the guest kernel modules with

/etc/init.d/vboxadd setup

as root (in your guest of course). Then reboot the guest and try to reproduce the memory leak. Thank you!

comment:4 Changed 4 years ago by frank

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

No response, closing. Please reopen if this still happens with 3.2.6 Guest Additions installed.

Note: See TracTickets for help on using tickets.

www.oracle.com
ContactPrivacy policyTerms of Use