Possible memory leak

Discussions related to using VirtualBox on Linux hosts.
Post Reply
skidmarks
Posts: 13
Joined: 2. Oct 2008, 02:48

Possible memory leak

Post by skidmarks »

Has anybody else seen this? I'm running VB 2.1.4 on Ubuntu 8.10 AMD64. I have a guest system running WinXP Pro. Everything is fine while the VM is running, but if I pause the VM for a while, it starts to eat memory.

I left it paused last night, with the total system using about 1.4 GB of ram and no swap. I came home tonight to find my machine was dragging and I could barely even surf the web. My ram usage was up to 3.5GB with 700MB of swap used. The minute that I resumed the VM, my ram usage dropped to 2.0GB and slowly decreased back to ~1.4GB.

Skids
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Post by Sasquatch »

You might want to file a bug report. You can do that in the Bugtracker. You need a separate account though.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
skidmarks
Posts: 13
Joined: 2. Oct 2008, 02:48

Re: Possible memory leak

Post by skidmarks »

Well, first off, I can't run top or htop in the virtual terminals, because I'm running WinXP as the only guest. As for what's running in the guest, that's easy. Nothing. The guest is paused.

In fact, I just booted up the VM into safe mode and immediately paused the machine and it looks like it has the same behaviour. It does look to be eating memory slower, so it could be something else. I haven't left it paused long enough to be certain.

Are you running a similar setup? Did you try doing what I did? I'm really looking to see if anybody else can replicate this problem before I spend a lot of time trying to figure out whether it's a problem on my end or if it's a bug.

Thanks
frank
Oracle Corporation
Posts: 3362
Joined: 7. Jun 2007, 09:11
Primary OS: Debian Sid
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Linux, Windows
Location: Dresden, Germany
Contact:

Re: Possible memory leak

Post by frank »

That sounds indeed like an interesting bug. I suggest you to open a bug report and attach the VBox.log file there.
skidmarks
Posts: 13
Joined: 2. Oct 2008, 02:48

Re: Possible memory leak

Post by skidmarks »

Mr-Biscuit wrote:Have you tried running mtrace?
ctrl-alt-f(number) should allow you to login to a virtual tty.

Hmm. Make a small image and run a linux distribution to see if it is specific with virtualbox or just windows as a guest.
Ah. I misunderstood what you meant by virtual-terminal. No, I ran top in a regular term window, but I didn't try it in a virtual tty. top didn't show any change in memory usage by virtualbox though.

I tried re-installing the guest additions and I thought for a bit that fixed things (plus I've been busy writing a conference paper...). Anyways, I had a little time to play tonight and so I tried running free, then pausing VB, waiting a bit, running free, unpause and immediately run free again:

Code: Select all

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
Notice there's 7 seconds between the paused/unpaused pair and my memory usage dropped by over 1/2 a gig. After a few minutes of messing in the VM nothing had changed...

I don't have time to try a different guest right now, but I think I'll go ahead and file a bug report.

Thanks
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: Possible memory leak

Post by Sasquatch »

If you have the Gnome System Monitor, please try that to see what is eating up the memory. I have it running now, put my Ubuntu 9.04 VM to pause and will keep monitoring it for memory usage. I have 3 GB in my system, so I have plenty of RAM left for this test. I can also see how much memory it's using, and currently it's at 571 MB (gave it 512, rest is for the GUI obvious). In the mean time, I'm still using my Host itself. If it doesn't do anything after an hour or two, I will see how it goes with an XP VM tomorrow.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
skidmarks
Posts: 13
Joined: 2. Oct 2008, 02:48

Re: Possible memory leak

Post by skidmarks »

I've post a bug report and the engineer suggested watching all the vbox processes. Turns out none of the processes was growing in memory. So I used slabtop to monitor kernel memory use and the problem does show up there. Unfortunately, it isn't specific as to what is using the memory... I've put this in my bug report and hopefully they'll be able to reproduce the problem.
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: Possible memory leak

Post by Sasquatch »

I had no results with my Linux VM. Had it paused for over 2 hours. How long does it take before you see any change?
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
skidmarks
Posts: 13
Joined: 2. Oct 2008, 02:48

Re: Possible memory leak

Post by skidmarks »

Yeah, it seems like something subtle about my situation. Watching slabtop, the instant I pause the VM I start seeing the kmalloc's increasing. It becomes a significant about of ram after 5-10 minutes. I need to try setup an VM and see if it's something about that particular one...

It's strange though because I haven't done anything custom. It's the stock ubuntu 8.10 amd64 kernel and I installed VB from their repositories... very weird.
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: Possible memory leak

Post by Sasquatch »

I didn't have any results with my Linux VM yesterday as I already noted, so I fired up my XP VM this morning for it. I was just working here on the forums while it was sitting there idle and paused. I had the Gnome System Monitor running with the VB process selected. Now I don't know when it exactly happened, but when I checked it after a while, the process was gone. A quick look at the panel revealed that it was indeed no longer running. Opening the VB GUI showed the state of Aborted with some messages in /var/log/messages, /syslog and dmesg. Almost like a kernel panic, but not quite. So I ran the VM again, paused it and it stayed up for several hours. I then unpaused it and shut it down. No issues in that run. Very strange. The log also abruptly stopped with the last entry of putting it to suspend (pause).
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
skidmarks
Posts: 13
Joined: 2. Oct 2008, 02:48

Re: Possible memory leak

Post by skidmarks »

Okay, this is strange.

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...
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: Possible memory leak

Post by Sasquatch »

Did you file a bug report on this? Please do, so the devs can take a look at it. Post a link to it here for future reference.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
skidmarks
Posts: 13
Joined: 2. Oct 2008, 02:48

Re: Possible memory leak

Post by skidmarks »

Post Reply