3
Weird frame rate issue on Java 1.19.2
Hello,
I run a Minecraft server to play with my friends on my computer and sometimes play on it as well, from the same computer. This shouldn't matter as the bug sometimes happens on singleplayer with the integrated server, or when the separate server is running. I strongly suspect it would also happen on external multiplayer servers if I played on these.
I have a 75hz monitor, and my game runs perfectly at 75fps at 12 render distance when not traveling by boat or elytra. However, sometimes, instead of each frame taking 13ms to render, each other frame will take exactly double that and the rest takes half of the time so 6ms. (Frame 1 takes 6ms, frame 2 takes 26ms etc ). This makes my perceived frame rate basically be 37fps. I have a bad computer, but that doesn't explain this bug. The average frame rate stays at 75.
My specs:
-8gb RAM, 1.5 allocated to both the server and client, and 3gb in total is almost overkill for a world with 3 players.
-Ryzen 3 5300u with integrated graphics
-OS: "I use arch btw", if you don't know the meme look it up, anyways seriously I use Linux, the specific distribution shouldn't matter to a Java game.
Mods used: most of them are performance mods:
-Sodium, Lithium, Hydrogen, FerriteCore
-Fabric and Fabric API
-LayzdfU
-Starlight and a dynamic lighting mod
-Xaero's minimap and world map
-Entity culling
-Other small FPS boost mods, but that shouldn't matter as I tried disabling all mods except for Sodium, Fabric, Lithium, Fabric API, as these improve performance
The issue happens randomly, and only restarting the entire client can solve it. Definitely puzzling, as if the game only did math or rendering on alternate frames...
Thank you for your help!
8
If you search "Ryzen 3 5300u for Minecraft" you'll see a lot of problem threads about fps. I'd be curious to know if you don't have that problem on earlier versions (1.16-1.17) seems like 1.18+ have had a lot of problems for lower end users.
When the glitch happens, GPU usage is normal. During normal gameplay it never exceeds 30% while building, 50% by boat and 75% when flying. I don't understand why I'm not getting 150-ish FPS. What could be the bottleneck? I will try to screenshot the FPS graph when the bug happens, but it might be tomorrow or in 2025, who knows?
PS. I only got Java this summer, and before on Bedrock performance was also sub-par for my specs. I can't really answer that though. Mojang should plug their memory leaks, and untangle their spaghetti code!
PS. I only got Java this summer, and before on Bedrock performance was also sub-par for my specs. I can't really answer that though. Mojang should plug their memory leaks, and untangle their spaghetti code!
You can load up profiles in the launcher and test old versions
try increasing ram to 3GB on client and remove the mods and see what happens
3gb is too much. Even with 1.5gb client and same for server, ram usage gets up to 90%. Actual JVM ram usage in task manager is almost 2* higher than specified, and once more than 99.4% exactly of my ram is used, Wayland (a Linux display manager) will crash, leaving me with a hanging system. The only way out is Ctrl alt F1 to get to the login screen. Anyways Minecraft never even allocates 1536 mb. The allocation stays at around 1.1gb and actual usage is 400-1000 mb, so why would more RAM help when Minecraft doesn't allocate it?
3GB for client
1.5GB for server - not sure why you want to run a server and client on the same machine that that low specs
500MB for integrated graphics
3GB for linux? jeeze you must really have broken something
1.5GB for server - not sure why you want to run a server and client on the same machine that that low specs
500MB for integrated graphics
3GB for linux? jeeze you must really have broken something
As I said, the "1.5 gb " I specified is actually 2.5gb of usage for some reason, but on the F3 screen it still says 1536mb. Linux doesn't use 3gb, more like 1.4gb of ram. Is it normal that the JVM uses way more than the allocated amount of RAM? I run a server because I want to play with my friends that are tens or hundreds of miles away. I'll send some screenshots when I get home, maybe Sunday, maybe Friday next week.
The solution was simple: turn off VSYNC! For some reason, with capped frame rates, lag spikes are way more common, and VSYNC introduced the fps bug when using Sodium (still preferred disabling VSYNC, as without Sodium I get about 40 fps, with the mod I get 140 fps, even with immersive portal). However, that's going to cook my GPU 😂.
Is it actually normal that the Java process uses 1 more gigabyte than what's specified in the Xmx variable in the JVM properties? Shouldn't it be equal to allocated ram plus off heap ram (300 mb for me), so 1800mb, and definitely not 2500mb?
Is it actually normal that the Java process uses 1 more gigabyte than what's specified in the Xmx variable in the JVM properties? Shouldn't it be equal to allocated ram plus off heap ram (300 mb for me), so 1800mb, and definitely not 2500mb?
