Error while starting an agent and gives an heap size error

Error: C:\Users\ae-agent-POONAM\ae-agent\bin\startup.bat

WARNING: Using JAVA from path

Error occured during initialization of VM

Could not reserve enough space for 2097152KB object heap.

Cause: This error is seen when 2 different versions of Java are installed on the agent machine

Resolution:

Please make sure 64 Bit JAVA version is installed

find the below-attached screenshot for your reference.