To do this, follow the following steps:
1. Go to Control Panel> All control panel items > System
2. Click on Advanced system settings
3. Under performance, click on settings
4. Go to Advanced tab
5. Under Virtual memory, click on Change
6. UN-check "Automatically manage paging file size for all drives" check box
7. Select your windows drive (where OS is installed)
8. Click on Custom size radio button
9. Set Initial size equivalent to your RAM size in MB
10. Set Maximum size to twice of your RAM size in MB
11. Click on Set
12. Click on OK thrice
13. Restart your system