#Starting Minecraft server with arguments while screen is off crashes Termux

56 messages · Page 1 of 1 (latest)

harsh thistle
#

Starting the server through ssh with these arguments:

-Xmx2G -Xms2G -XX:+UnlockExperimentalVMOptions -XX:+UnlockDiagnosticVMOptions -XX:+AlwaysActAsServerClassMachine -XX:+AlwaysPreTouch -XX:+DisableExplicitGC -XX:+UseNUMA -XX:NmethodSweepActivity=1 -XX:ReservedCodeCacheSize=400M -XX:NonNMethodCodeHeapSize=12M -XX:ProfiledCodeHeapSize=194M -XX:NonProfiledCodeHeapSize=194M -XX:-DontCompileHugeMethods -XX:MaxNodeLimit=240000 -XX:NodeLimitFudgeFactor=8000 -XX:+UseVectorCmov -XX:+PerfDisableSharedMem -XX:+UseFastUnorderedTimeStamps -XX:+UseCriticalJavaThreadPriority -XX:ThreadPriorityPolicy=1 -XX:AllocatePrefetchStyle=3 -XX:+UseG1GC -XX:MaxGCPauseMillis=37 -XX:+PerfDisableSharedMem -XX:G1HeapRegionSize=16M -XX:G1NewSizePercent=23 -XX:G1ReservePercent=20 -XX:SurvivorRatio=32 -XX:G1MixedGCCountTarget=3 -XX:G1HeapWastePercent=20 -XX:InitiatingHeapOccupancyPercent=10 -XX:G1RSetUpdatingPauseTimePercent=0 -XX:MaxTenuringThreshold=1 -XX:G1SATBBufferEnqueueingThresholdPercent=30 -XX:G1ConcMarkStepDurationMillis=5.0 -XX:G1ConcRSHotCardLimit=16 -XX:G1ConcRefinementServiceIntervalMillis=150 -XX:GCTimeRatio=99

from https://github.com/DataDalton/Minecraft-Performance-Guide/blob/main/Java Arguments/README.md
with root, acquired wakelock, unrestricted battery usage, and permission for Termux to display over other apps(previously it was dropping the ssh connection).
I'm not sure if it's being killed by android or it just simply crashes due to one of the args. However while the screen is on it starts normally. Which makes me think it's most likely being killed.

safe owlBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

lofty shale
#

Give logs

harsh thistle
lofty shale
#

What you see when you launch the server

harsh thistle
#

When I check the phone termux isnt running

lofty shale
#

Could you record the ssh session please?

harsh thistle
#

Not much to record. I just ssh in, cd into the server directory and start a bash script

lofty shale
#

But we need the output

#

We can't guess what happens else

harsh thistle
#

Okay where is the output?

lofty shale
#

In your ssh session

harsh thistle
#

I ran logcat but I dont see any useful info

lofty shale
#

The output of your Bash script

harsh thistle
#

How would I get that?

#
bash -v main.sh 
sudo java -Xmx2G -Xms2G -XX:+UnlockExperimentalVMOptions -XX:+UnlockDiagnosticVMOptions -XX:+AlwaysActAsServerClassMachine -XX:+AlwaysPreTouch -XX:+DisableExplicitGC -XX:+UseNUMA -XX:NmethodSweepActivity=1 -XX:ReservedCodeCacheSize=400M -XX:NonNMethodCodeHeapSize=12M -XX:ProfiledCodeHeapSize=194M -XX:NonProfiledCodeHeapSize=194M -XX:-DontCompileHugeMethods -XX:MaxNodeLimit=240000 -XX:NodeLimitFudgeFactor=8000 -XX:+UseVectorCmov 
-XX:+PerfDisableSharedMem -XX:+UseFastUnorderedTimeStamps -XX:+UseCriticalJavaThreadPriority -XX:ThreadPriorityPolicy=1 -XX:AllocatePrefetchStyle=3 -XX:+UseG1GC -XX:MaxGCPauseMillis=37 -XX:+PerfDisableSharedMem -XX:G1HeapRegionSize=16M -XX:G1NewSizePercent=23 -XX:G1ReservePercent=20 -XX:SurvivorRatio=32 -XX:G1MixedGCCountTarget=3 -XX:G1HeapWastePercent=20 -XX:InitiatingHeapOccupancyPercent=10 -XX:G1RSetUpdatingPauseTimePercent=0 -XX:MaxTenuringThreshold=1 -XX:G1SATBBufferEnqueueingThresholdPercent=30 -XX:G1ConcMarkStepDurationMillis=5.0 -XX:G1ConcRSHotCardLimit=16 -XX:G1ConcRefinementServiceIntervalMillis=150 -XX:GCTimeRatio=99 -XX:ConcGCThreads=6 -jar server.jar
OpenJDK 64-Bit Server VM warning: Ignoring option G1ConcRSHotCardLimit; support was removed in 21.0
OpenJDK 64-Bit Server VM warning: Ignoring option G1ConcRefinementServiceIntervalMillis; support was removed in 20.0
Connection to 192.168.0.12 closed by remote host.
Connection to 192.168.0.12 closed.

This is all the ssh reports

lofty shale
#

It could be just because it uses too much performances. Try keeping Termux in the foreground.

harsh thistle
#

I don't have a way of doing that

#

The screen has to be off

#

Even if termux stays in the foreground while the screen turns off this happens

lofty shale
#

Keep the screen on

harsh thistle
#

Uses to much battery

#

Even on the lowest brightness possible

lofty shale
#

Plug it so

#

And how can you start Java with so much arguments?

harsh thistle
#

Apparently the Disable child process restrictions developer option is supposed to stop this behavior but it doesn't do anything in my case

#

Honestly maybe it's not even being killed by android. Maybe it's crashing

#

I don't see why any of those arguments would cause a crash. Maybe someone more experienced can let me know

lofty shale
#

Java is only one.

lofty shale
lofty shale
harsh thistle
#

17+ and I'm using java 21

lofty shale
harsh thistle
#

According to that detailed explanation, that setting should disable the killing of apps which exceed the child process limit, and apps which use excessive CPU

#

I believe it has worked for me before but I'm not sure what's causing it to not this time

#

Unfortunately they didn't show a command for checking if that was actually toggled disabled

peak gazelle
#

@harsh thistle could you send output of this command please

#

uname -m

harsh thistle
#

sure gime a sec

peak gazelle
#

ok good and if you try the minecraft server with no arguments does it still crash also without using sudo?

#

i wouldn't recommend sudo for this (assuming you did use it with sudo since it's in your list)

#

also "UnlockExperimentalVMOptions" doesn't have a name sounding like it's very stable

harsh thistle
#

I will try now

#

but no it doesnt crash without args

peak gazelle
#

because java in general even on pc, but especially on termux, should not require sudo

harsh thistle
#

you know I forgot about that. I know that running java as admin crashes it on windows...

#

but no it just crashes without sudo due to "unknown signal 31"

#

I'll have to filter out the args and see which ones are good. Thank you for the help @peak gazelle

safe owlBOT