Multi VM Bug -- with Picture!

Discussion in 'Parallels Desktop for Mac' started by xochi, Nov 10, 2006.

  1. xochi


    Ok, check out the attached picture. It clearly shows some sort of bug going on with Parallels handling of multiple VMs.

    Notice these things:

    1. I have 3 VMs running, yet we see two copies of "Parallels Desktop" and one copy of "Parallels".

    2. The memory usage is all wrong -- the 3 VMs are set to 256, 300, and 512 MBs
    which is 1068 total.
    And yet the totals in Activity monitor show only 984, and
    yet for some reason a total of 1370MB are "wired".

    3. Also notice the phenominal # of pageins/pageouts that
    are happening, even though all 3 of the VMs are
    basically just sitting there idle.

  2. Godrifle


    Not such an issue...

    You needn't be concerned about wired memory. Wired memory consists of the amount of unswappable RAM in use by every app and OS component running on your machine. At a minimum, you have the OS (and all it's children), Mail, iTunes, Safari, Interarchy, Dashboard and Activity Monitor running (in your screenshot). So, your complaint that three instances are using 984 MB of wired memory but should be using more (because you've told Parallels to use more) is a non-issue: that is exactly how it should work. Some of the total Parallels footprint is wired because it can't be swapped. Some of it can be virtualized so is being swapped.

    Keep in mind that page ins/outs are a cummulative counter since startup, so there's no way to accurately gauge how many of those are a direct result of your Parallels usage. Remember, you have other apps plus the system running. Here's a perfect example: watch page ins/outs and just mouse across your dock, or navigate a few finder windows. You'll see a fair number of page ins being added to the counter.

    The only way to come close to understanding an application's swap characteristics is to follow a rigorous timed boot and launch routine, once without launching anything but Activity Monitor and once with Parallels and AM. For this to be meaningful, it should be a scripted process, since any deviation in your actions between the two yields inaccurate results (such as an extra hover over the dock, etc.).

    However, you do point out an interesting phenomenon: I've found that if I launch the third instance of Parallels while the second is booting, I get a process name of "Parallels" like in your screen shot. But, if I wait until the second VM is running, and then launch a third instance, I get a process name of "Parallels Desktop". Probably a line of code referencing a different string, and nothing more serious than that.
  3. xochi


    The screenshot was taken about 5 minutes after a reboot -- I'm nearly 100% sure that the # page faults is excessive -- with a 2 gig machine and parallels set to use about 1 gig, there should be no reason for that amount of VM activity -- although Parallels is generally vastly faster than Virtual PC, I'm convinced that there are some cases where something goes wrong and it gets in a "swap happy" mode, in which case performance actually is WORSE than it was under VPC (for a similar number/size of virtual machines).
  4. nivenh


    i don't think the pageins/outs are worthy of worrying about. i have 1 vm going, xcode, a 3rd party debugger, mail, safari, adium, etc. moving across the dock doesn't cause any pageins/outs here. as a matter of fact, i turned on this machine this morning (nearly 16 hrs ago, non-stop use) and my counter says "34107/2975".

    i think yours is so high because of having 3 VM's loaded. w/o knowing the details, i'll assume based on your screenshot that each has 256mb or more allocated. the pageing means, something went to read some virtual memory, and it had been swapped out and had to be swapped back in. and to swap that in, something else had to be swapped out, etc. you've got 65mb free on a 2gb machine. you're starving for ram with 3 vm's running. solution to that paging and the associated performance hit is to just not do it if you don't have to.
  5. PTWithy


    Wire Memory _is_ a problem

    I'm having the same issue, and the wired memory _is_ a problem.

    The only thing that should be using wired memory in an operating system is the part of the system that must never be paged out because it is either part of the paging system itself or it is an interrupt handler. Every bit of wired memory takes away from the RAM that can be used for paging in and out of your applications. If Parallels gobbles up half your RAM for wired memory, it is as if you have taken half your RAM away from OS/X and your other applications are going to suffer. In your case, your 2G machine will operate like a 1G machine.

    Now, if by gobbling up that wired memory, Parallels is giving you a spiffy Windows emulation and that is your priority, perhaps you will not be bothered. But if you are only using Windows occasionally, this is a big sacrifice to pay!

    The *BIG* issue here though is that quitting Parallels, _does_ _not_ _release_ the wired memory! I have to restart my machine to get my memory back. That is a bad bug.

    I plan to play around with some of the VM settings. I see there is one about the virtual hard disk cache. Perhaps this is where the wired memory is going, although that seems like overkill. OS/X does not wire down _it's_ disk cache...
  6. joem


    Parallels releases wired memory for me. It releases the VM wired memory when I shut down the VM, and releases the Parallels app wired memory when I quit Parallels. I'm using Activity Monitor to measure it.

    Using wired memory for the guest improves performance, probably substantially. Wiring only that part of guest memory that contains critical OS components that should be fast such as interrupt drivers would be nice, but it's probably hard to identify them, so wiring all of it is safer.
  7. xochi


    Upon further reflection, I think this is a general bug in parallels that is not limited to 2+ VMs running.

    Last night, i left one single VM running (320MB) doing a long file transfer download. When I came back to my machine this morning, every single operation I did caused a ton of virtual memory file swapping. It was as if every single other process on my mac had been swapped out to the virtual memory page file. And yet, the memory usage did not show as abnormal when I checked Activity Montior.

    Also, this behavior persisted even after I quit parallels. So it appears to me that something (Parallels or OSX?) gets itself into some sort of bad mode where it's swapped all other processes out to disk, for no apparent reason.
  8. PTWithy


    I'm going to stick to this thread for discussion of the memory issue. Don't get me wrong, I think Parallels is really great. It has improved my workflow tremendously (doing cross-platform development). I'm just trying to suss out what is going on with wired memory that seems to force me to reboot.

    I've performed a few more experiments, and setting the Configuration/Options/hard disk cache policy to favor Mac OS X appears to help a lot. I do see most wired memory released when I quit the guest OS and more when I quit Parallel's. I guess the default setting is sort of 'demo mode', your guest OS works really well, at the expense of other host apps.

    It would be helpful to know more about what Parallels is actually trying to wire/unwire -- that might help us to understand its behavior better.

    As xochi observed, however, there still seems to be some situation where my wired memory creeps up and up and doesn't get released. The tip-off is huge amounts of paging activity in all your apps. I have not been able to pin down what causes this. More when I do.

Share This Page