We might have faced the issue (especially for beginners) while running Visual Studio Emulator when we don't have enough RAM to execute what we have allocated to the device.
The issue will have some version of the below error.
The emulator is unable to verify that the virtual machine is running:
Not enough memory is available in the system to start an emulator that uses 3072 MB of startup RAM. Please close other applications and try to launch the emulator again.
To solve this issue, we have to reduce the RAM allocated to that device. Follow these steps:
Goto path
C:\Users\<username>\AppData\Local\Microsoft\VisualStudioEmulator\Android\Containers\Local\Devices
Open the configuration (CFG) file with Notepad and change the device.vm.ram.size =1024 (or half of your RAM in machine)
- configuration[id]=4B675905-D130-4929-91C8-FC62E9C03A24
- configuration.type=device
- configuration.version=1.0.60404.1
- device.description=Similar to Samsung Galaxy Note4, Samsung Galaxy Note5, Huawei Nexus 6P, Motorola Moto X Style
- device.platform=5FB1F683-0D5B-496C-B12A-A74399055661
- device.screen.diagonal=5.7
- device.screen.resolution=1440x2560
- device.vm.cpu.architecture=x86
- device.vm.cpu.count=4
- device.vm.heap.size=256
- device.vm.ram.size=1024
- device.vm.vhd=vhd\\5.7_Marshmallow_(6.0.0)_XHDPI_Phone\\image.vhd
- device.name=5.7" Marshmallow (6.0.0) XHDPI Phone
Restart your emulator and the issue is resolved.
Stay tuned with C# Corner for more updates and tricks.
| | | | | | | | | |
Text-to-speech function is limited to 200 characters