"Not enough memory" error message and Windows Phone 8 Emulator does not start in Windows 8.1

Symptoms

The Windows Phone 8 Emulator does not start on a computer that is running Windows 8.1 and that has fewer than 8 gigabytes (GB) of RAM if many programs are running at the same time. Additionally, you receive the following error message:

"The Windows Phone Emulator wasn't able to ensure the virtual machine was running:
Something happened while starting a virtual machine: 'Emulator Name' could not initialize. (Virtual machine ID GUID)
Not enough memory in the system to start the virtual machine Emulator Name with ram size 1024 megabytes. (Virtual machine ID GUID)"



This problem can occur on a computer on which you may have previously been able to start the Windows Phone Emulator and also run the same programs when that computer was running Windows 8.

Cause

This problem occurs in Windows 8.1 because the operating system is more conservative than the Windows 8 version about how it allocates memory to maintain consistently high performance. In Windows 8.1, Hyper-V memory management accounts for the memory that is consumed by programs before it starts any emulator instances. Hyper-V did not make this consideration in Windows 8.

Workaround

Important
Follow the steps in this section carefully. Serious problems might occur if you modify the registry incorrectly. Before you modify it, back up the registry for restoration in case problems occur.

To work around this problem in a system that is running many programs that are using lots of memory, try to close those programs and then restart the emulator. 

If the emulator still does not start, you can disable the Hyper-V runtime memory monitoring functionality by adding a MemoryReserve registry. To do this, follow these steps:
  1. Start Registry Editor.
  2. Locate the following registry subkey:

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Virtualization
  3. Right-click the Virtualization folder, point to New, and then click DWORD Value.
  4. Type MemoryReserve, and then press Enter.
  5. Double-click MemoryReserve, enter 2048 in the Value data box, select the Decimal option, and then click OK.
  6. Close Registry Editor.
In systems that experience this problem and that have fewer than 8 GB of RAM installed, a MemoryReserve value of 2048 (2 GB) is recommended. A value of zero (0) causes this registry setting to be ignored.

Note You must restart the computer for this registry setting to take effect.

More Information

If you disable runtime monitoring of memory, the system can start emulator instances without first considering program memory usage. Although this may let you start the emulator in more situations, it may also decrease overall system performance.

The MemoryReserve registry value determines how much memory is reserved for the hosting system. For example, if this value is set to 2048 (decimal), 2 GB of system memory is reserved for the hosting system. Instances of Windows Phone Emulator will then try to start in the rest of system memory without the system considering program memory usage.

Note This registry setting is shared with Client Hyper-V in Windows 8.1. This setting may interfere with Client Hyper-V scenarios and let virtual machines allocate too much system memory. 
Properties

Article ID: 2911380 - Last Review: Jan 7, 2014 - Revision: 1

Windows Phone 7.1 Dev Tools, Windows Phone SDK 8.0, Windows 8.1

Feedback