Describe the bug
Big memory issue (crash and can't connect) when connecting from Geyser (Builds 162, 161, 160) to a Java 1.14.4 Paper based server (latest build of 1.14.4 paper) that is using ViaVersion 2.2.3, and is under a BungeeCord proxy hosted on the same machine.
When i connect (using Geyser online mode) to the server, the proxy sees my account trying to connect, it succesfully autenticates with Mojang credentials and then it idles for a while. Meanwhile the player start falling in the void, lagging. Then Geyser crashes.
I am hosting Geyser on a separated VPS by Hetzner, 2gb of ram.
Startup flags are simply:
java -Xmx1G -Xms2G -jar Geyser.jar
When connecting it reaches 2g of ram and Ubuntu kills the process instantly, since the vps has only 2gb of ram. If i allocate xmx1gb and xms1gb then it reaches 1gb and crashes, without being killed by ubuntu.
I also tried to host Geyser on my laptop allocating 5 gb of ram or more, freezes anyway and the server kicks me out for various reasons (Lost connection, timeout, ...)
To Reproduce
Make a similar setup to mine:
Expected behavior
I tried to point my Geyser installation to a random 1.15 server, and it worked quite nice. You did an incredible job so far, only if it wasn't that it isn't working for my server!
Screenshots / Videos

Server Version
Paper version git-Paper-243 (MC: 1.14.4) (Implementing API version 1.14.4-R0.1-SNAPSHOT)
Geyser Version
Standalone (Builds 162, 161, 160), floodgate was installed on the bungeecord but the auth on geyser was set to online anyway.
Minecraft: Bedrock Edition Version
1.14.60 android and ios (ipad)
Additional Context
All plugins disabled made exception for ViaVersion.
Bungeecord had floodgate enabled while testing but Geyser was set to online mode anyway.
TCP Shield disabled and using clear ip.
-Xmx1G -Xms2G don't these flags mean that you have a maximum of 1GB and a minimum of 2GB? If you were able to get it working anyway that may not be the problem but try switching them around anyway.
I recommend setting them both the same value. Here is why....
In a production environment, if you monitor the GC data, you will notice that is a relatively short period of time (usually less than an hour), the JVM will eventually increase the heap size to the -Xmx setting. Each time the JVM increases the heap size it must ask the OS for additional memory, which takes time (and thus adds to the response time of any requests that were is process when the GC hit). And usually the JVM will never let go of that memeory. Therefore, since the JVM will eventually grab the -Xmx memory, you might as well set it to that at the beginning.
Another point is that with a smaller heap size (starting with -Xms), GCs will happen more often. So by starting with a larger heap initially the GCs will happen not as often.
Finally, in a production environment, you usually run only one app server per OS (or per VM). So since the app server is not competing for memory with other apps you might as well give it the memory up front.
Note that the above is for production. It applies also to the syatem test environment since the system test environment should mimic production as close as possible.
For development, make -Xms and -Xmx different. Usually, you are not doing much work with the app server in development, so it will often stay with the -Xms heap setting. Also, since in development the app server will share the machine with lots of other apps (mail client, word processors, IDEs, databases, browsers, etc), setting the -Xms to a smaller size lets the app server play more nicely with the other software that is also competing for the same resources.
-Xmx1G -Xms2Gdon't these flags mean that you have a maximum of 1GB and a minimum of 2GB? If you were able to get it working anyway that may not be the problem but try switching them around anyway.
Sorry, it was just a typo here on github.
The flags, of course, are java -Xms1G -Xmx2G -jar Geyser.jar
nitor the GC data, you will notice that is a relatively short period of time (usually less than an hour), the JVM will eventually increase the heap size to the -Xmx setting. Each time the JVM increases the heap size it must ask the OS for additional memory, which takes time (and thus adds to the response time of any requests that were is process when the GC hit). And usually the JVM will never let go of that memeory. Therefore, since the JVM will eventually grab the -Xmx memory, you might as well set it to that at the beginning.
Another point is that with a smaller heap size (starting with -Xms), GCs will happen more often. So by starting with a larger heap initially the GCs will happen not as often.
Finally, in a production environment, you usually run only one app server per OS (or per VM). So since the app server is not competing for memory with other apps you might as well give it the memory up front.
Note that the above is for production. It applies also to the syatem test environment since the system test environment should mimic production as close as possible.
For development, make -Xms and -Xmx different. Usually, you are not doing much work with the app server in development, so it will often stay with the -Xms heap setting. Also, since in development the app server will share the machine with lots of other apps (mail client, word processors, IDEs, databases, browsers, etc), setting the -Xms to a smaller size lets the
Thanks for all the info! However, i already tried with both xmx and xms set at both at the same value (lower than 2gb) and Geyser ran out of memory anyway
News: i continued testing. I downloaded a local copy of my server, and i managed to connect to it by running it on ip localhost and pointing a local Geyser proxy on localhost. So the fault is not of my server and my plugins.
Then i tried again, hosting Geyser on the same machine of the server, bypassing tcp shield, making it connect straight to the clear bungeecord ip. Nope, crashed. If i give it too much memory, ubuntu kills it, if i give it too low memory, it dies itself. So it's not even TCP shield's fault.
I am starting to think that:
1) it's an issue when connecting to an address that is not localhost (and i can't connect to localhost on the server machine since Geyser won't forward the real IPs. I need to make it connect to bungee.)
2) Geyser is not compatible with bungeecord, maybe it gets stuck somewhere after autentication.
Then i tried again, pointing my local geyser (hosted on laptop) to the clear ip of my server machine, so bypassing tcp shield. I allocated 10 fucking gigabytes of ram so it wouldn't crash...
This was the result (timed out):

I can confirm this issue, not sure what it is but using the latest master with debugging turned on I also get a heap error on a known working configuration.
[11:49:01 INFO] /127.0.0.1:52252 tried to connect!
[11:49:01 DEBUG] Is player data valid? true
[11:49:01 DEBUG] Could not find packet for ClientToServerHandshakePacket
[11:49:01 DEBUG] Could not find packet for ClientCacheStatusPacket
[11:49:01 INFO] Player connected with username invincible rt
[11:49:02 DEBUG] Could not find packet for RequestChunkRadiusPacket
[11:49:02 DEBUG] Could not find packet for TickSyncPacket
[11:49:02 INFO] using stored credentials for bedrock user invincible rt
[11:49:05 INFO] invincible rt (logged in as: rtm516) has connected to remote java server on address mc.peacefulvanilla.club
[11:49:05 DEBUG] Downloading and loading locale: en_gb
[11:49:05 DEBUG] Locale already downloaded: en_gb
[11:49:05 DEBUG] Could not find packet for EncryptionRequestPacket
[11:49:06 DEBUG] Could not find packet for LoginSetCompressionPacket
[11:49:06 DEBUG] Could not find packet for LoginSuccessPacket
[11:49:06 DEBUG] Could not find packet for ServerDeclareTagsPacket
[11:49:06 DEBUG] Redirecting command minecraft:tell to msg
[11:49:06 DEBUG] Sending command packet of 18 commands
[11:49:06 DEBUG] Could not find packet for ServerUnlockRecipesPacket
[11:49:06 DEBUG] Team packet 8bc056de-dadd-20 CREATE []
[11:49:06 DEBUG] Team packet mod CREATE [HeroHannah, Blyzer, Triaged, PickledFey, Omegafire22]
[11:49:06 DEBUG] Team packet magia CREATE [holzi224, roee4gaming, rxbyaa_st, Riki912, CallMeAhmed, SadCubey, Goldeneye2013, Stapledlimbs, IPurrfurPaws, MagentaBear]
[11:49:06 DEBUG] Team packet admin CREATE [Majimak_Cheoreom, zDavidMeson, Majimak, MarshallTV, Shiindaa, Myr_Satsujin, KingNeme]
[11:49:06 DEBUG] Team packet 7085932b-d2c3-2a CREATE [3DPrinterGuy]
[11:49:06 DEBUG] Team packet f5bbd195-980b-29 CREATE [Aitnys]
[11:49:06 DEBUG] Team packet vip CREATE [assasin_vini, QuintusV, mack561, soapyrose, oBCMo, giminic, IIAlphaWolfII, dino134, Omnidug, Jesterjacks, BongHIEx, Bravely_Aerosus, LittleKeineko, clarkkieboy, littleloli34, _frootloops__, sophhrose, tobarufield, CubeyOnTheTubey, keptitreal, The3DPrinterGuy, staleegg, STEEZ0S, JLong015, Lqurel, 09463, PaulyJohn, QuickFrost, GrilledWaffle17, PureLove, jlrcraft]
[11:49:06 DEBUG] Team packet 1312e769-3301-2c CREATE [MEHHG]
[11:49:06 DEBUG] Team packet 942aebef-4382-2e CREATE [MrFizzie]
[11:49:06 DEBUG] Team packet nocollisionteam CREATE [Nietzsche_1844, NemesiS_ITA]
[11:49:09 DEBUG] Could not find packet for EntityFallPacket
> [44.802s][warning][gc,alloc] Network Listener - #16: Retried waiting for GCLocker too often allocating 4140624 words
[11:49:22 WARN] A task raised an exception. Task: com.nukkitx.protocol.bedrock.BedrockServer$$Lambda$346/0x00000008004ae040@512c264b
java.lang.OutOfMemoryError: Java heap space
at net.md_5.bungee.jni.zlib.JavaZlib.process(JavaZlib.java:49) ~[nukkit-natives-1.0.1-20180920.171436-3.jar:?]
at com.nukkitx.protocol.util.Zlib.deflate(Zlib.java:88) ~[common-2.5.6-SNAPSHOT.jar:?]
at com.nukkitx.protocol.util.Zlib.deflate(Zlib.java:61) ~[common-2.5.6-SNAPSHOT.jar:?]
at com.nukkitx.protocol.bedrock.compressionhandler.DefaultBedrockCompressionHandler.compressPackets(DefaultBedrockCompressionHandler.java:51) ~[bedrock-common-2.5.6-SNAPSHOT.jar:?]
at com.nukkitx.protocol.bedrock.BedrockSession.sendWrapped(BedrockSession.java:107) ~[bedrock-common-2.5.6-SNAPSHOT.jar:?]
at com.nukkitx.protocol.bedrock.BedrockSession.sendQueued(BedrockSession.java:172) ~[bedrock-common-2.5.6-SNAPSHOT.jar:?]
at com.nukkitx.protocol.bedrock.BedrockSession.onTick(BedrockSession.java:150) ~[bedrock-common-2.5.6-SNAPSHOT.jar:?]
at com.nukkitx.protocol.bedrock.BedrockServer$$Lambda$346/0x00000008004ae040.run(Unknown Source) ~[?:?]
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute$$$capture(AbstractEventExecutor.java:163) [netty-common-4.1.43.Final.jar:4.1.43.Final]
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java) [netty-common-4.1.43.Final.jar:4.1.43.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:510) [netty-common-4.1.43.Final.jar:4.1.43.Final]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:518) [netty-transport-4.1.43.Final.jar:4.1.43.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$6.run(SingleThreadEventExecutor.java:1050) [netty-common-4.1.43.Final.jar:4.1.43.Final]
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) [netty-common-4.1.43.Final.jar:4.1.43.Final]
at java.lang.Thread.run(Thread.java:834) [?:?]
> [51.118s][warning][gc,alloc] Network Listener - #12: Retried waiting for GCLocker too often allocating 10889656 words
[11:49:27 WARN] A task raised an exception. Task: com.nukkitx.protocol.bedrock.BedrockServer$$Lambda$346/0x00000008004ae040@230fe3b1
java.lang.OutOfMemoryError: Java heap space
at net.md_5.bungee.jni.zlib.JavaZlib.process(JavaZlib.java:49) ~[nukkit-natives-1.0.1-20180920.171436-3.jar:?]
at com.nukkitx.protocol.util.Zlib.deflate(Zlib.java:88) ~[common-2.5.6-SNAPSHOT.jar:?]
at com.nukkitx.protocol.util.Zlib.deflate(Zlib.java:61) ~[common-2.5.6-SNAPSHOT.jar:?]
at com.nukkitx.protocol.bedrock.compressionhandler.DefaultBedrockCompressionHandler.compressPackets(DefaultBedrockCompressionHandler.java:51) ~[bedrock-common-2.5.6-SNAPSHOT.jar:?]
at com.nukkitx.protocol.bedrock.BedrockSession.sendWrapped(BedrockSession.java:107) ~[bedrock-common-2.5.6-SNAPSHOT.jar:?]
at com.nukkitx.protocol.bedrock.BedrockSession.sendQueued(BedrockSession.java:172) ~[bedrock-common-2.5.6-SNAPSHOT.jar:?]
at com.nukkitx.protocol.bedrock.BedrockSession.onTick(BedrockSession.java:150) ~[bedrock-common-2.5.6-SNAPSHOT.jar:?]
at com.nukkitx.protocol.bedrock.BedrockServer$$Lambda$346/0x00000008004ae040.run(Unknown Source) ~[?:?]
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute$$$capture(AbstractEventExecutor.java:163) [netty-common-4.1.43.Final.jar:4.1.43.Final]
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java) [netty-common-4.1.43.Final.jar:4.1.43.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:510) [netty-common-4.1.43.Final.jar:4.1.43.Final]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:518) [netty-transport-4.1.43.Final.jar:4.1.43.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$6.run(SingleThreadEventExecutor.java:1050) [netty-common-4.1.43.Final.jar:4.1.43.Final]
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) [netty-common-4.1.43.Final.jar:4.1.43.Final]
at java.lang.Thread.run(Thread.java:834) [?:?]
> [54.556s][warning][gc,alloc] Network Listener - #11: Retried waiting for GCLocker too often allocating 13857255 words
[11:49:31 WARN] A task raised an exception. Task: com.nukkitx.protocol.bedrock.BedrockServer$$Lambda$346/0x00000008004ae040@43e365b4
java.lang.OutOfMemoryError: Java heap space
[11:49:37 DEBUG] Could not find packet for ServerDisconnectPacket
[11:49:37 INFO] invincible rt has disconnected from remote java server on address mc.peacefulvanilla.club because of ReadTimeoutException : null
> [64.146s][warning][gc,alloc] Network Listener - #8: Retried waiting for GCLocker too often allocating 2866489 words
[11:49:40 WARN] A task raised an exception. Task: com.nukkitx.protocol.bedrock.BedrockServer$$Lambda$346/0x00000008004ae040@10ce390f
java.lang.OutOfMemoryError: Java heap space
> [64.206s][warning][gc,alloc] Network Listener - #7: Retried waiting for GCLocker too often allocating 2956509 words
[11:49:40 WARN] A task raised an exception. Task: com.nukkitx.protocol.bedrock.BedrockServer$$Lambda$346/0x00000008004ae040@2c531ac0
java.lang.OutOfMemoryError: Java heap space
> [64.259s][warning][gc,alloc] Network Listener - #6: Retried waiting for GCLocker too often allocating 2695629 words
[11:49:40 WARN] A task raised an exception. Task: com.nukkitx.protocol.bedrock.BedrockServer$$Lambda$346/0x00000008004ae040@94499ad
java.lang.OutOfMemoryError: Java heap space
> [64.734s][warning][gc,alloc] Network Listener - #10: Retried waiting for GCLocker too often allocating 2505809 words
[11:49:41 WARN] A task raised an exception. Task: com.nukkitx.protocol.bedrock.BedrockServer$$Lambda$346/0x00000008004ae040@1761c689
java.lang.OutOfMemoryError: Java heap space
> [64.777s][warning][gc,alloc] Network Listener - #12: Retried waiting for GCLocker too often allocating 4150609 words
[11:49:41 WARN] A task raised an exception. Task: com.nukkitx.protocol.bedrock.BedrockServer$$Lambda$346/0x00000008004ae040@b613b5c
java.lang.OutOfMemoryError: Java heap space
> [64.814s][warning][gc,alloc] Network Listener - #17: Retried waiting for GCLocker too often allocating 2426166 words
[11:49:41 WARN] A task raised an exception. Task: com.nukkitx.protocol.bedrock.BedrockServer$$Lambda$346/0x00000008004ae040@2c40a6c1
java.lang.OutOfMemoryError: Java heap space
> [64.860s][warning][gc,alloc] Network Listener - #28: Retried waiting for GCLocker too often allocating 1193977 words
[11:49:41 WARN] A task raised an exception. Task: com.nukkitx.protocol.bedrock.BedrockServer$$Lambda$346/0x00000008004ae040@5d7cd15b
java.lang.OutOfMemoryError: Java heap space
> [64.899s][warning][gc,alloc] Network Listener - #3: Retried waiting for GCLocker too often allocating 4032407 words
[11:49:41 WARN] A task raised an exception. Task: com.nukkitx.protocol.bedrock.BedrockServer$$Lambda$346/0x00000008004ae040@97588e5
java.lang.OutOfMemoryError: Java heap space
[11:50:12 INFO] Bedrock user with ip: /127.0.0.1 has disconnected for reason TIMED_OUT
Oh thank you rtm for confirming! I was going to lose my mind.
I ran another test.
This means that the problem relies in two things:
As i already proven many times, TCP Shield is not involved here. And plugins too..
I use geyser on a seperate machine (a vps with 2 gigs too) and I give it only 512 mb (it's my test vps so I don't care if it lag) and geyser connect (with online mode to floodgate) to my bungeecord (with floodgate, of course) and then to a paper 1.14.4 with via version (_and lot more plugins_) and ... it works
so maybe the fact that you're using the online mode is the issue here ?
I use geyser on a seperate machine (a vps with 2 gigs too) and I give it only 512 mb (it's my test vps so I don't care if it lag) and geyser connect (with online mode to floodgate) to my bungeecord (with floodgate, of course) and then to a paper 1.14.4 with via version (_and lot more plugins_) and ... it works
so maybe the fact that you're using the online mode is the issue here ?
Just tried:
[13:48:46 INFO] Registering bedrock skin for Nifty_Nemesis (00000000-0000-0000-0009-01f2ef40af68)
[13:48:46 INFO] Unable to load bedrock skin for 'Nifty_Nemesis' as they are likely using a customised skin/root/Geyser/loop.sh: line 11: 987 Killed java -Xms1500M -Xmx1500M -jar Geyser.jar
Killed due to free memory
On windows, with 10GB allocated to geyser:
[13:55:40 INFO] Registering bedrock skin for Nifty_Nemesis (00000000-0000-0000-0009-01f2ef40af68)
[13:55:40 INFO] Unable to load bedrock skin for 'Nifty_Nemesis' as they are likely using a customised skin
[13:56:12 INFO] Nifty Nemesis has disconnected from remote java server on address 164.132.200.107 because of ReadTimeoutException : null
[13:56:20 INFO] Bedrock user with ip: /192.168.1.245 has disconnected for reason TIMED_OUT
Enabling debug mode on windows:
ose, tobarufield, CubeyOnTheTubey, keptitreal, The3DPrinterGuy, staleegg, STEEZ0S, JLong015, Lqurel, 09463, PaulyJohn, QuickFrost, GrilledWaffle17, PureLove, jlrcraft]
[14:04:40 DEBUG] Team packet 1312e769-3301-2c CREATE [MEHHG]
[14:04:40 DEBUG] Team packet nocollisionteam CREATE [Nietzsche_1844, NemesiS_ITA]
[14:04:45 DEBUG] Could not find packet for EntityFallPacket
[14:05:11 DEBUG] Could not find packet for ServerDisconnectPacket
[14:05:11 INFO] Nifty Nemesis has disconnected from remote java server on address 164.132.200.107 because of ReadTimeoutException : null
[14:05:25 INFO] Bedrock user with ip: /192.168.1.245 has disconnected for reason TIMED_OUT
Plus, it gets detected as uuid spoofing by ExploitFixer, that i installed today on bungee. I disabled it for now just for testing.
Meanwhile, on bungeecord's console:
12:05:10 [WARNING] [Nifty_Nemesis] -> UpstreamBridge - read timed out
12:05:10 [INFO] [Nifty_Nemesis] disconnected with: ReadTimeoutException : null
12:05:10 [INFO] [Nifty_Nemesis] -> UpstreamBridge has disconnected
12:05:10 [INFO] [Nifty_Nemesis] <-> DownstreamBridge <-> [pvc] has disconnected
12:05:10 [INFO] Removed Nifty Nemesis 00000000-0000-0000-0009-01f2ef40af68
yeah I know for exploit fixer, I had it, but mine is working ... if you want I can do some testing for you but it seems strange it's working nicely for me ..... I think there's something with your minecraft server, like a plugins that kick the player (sometime my server kicks me for flying, but I know that and it happens like 1 time out of 20 so that's not a big deal with me) and most likeley you don't have a fallback server, or else I'm completely wrong. And if I'm being honest, I truly think I'm wrong because rtm516 could reproduce your bug ...
I'm wondering if it's because my test geyser is most likely not updated since like a week ....
It's quite helpful to update your Geyser whenever possible at this point. And if you then get the error it could help us narrow things down.
I'll do that but my connection is like a potatoe with wheel so it'll take at leat 10-15 mimnutes to download and upload
I've got a bad new (and a good for me), it's working I don't know if I didn't understand somthing (wich I think is the case), but if it can be useful here's my bungee and paper version (not the latest I think ?) (I did have to put myself in gamemode creative due to the flying detection issue)
I have the same viaversion version as you do

Some answers:
A question:
Is your geyser on the same machine of the server? Separated machines?
I did some other testing:
opened a fresh new paper 1.15 server on my java server's machine
connected to it using geyser on laptop
it worked (worked offline, online and floodgate)
tried instantly again to connect to my old bungee server
crashed (online)
This means it's not my machine's fault.
It's something related to the combo of that bungee + that paper.
Tomorrow il try again with zero plugins enabled, to be 300% sure.
If that does not work, it means that there is something with bungee. and i will post the config.
I Finally located where the issue stands
I opened an exact copy of my server, without plugins, on the same machine. This copy was not under the Bungeecord proxy and could be accessed directly using IP + Different port.
It worked! Offline, online and i guess also Floodgate would have worked too.
Then, i moved that installation under Bungeecord, setting it as the default forced host... guess what? Same error. This exception was printed out on windows. Did not test it on my vps but i guess this would have crashed due to the same memory issue (on windows i allocated it 10gb of ram):
Then i upgrarded the server, moving from 1.14 + viaversion to 1.15 without viaversion. Same issue. Could not connect.
This means that the problem relies in bungeecord.
This is my actual bungeecord configuration with IPs stripped off for privacy reasons:
well here's my bungee config, it's working (for me at least) (I erased every IP adress with "----")
config.txt (I deleted it)
I will try to compare ours but I didn't see anything at first glance so maybe it's due to a bungee plugins ?
According to the Discord, Leonardo solved it through switching out the world.
oh well that's a good thing for him, maybe he should close this issue now
There's still something about that world that caused him to crash, so I'm leaving this open until we figure out the root of the problem.
ok well I had an issue where my bedrock client crashed but it was fixed and it was due to some block (lectern I think it was), so maybe paper send the world in a way that's way to much for geyser to handle and it crashes geyser ?
We determined this issue was the scoreboard.dat file in the world. Because of the initial broadness of this issue and its age, I'm closing this in favor of #896.
Most helpful comment
-Xmx1G -Xms2Gdon't these flags mean that you have a maximum of 1GB and a minimum of 2GB? If you were able to get it working anyway that may not be the problem but try switching them around anyway.