If you are using Windows XP, right click on the My Computer icon on the desktop and select properties. Go to the Advanced tab and click on Settings for Performance. Again, select the Advanced tab, and click on Change under Virtual Memory. To stop windows automatically resizing the file, make the minimum and the maximum sizes the same.
The recommended size of this file is 1 and a half times the amount of physical memory you have. So for 512Mb of RAM, set the virtual memory to 768.