Closed Luro02 closed 3 years ago
You should fix the title, as you're talking about {{SERVER_MEMORY}}
and not {{SERVER_JARFILE}}
.
This is a known issue and its unlikely to be fixed as java requires a max. In theory, you could set it to some huge value or remove the max argument for that server.
I've thought about this and there doesn't seem to be a good answer, Java should never be allocated more than about 8 GB of RAM unless you know what you are doing so setting the memory to the node's max memory seems like a terrible idea. Technically if you just remove the Xmx
argument I believe Java will just pull more memory as it needs it until it gets killed.
Also, this is technically not a bug and more-so intended behavior.
My response to this is.
java -Xms128M $( [ "$SERVER_MEMORY" == "0" ] || printf %s '-Xmx{{SERVER_MEMORY}}M' ) -jar {{SERVER_JARFILE}}
When SERVER_MEMORY
is 0 it won't print the -Xmx portion of the start.
setting the memory to the node's max memory seems like a terrible idea
Why? If you only have one server running on the node and the node is configured to only use 75% of the total ram, it would not make sense to give it any less ram.
Java should never be allocated more than about 8 GB of RAM
Especially with large modpacks (like "The 1.12 Pack") you have to allocate more than 8GB of ram, to make it run smoothly with multiple chunk loaders.
This is not a bug, it is a known limitation of the variable design and there are other open issues to extend that to support more customization.
I want to ask if anyone has tested my specific change that I posted last night?
I want to ask if anyone has tested my specific change that I posted last night?
Sorry for the really.. late response.
I've tested it and it works!
java -Xms128M $( [ "$SERVER_MEMORY" == "0" ] || printf %s '-Xmx{{SERVER_MEMORY}}M' ) -jar {{SERVER_JARFILE}}
When
SERVER_MEMORY
is 0 it won't print the -Xmx portion of the start.
Shouldn't this be by default in the minecraft egg?
Background (please complete the following information):
v.1.0.0-rc.3
Describe the bug Setting the
Allocated Memory
to 0 for a server should allow unlimited memory. TheVanilla Minecraft Server
Egg will be started withjava -Xms128M -Xmx{{SERVER_MEMORY}}M -jar {{SERVER_JARFILE}}
, where theSERVER_MEMORY
resolves to0
, instead of the maximum possible amount of memory for the node.As can be seen in the console output the server fails to start:
To Reproduce Steps to reproduce the behavior:
Allocated Memory
to zero inAdmin > Servers > <Server Name> > Build Configuration
Allocated Memory
from a specific amount to0
, did not reproduce the bug at first, but after changing theSERVER JAR FILE
, it updated the cached command and the above issue occured).Expected behavior The variable
{{SERVER_MEMORY}}
should resolve to the maximum allowed memory for the node instead of0
.