The most common cause of the "lack of memory" error is your game cache; clearing it as described here should resolve the issue most of the times.
Automatic Pagefile Size Management
When you open more applications or load more data than the RAM on your PC can accommodate, the programs already present in the RAM are automatically transferred to the Pagefile, which is essentially treated as a "secondary RAM" of a certain size; in most cases, using the automatic size management is suggested.
- Right click on the Windows Start button and go to System.
- From the left pane of the System window, click Advanced system settings.
- On the System Properties window, switch to the Advanced tab.
- Click on Settings found under the Performance section.
- On the Performance Options window, switch to the Advanced tab.
- Press the Change button under the Virtual memory section.
- On the Virtual Memory box, check the Automatically manage paging file size for all drives checkbox.
- Restart your computer.