Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MeshRef is leaking memory causing lag spikes #5280

Open
nillawafers4u opened this issue Feb 11, 2025 · 8 comments
Open

MeshRef is leaking memory causing lag spikes #5280

nillawafers4u opened this issue Feb 11, 2025 · 8 comments
Labels
department: code Issues apparently caused by code priority: medium Bugs and nuisances that need attention, minor exploits status: confirmed Issue is acknowledged / can be reproduced target: performance Low FPS, lag spikes, etc... version: 1.20 Issues introduced in 1.20

Comments

@nillawafers4u
Copy link

nillawafers4u commented Feb 11, 2025

Game Version

v1.20.3

Platform

Windows

Modded

Modded

SP/MP

Multiplayer

Description

for some reason myself and one other player on my server have random ping spikes, anywhere from 100ms to 1000ms. another play on the server has no issues whatsoever when this is going on. The server runs on a dedicated machine and monitoring the resources seems to be doing just fine even in the moments this happens. Furthermore I have run a continual ping from my machine to the server computer using the same local IP i connect with and the response time never goes beyond 50 at the most. I have noticed some oddities in my logs whenever this happens such as:

11.2.2025 10:17:36 [Debug] MeshRef with vao id 46326 with 252 indices is leaking memory, missing call to Dispose. Allocated at    at System.Environment.get_StackTrace()
   at Vintagestory.Client.NoObf.ClientPlatformWindows.UploadMesh(MeshData data) in C:\Users\Tyron\Documents\vintagestory\game\VintagestoryLib\Client\ClientPlatform\GLMeshBuffer.cs:line 765
   at Vintagestory.Client.RenderAPIBase.UploadMultiTextureMesh(MeshData data) in C:\Users\Tyron\Documents\vintagestory\game\VintagestoryLib\Client\API\RenderAPIBase.cs:line 86
   at Vintagestory.GameContent.EntityShapeRenderer.<>c__DisplayClass46_1.<TesselateShape>b__1() in C:\Users\Tyron\Documents\vintagestory\game\VSEssentials\EntityRenderer\EntityShapeRenderer.cs:line 283
   at Vintagestory.Client.NoObf.ClientMain.ExecuteMainThreadTasks(Single deltaTime) in C:\Users\Tyron\Documents\vintagestory\game\VintagestoryLib\Client\ClientMain.cs:line 775
   at Vintagestory.Client.GuiScreenRunningGame.RenderToPrimary(Single dt) in C:\Users\Tyron\Documents\vintagestory\game\VintagestoryLib\Client\MainMenu\Screens\GuiScreenRunningGame.cs:line 170
   at Vintagestory.Client.ScreenManager.Render(Single dt) in C:\Users\Tyron\Documents\vintagestory\game\VintagestoryLib\Client\ScreenManager.cs:line 712
   at Vintagestory.Client.ScreenManager.OnNewFrame(Single dt) in C:\Users\Tyron\Documents\vintagestory\game\VintagestoryLib\Client\ScreenManager.cs:line 656
   at Vintagestory.Client.NoObf.ClientPlatformWindows.window_RenderFrame(FrameEventArgs e) in C:\Users\Tyron\Documents\vintagestory\game\VintagestoryLib\Client\ClientPlatform\GameWindow.cs:line 120
   at OpenTK.Windowing.Desktop.GameWindow.Run()
   at Vintagestory.Client.ClientProgram.Start(ClientProgramArgs args, String[] rawArgs) in C:\Users\Tyron\Documents\vintagestory\game\VintagestoryLib\Client\ClientProgram.cs:line 334
   at Vintagestory.Client.ClientProgram.<>c__DisplayClass10_0.<.ctor>b__1() in C:\Users\Tyron\Documents\vintagestory\game\VintagestoryLib\Client\ClientProgram.cs:line 130
   at Vintagestory.ClientNative.CrashReporter.Start(ThreadStart start) in C:\Users\Tyron\Documents\vintagestory\game\VintagestoryLib\Client\ClientPlatform\ClientNative\CrashReporter.cs:line 93
   at Vintagestory.Client.ClientProgram..ctor(String[] rawArgs) in C:\Users\Tyron\Documents\vintagestory\game\VintagestoryLib\Client\ClientProgram.cs:line 130
   at Vintagestory.Client.ClientProgram.Main(String[] rawArgs) in C:\Users\Tyron\Documents\vintagestory\game\VintagestoryLib\Client\ClientProgram.cs:line 48
   at Vintagestory.ClientWindows.Main(String[] args) in C:\Users\Tyron\Documents\vintagestory\game\VintagestoryClient\Windows\ClientWindows.cs:line 9.

The strangest part to me is that as stated before it only affects some players connecting. Where they connect from seems to make no difference as even I am affected when connecting over my local network.

How to reproduce

the only thing that seems to reproduce this ping spikes is moving around in the world. I think its anytime a new block is rendered, as staying completely still seems to stop it from occurring.

Screenshots

No response

Logs

client-debug.log

client-main.log

@nillawafers4u nillawafers4u added the status: new This issue is fresh! label Feb 11, 2025
@nillawafers4u
Copy link
Author

forgot to mention as well I run the game on a windows 11 PC with 32gb of ram. My hardware doesn't really seem to be making out when these spike happen either ( I had my resource manager open while testing to see)

@Craluminum2413
Copy link
Collaborator

Craluminum2413 commented Feb 11, 2025

Caused by some mod. I can't reproduce it in vanilla

@Craluminum2413 Craluminum2413 closed this as not planned Won't fix, can't repro, duplicate, stale Feb 11, 2025
@Craluminum2413 Craluminum2413 added 3rd party issue Issues caused by your drivers, OS setup, or mods and removed status: new This issue is fresh! labels Feb 11, 2025
@nillawafers4u
Copy link
Author

I believe this might be something in vanilla since it still persists without any mods.

I will attach the logs from my game after doing a complete reinstall. The same errors and ping spikes persist. Also I'd also like to note that this issue only started occurring after updating from 1.20.1 to 1.20.3. downgrading does not seem to fix the issue though. Maybe I'm still missing something. Just thought I'd provide more information.

client-debug.log
client-main.log

@Craluminum2413
Copy link
Collaborator

Craluminum2413 commented Feb 11, 2025

Enable these settings, load the game then send logs again
Image
Image

@nillawafers4u
Copy link
Author

As requested. I went ahead and wiped the server I'm hosting too before getting these new logs, so fresh world and all too.

client-debug.log
client-main.log

@Craluminum2413
Copy link
Collaborator

Craluminum2413 commented Feb 11, 2025

@nillawafers4u Do you get these errors in normal world?

@Craluminum2413
Copy link
Collaborator

Ok I reproduced it

@Craluminum2413 Craluminum2413 added status: confirmed Issue is acknowledged / can be reproduced department: code Issues apparently caused by code version: 1.20 Issues introduced in 1.20 target: performance Low FPS, lag spikes, etc... priority: medium Bugs and nuisances that need attention, minor exploits and removed 3rd party issue Issues caused by your drivers, OS setup, or mods labels Feb 11, 2025
@Craluminum2413 Craluminum2413 changed the title Ping spikes on local server MeshRef is leaking memory and causes a ton of lag spikes Feb 11, 2025
@Craluminum2413 Craluminum2413 changed the title MeshRef is leaking memory and causes a ton of lag spikes MeshRef is leaking memory causing lag spikes Feb 11, 2025
@thelyric27
Copy link

I was experiencing this issue too, causing spikes of lag and also freezing chunk loading in my world, it was really frustrating. MeshRef with vao id 40899 with 1932 indices. But even more frustratingly, I couldn't replicate the issue after turning on debug logging. In the world I was playing the chunks still wouldn't load but the meshref error never showed up in the log. I tried two other worlds and in one, traveled 8000 blocks from spawn thinking it was some particular block or item causing it, but suddenly chunks would load smoothly and without delay, I could sprint in one direction for in-game hours.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
department: code Issues apparently caused by code priority: medium Bugs and nuisances that need attention, minor exploits status: confirmed Issue is acknowledged / can be reproduced target: performance Low FPS, lag spikes, etc... version: 1.20 Issues introduced in 1.20
Projects
None yet
Development

No branches or pull requests

3 participants