Spigot MC Server RAM problem?

gr
- in Servers
1

So I figured I could host a small Minecraft server for 5 people or so on my PC, do not worry he will not run permanently should wioeder people now write that that would be too much power cost. But my problem is that I can't run the batch.bat batch file with more than 1G. The code looks like this:

java -Xmx1024M -Xms1024M -jar spigot.jar nogui

everything goes so far, but I want to start now with 2 or more gigabytes comes the error:

Error occurred during initialization of VM

Could not reserve enough space for 2097152KB object heap

I have Java 64Bit installed so this "Java 8 Update 221"

People in YT videos just increase the 1024 to 2048 and it works, but not with me. The system variables I have already tried has brought nothing. Do I have the wrong Java version or does Java just need more RAM?

PC:

AMD Ryzen 5 2600 Six Core Processor 3.40 GHz

Installed RAM: 16GB - 3200 MHz

Graphics card: Nvidia GeForce RTX 2060 OC

yo

"Error occurred during initialization of VM"

An error has occurred…

"Could not reserve enough space for 2097152KB object heap."

could not create enough storage space for […].

look if ever enough RAM is available and is not used by other running processes.