PorkStudios / Pork2b2tBot

A minecraft bot thing, also works as a proxy!
https://www.daporkchop.net/pork2b2tbot
Other
46 stars 16 forks source link

Update Start.sh script, moved build operation to build.sh #45

Closed VADemon closed 3 years ago

VADemon commented 3 years ago

The GC settings were eye-balled, low effort, with the hope that the proxy doesn't leak memory.

Explicit -server because we expect the proxy to run for a long time, SerialGC because we don't need n-Threads on a multicore machine for such a tiny application.

As explained, ParNewGC only had miniscule improvement in GC time, N=2 had not noticable difference, N=4 cut down time by ~2-4ms, but YoungGen collections are rare enough that we might as well not care. That option is commented, anyone can restore it.

Previously all default JVM settings were to be used. And whoever's running OpenJ9 can probably figure stuff out on their own for now? I'm pretty sure UseSerialGC is HotSpot-only.

DaMatrix commented 3 years ago

with the hope that the proxy doesn't leak memory

i should sure hope it doesn't leak any memory, if it does that's a pretty major bug :P

-server is probably going to increase memory usage quite a bit (due to JIT being forced to do heavy optimization on code paths that are seldom used, and a preference towards growing the heap). i agree that -Xmx512M is far too much, though

is GC throughput actually an issue? i've been using it with only -Xmx256M on a raspberry pi b+ (1st gen) for months at a time without any trouble with lag, latency, high cpu or memory leakage.

VADemon commented 3 years ago

Even if -server does enable C2 (I keep forgetting if its default or not - -XX:+PrintFlagsFinal - ok, JDK 8 on x64 Windows defaults to TieredStopAtLevel=4 EITHER way)

The difference is about ~15 MB. That's about the difference you get from proper -Xshare:on, maybe it'd yield more if all application classes were included and multiple instances launched.

GC Throughput is not an issue at all, the goal was to minimize on memory and I didn't even go hard or crazy here (yet). Using SerialGC seemed to marginally increase YoungGen time that's all. With the settings process memory is just above ~200MB with plenty of space in YoungGen and some in OldGen, being cautious not to cause mayhem later on.