Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

In windows, my guest VM keeps getting put into virtual memory... and then the VM freezes... because the VM is not able to respond at all. I even wait like 5 minutes and no response from the VM.

How do you keep a specific process, in this case the process associated with the VM, out of virtual memory?

My VM typically freezes every hour or so. A ballpark estimate is that I am losing 10 minutes out of every hour... due to restarting the VM. So any help would be very much appreciated.


UPDATE as per request:

  • host: winxp-sp3-32-bit
  • host-physical-memory: 3000 MB
  • guest: fedora14-64-bit
  • guest-allocated- 1400 MB
  • host memory as seen from task-manager when guest freezes: ~100 MB typically
share|improve this question
    
Can you prove that the VM is being put into virtual memory, and also that this is the problem? Please tell us what your guest OS is, how much RAM is allocated to the guest and how much is free in the guest when in freezes, and how much total RAM and free RAM in the host? –  Spectre May 24 '11 at 18:26

2 Answers 2

up vote 1 down vote accepted

I'm fairly certain in Windows you cannot keep a process out of virtual memory. IIRC all memory apart from certain areas of the Windows kernel can be paged. I don't think this is your problem though, especially not if the rest of Windows is responding OK.

share|improve this answer
    
So you if you have a paging file, you can't control where the process resides whether in virtual/physical memory? –  Trevor Boyd Smith May 24 '11 at 20:04
    
Correct, Windows will do its best to decide for you - its not an all or nothing situation either, frequently accessed parts of an apps memory will stay in physical, less used will get paged. If the VM really is getting aggressively paged, its a sign that you have allocated it too much memory, or that your system as a whole doesn't have enough. Given 32bit WinXP with 3GB of RAM, I wouldn't allocate the VM more than 1GB. –  Spectre May 24 '11 at 20:24
    
Oh, and a 64bit guest on a 32bit host is (IMO) asking for trouble, as the VM app probably has to emulate all the 64 bit instructions to 32 bit and back, which might be quite a bottleneck. Try making a 32bit Fedora VM and see if you have the same problem. Also, if you have a processor that has virtualisation features (Intel VT and AMD-V iirc), make sure they are turned on in the BIOS. –  Spectre May 24 '11 at 20:30
    
FYI, once you enable virtualization on your mobo, doing a 64bit guest on a 32bit host is not a problem. Both VirtualBox and VMWare implement this feature robustly. (you can navigate to their respective websites and see information about this specific feature). –  Trevor Boyd Smith May 24 '11 at 20:36
    
I am leaning towards... "I think I allocated too much to the VM". I recently racheted down the VM from 1400 to 1200 MB and I haven't had the guest freeze in more than an hour. Given that I used to freeze every 30 min and it's been more than an hour, I think the problem was allocating too much memory. –  Trevor Boyd Smith May 24 '11 at 20:38

Set your page file size to 0 :) You'd be amazed how much better your system works.

In XP,
My Computer->Properties->Advanced->Performance:Settings->Advanced->Virtual Memory:Change->"No paging file"->Set->OK

This obviously affects all processes, as far as I know it isn't possible to prevent the swapping out of memory for any one particular process. As mentioned in the comments though, I'm not really convinced (based on your description) that this is what is happening to your VM.

share|improve this answer
1  
there is a good discussion about whether or not to use windows paging... serverfault.com/questions/23621/… . Given that there is soo many up votes for "keep paging at the default settings", I will keep paging. –  Trevor Boyd Smith May 24 '11 at 20:01
    
Good find. Don't forget that there is no blanket solution for everyone. It all depends on how you use your machine. You should consider trying it, even if you wind up restoring the old settings afterwards. I have a 3gb machine and run with no page file, and have been able to eliminate significant performance issues by doing so. But I have to watch my total mem usage. –  Code Bling May 24 '11 at 20:09
    
Yeah I would avoid disabling the page file, all you need is one rogue process to bring the system to its knees and not be able to recover. Windows is fairly smart in that in some situations it will use RAM to maintain a system cache, even if it means caching unfrequently used memory, so that common OS functions and frequently launched apps are sped up. –  Spectre May 24 '11 at 20:21
    
Disabling page file might not work out, but again, there's no harm in trying. At least you will know if that is what is really causing your VM slowdown. –  Code Bling May 24 '11 at 20:34
1  
FYI, the windows limitation of 3GB is caused by a windows "feature" called "ignore the hardware's PAE capability". All Linux distros that are 32 bit can have 64 GB of ram (but each 32 bit process is limited to 2 GB of memory). –  Trevor Boyd Smith May 24 '11 at 20:43

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.