[Android Apps and Games] :
How to boost MEmu App Player's Performance

1. Switch Windows power plans

Some time ago it seemed to me that MEmu App Player's Android was working hard and when Android's System Monitor was run, the CPU usage was a lot higher than it should be at around 60% when no apps were being run.

In Power Options in the Windows 10 Control Panel there are at least two power plans – Power saver and High performance. With both of these, there are separate settings for when the computer is running on battery power and when it is plugged into the mains supply.

After some thought and experimentation, could discover that the Windows power plan was having a serious effect on the performance of the Android OS in MEmu App Player's virtual machine.

The Windows host computer running Memu App Player (VirtualBox) was a Lenovo G505s laptop and the power plan was set to Power saver. Could notice that the CPU ran close to an restricted speed (the half of possible max. CPU speed 2.50GHz?) and hovered around of 1.35GHz most of the time.

When the High performance power plan was selected in the Windows Control Panel, the CPU ran close to its maximum speed (2.50GHz) and hovered around of 2.20GHz most of the time. MEmu App Player's Android in the virtual machine was then able to run at a normal speed and was fast and responsive.

So it turned out to be a simple problem, partly caused by selecting the wrong Windows power plan. Switching to High performance is obviously the solution to the virtual machine performance problem.

2. Switch MEmu App Player's priority

MEmu App Player (Note that MEmuHeadless.exe is the very Virtualbox executable) by default runs in Normal mode. Set its priority to High!

You must not use Windows Taskmanager to achieve this, you can run a Windows Command script as shown next

@echo off & setlocal ENABLEDELAYEDEXPANSION
set "script_title=%~nx0 - by jwoegerbauer@XDA"
TITLE !script_title!
echo(
CHCP>nul 2>nul||set path=%SYSTEMROOT%\system32;%path%
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
if !ERRORLEVEL! NEQ 0 (
echo Requesting administrative privileges...
echo Set UAC = CreateObject^("Shell.Application"^) > "%TEMP%\getadmin.vbs"
set params = %*:"=""
echo UAC.ShellExecute "cmd.exe", "/c %~s0 %params%", "", "runas", 1 >> "%TEMP%\getadmin.vbs"
"%TEMP%\getadmin.vbs"
del /q /f "%TEMP%\getadmin.vbs"
goto end
)
pushd "%CD%"
cd /D "%~dp0"
echo %PROCESSOR_ARCHITECTURE%|FINDSTR /i "64">NUL && (
set "memu_reg=HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\MEmu"
) || (
set "memu_reg=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MEmu"
)
for /f "tokens=2,*" %%i in ('"REG QUERY !memu_reg! /v DisplayIcon 2>NUL|FINDSTR /i "MEmu" 2>NUL"') do (
set "memu_install_dir=%%~dpj"
)
set "memu_install_dir=!memu_install_dir:~0,-1!"
set "memu_install_dir=!memu_install_dir:\MEmu=!"
echo MEmu install location: !memu_install_dir!
echo(
if not exist "!memu_install_dir!" (
echo MEmu install location not found on disk!
timeout /T 5 /NOBREAK >NUL
goto end
)
:
: MEmu instance name passed?
set "memu_vm=%~1"
if "!memu_vm!?"=="?" (
set "memu_start_cmd=!memu_install_dir!\MEmu\MEmuConsole.exe"
) else (
:
: Enumerate existing VMs
DIR "!memu_install_dir!\MEmu\MEmuHyperv VMs\*.*" /a:d /b>!cmd_output!
:
: Verify MEmu VM
set /a vm_ok=0
for /f %%l in (!cmd_output!) do (
set vm=%%l
if "!vm!"=="!memu_vm!" ( set /a vm_ok=1 )
)
if !vm_ok! NEQ 1 ( goto end )
set "memu_start_cmd=!memu_install_dir!\MEmu\MEmuConsole.exe /!memu_vm!"
)
:
: Start MEmu
echo Starting MEmu (!memu_start_cmd!) . . .
START "" /B "!memu_start_cmd!"
:
: Check MEmuHeadless is running
echo Waiting for MEmuHeadless has been started . . .
set /a headless_running=0
for /l %%i in (1,1,10000) do (
if !headless_running! EQU 0 (
TIMEOUT /T 5 /NOBREAK > NUL
TASKLIST /fi "imagename eq MEmuHeadless.exe" | FIND /i "MEmuHeadless.exe" >NUL 2>&1
if !ERRORLEVEL! EQU 0 ( set /a headless_running=1 & goto headless_test_done)
)
)
:headless_test_done
if !headless_running! EQU 0 (
echo MEmuHeadless is NOT running
TIMEOUT /T5 /NOBREAK > NUL
goto end
)
echo Boosting, because MEmuHeadless is running boosting . . .
:
: Boost it
: Note that MEmuHeadless.exe is the very Virtualbox executable
WMIC process where name="MEmuHeadless.exe" CALL setpriority "high priority" >NUL 2>&1
:
:end
endlocal
@echo on

to perform this task. Simply in folder ...\Microvirt\MEmu create such a Windows Command script-file - preferredly name it MEmu-Booster.bat, then on Windows Desktop create link which points to this Windows Command script-file.