Sodium

Sodium

35M Downloads

lag spikes

PhanaticD opened this issue ยท 5 comments

commented

I kept getting annoying lag spikes in my game ~200ms spikes while rendering, so I used jprofiler in exception mode and ended up at WorldRender.setupTerrain and after looking in the code for that class and noticing mojang records info in debug mode turned that on and ended up with this:

[11:36:56] [main/WARN]: Something's taking too long! 'root.gameRenderer.level.terrain_setup.chunk_graph_rebuild' took aprox 202.4829 ms
[11:36:56] [main/WARN]: Something's taking too long! 'root.gameRenderer.level.terrain_setup' took aprox 203.3035 ms
[11:36:56] [main/WARN]: Something's taking too long! 'root.gameRenderer.level' took aprox 206.881 ms
[11:36:56] [main/WARN]: Something's taking too long! 'root.gameRenderer' took aprox 209.3182 ms
[11:36:56] [main/WARN]: Something's taking too long! 'root' took aprox 212.749 ms
[11:37:00] [main/WARN]: Something's taking too long! 'root.gameRenderer.level.terrain_setup.chunk_graph_rebuild' took aprox 175.1971 ms
[11:37:00] [main/WARN]: Something's taking too long! 'root.gameRenderer.level.terrain_setup' took aprox 175.4746 ms
[11:37:00] [main/WARN]: Something's taking too long! 'root.gameRenderer.level' took aprox 177.2017 ms
[11:37:00] [main/WARN]: Something's taking too long! 'root.gameRenderer' took aprox 179.1642 ms
[11:37:00] [main/WARN]: Something's taking too long! 'root' took aprox 180.6455 ms
[11:37:01] [main/WARN]: Something's taking too long! 'root.gameRenderer.level.terrain_setup.chunk_graph_rebuild' took aprox 198.778 ms
[11:37:01] [main/WARN]: Something's taking too long! 'root.gameRenderer.level.terrain_setup' took aprox 199.2105 ms
[11:37:01] [main/WARN]: Something's taking too long! 'root.gameRenderer.level' took aprox 202.2354 ms
[11:37:01] [main/WARN]: Something's taking too long! 'root.gameRenderer' took aprox 205.2204 ms
[11:37:01] [main/WARN]: Something's taking too long! 'root' took aprox 206.2749 ms
[11:37:04] [main/WARN]: Something's taking too long! 'root.gameRenderer.level.terrain' took aprox 180.431799 ms
[11:37:04] [main/WARN]: Something's taking too long! 'root.gameRenderer.level' took aprox 181.854801 ms
[11:37:04] [main/WARN]: Something's taking too long! 'root.gameRenderer' took aprox 184.8024 ms
[11:37:04] [main/WARN]: Something's taking too long! 'root' took aprox 185.5262 ms
[11:37:12] [main/WARN]: Something's taking too long! 'root.gameRenderer.level.terrain' took aprox 173.7122 ms
[11:37:12] [main/WARN]: Something's taking too long! 'root.gameRenderer.level' took aprox 176.5802 ms
[11:37:12] [main/WARN]: Something's taking too long! 'root.gameRenderer' took aprox 181.4686 ms
[11:37:12] [main/WARN]: Something's taking too long! 'root' took aprox 184.2889 ms
[11:37:18] [main/WARN]: Something's taking too long! 'root.tick.textures' took aprox 206.3186 ms
[11:37:18] [main/WARN]: Something's taking too long! 'root.tick' took aprox 208.1932 ms
[11:37:18] [main/WARN]: Something's taking too long! 'root' took aprox 213.6933 ms
[11:37:24] [main/WARN]: Something's taking too long! 'root.gameRenderer.level.terrain' took aprox 159.9088 ms
[11:37:24] [main/WARN]: Something's taking too long! 'root.gameRenderer.level' took aprox 162.8368 ms
[11:37:24] [main/WARN]: Something's taking too long! 'root.gameRenderer' took aprox 167.2139 ms
[11:37:24] [main/WARN]: Something's taking too long! 'root' took aprox 168.744 ms
[11:37:28] [main/WARN]: Something's taking too long! 'root.tick.textures' took aprox 181.9012 ms
[11:37:28] [main/WARN]: Something's taking too long! 'root.tick' took aprox 183.3395 ms
[11:37:28] [main/WARN]: Something's taking too long! 'root' took aprox 189.7904 ms
[11:37:32] [main/WARN]: Something's taking too long! 'root.gameRenderer.level.terrain_setup.chunk_graph_rebuild' took aprox 167.832 ms
[11:37:32] [main/WARN]: Something's taking too long! 'root.gameRenderer.level.terrain_setup' took aprox 168.0994 ms
[11:37:32] [main/WARN]: Something's taking too long! 'root.gameRenderer.level' took aprox 172.4344 ms
[11:37:32] [main/WARN]: Something's taking too long! 'root.gameRenderer' took aprox 174.4276 ms
[11:37:32] [main/WARN]: Something's taking too long! 'root' took aprox 178.6184 ms
[11:37:32] [main/WARN]: Something's taking too long! 'root.gameRenderer.level.terrain_setup.chunk_graph_rebuild' took aprox 179.2551 ms
[11:37:32] [main/WARN]: Something's taking too long! 'root.gameRenderer.level.terrain_setup' took aprox 179.5138 ms
[11:37:32] [main/WARN]: Something's taking too long! 'root.gameRenderer.level' took aprox 183.0383 ms
[11:37:32] [main/WARN]: Something's taking too long! 'root.gameRenderer' took aprox 184.4413 ms

I do not know how to fix it but I hope you guys can :D

Attachments

example spike, usually occurs every few seconds: https://i.gyazo.com/7b0ace314438a994ef1e79c4ad3c7a7b.png

System Information

https://i.gyazo.com/2397e386b634d08fa2868ed8c9ce6ad2.png

commented

Do you encounter these spikes with vanilla as well or just with Sodium?
Could you upload a crash report triggered by holding F3+C?
Do the spikes coincide with a drop in memory usage as shown in the top right of the F3 screen? If they do, try reducing your RAM allocation to 2G or 4G.
A better place to debug this would be the #mod-support channel in the Caffeine Discord: https://jellysquid.me/discord

commented

they happen with just fabric loader with and without mods, with vanilla or optifine I do not notice any lag spikes

crash: https://paste.gg/p/PhanaticD/84d18a0f84f14366a23a24d34c4d82e6

java settings were originally 2g I changed that a bunch, default, ZGC, higher, lower, it had no effect, and the spikes do not line up with gc changes

commented

If the spikes occur with no mods, it's not a Sodium issue. I or someone else can help you to try and diagnose the issue in the Discord if you'd like, but this issue tracker isn't the place.

commented

isnt sodium meant to help with FPS issues? or should I report it to fabric

commented

The issue is likely somewhere in your setup - you can get help diagnosing exactly what's wrong in the discord