Page 1 of 1
Possible memory leak
Posted: 1. Mar 2009, 05:59
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
Posted: 1. Mar 2009, 16:08
by Sasquatch
You might want to file a bug report. You can do that in the
Bugtracker. You need a separate account though.
Re: Possible memory leak
Posted: 3. Mar 2009, 06:17
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
Re: Possible memory leak
Posted: 3. Mar 2009, 10:24
by frank
That sounds indeed like an interesting bug. I suggest you to open a bug report and attach the VBox.log file there.
Re: Possible memory leak
Posted: 5. Mar 2009, 06:32
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
Re: Possible memory leak
Posted: 5. Mar 2009, 21:55
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.
Re: Possible memory leak
Posted: 5. Mar 2009, 22:55
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.
Re: Possible memory leak
Posted: 6. Mar 2009, 01:23
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?
Re: Possible memory leak
Posted: 6. Mar 2009, 02:26
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.
Re: Possible memory leak
Posted: 6. Mar 2009, 21:20
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).
Re: Possible memory leak
Posted: 7. Mar 2009, 22:28
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...
Re: Possible memory leak
Posted: 8. Mar 2009, 14:20
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.
Re: Possible memory leak
Posted: 8. Mar 2009, 22:24
by skidmarks