Im trying to run my java application, but after some time it automatically stops and throws OutOfMemoryException: Java heap space. Now when i try to run it using (say) (-Xmx allocates the maximum heap memory)
java -Xmx2000m [AppName]
then it says
Error occured during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine
Anyway that I could run my app?