How to resolve this issue, for a minecraft server?

Its not that I don't have less RAM, I have plenty of RAM. So, what is causing it, to do this?

Why do you think its a RAM issue - the picture is not that clear but it seems to be an installation issue - is your program kosher.

It looks like you're trying to give it 4 GB of RAM which is over the maximum allowed according to the message, try like this instead:

java -Xms1024M -Xmx1024M…

1024 megabyte RAM that is, and try again. You can also try with 2048, or 3G. I don't know what the limit is.

I read that some systems with Java 32-bit only support 4 GB or 2 GB RAM even if your system has more. Just test and see what the maximum you can write is.

If your system has a lot of RAM, make sure you're using 64-bit Java to be able to use it.

Make sure you have 64 bit Java installed. If you have 32bit Java, the maximum RAM is limited to just below 4Gb. You can check by going to This PC ->Local Disk(probably C. -> Program Files x86 If there's a Java folder there, uninstall Java and reinstall the 64 bit version from their website. 32 bit downloads by default if you're using a 32 bit browser. 32 bit happens to be Chrome's default, you have to change it manually when you download Chrome