Mods / Client MeshRef Leak Fix
- Tags:
- Author:
- IllLeroySquad
- Side:
- Client
- Created:
- Aug 22nd at 11:42 PM
- Last modified:
- Aug 25th at 2:53 AM
- Downloads:
- 1950
-
Recommended download (for Vintage Story 1.22.0 - 1.22.7):
vsvaogc_1.1.4.zip 1-click install
Client only. Your server does not need this. Drop the zip in Mods and leave it zipped. If you extracted an older version, delete those old vsvaogc folders first or the game gets weird about it.
Ever notice Vintage Story feels great when you first load in, then a couple hours later everything starts hitching and FPS is just... worse? Yeah. The game sometimes forgets to clean up old 3D mesh data on your GPU. That junk piles up. This mod cleans it up in the background so you do not have to restart all the time.
No settings to tweak. No hotkeys. Install it and play.
You might want this if
- Session starts smooth, gets worse the longer you play
- Hitching creeps back after 45-90 minutes
- Opening inventory / handbook / certain items seems to make it pile up
- Turning graphics down helped for a bit, then the slide came back anyway
What it will not fix
- Cranking view distance / lights / HD packs until your GPU is already maxed
- Chunk stutter when you fly around like a maniac
- Lag from the server
This is a memory leak fix, not a magic "max settings for free" button.
Optional nerd stuff
Type .vaogc in chat if you want to see queued / reclaimed / pending. Most people can ignore that.
Source is on the listing now (GitHub link up top) and MIT if you want to poke at it.
My testing
- Game: 1.22.6
- Box: Ryzen 9 5950X, 64 GB RAM, RTX 3090
- Packs: TrueScale 128 HD on a vanilla+ multiplayer server
- Before: ~150 FPS at the start, then slide + hitch after a long session
- After: held ~152 FPS for 36+ minutes with no leak buildup (earlier high-settings run was closer to ~199 FPS)
Latest is 1.1.4. Grab that one.
For modders
Vanilla VAO.Finalize logs undisposed MeshRefs and never calls Dispose(). GL cleanup has to happen on the render thread. We queue those and dispose them there. No GC.Collect, no input injection. Related: #8488 · #9712
| Mod Version | Mod Identifier | For Game version | Downloads | Released | Changelog | Download | 1-click mod install* |
|---|---|---|---|---|---|---|---|
| 1.1.4 | vsvaogc | 1380 | Aug 25th at 2:53 AM | vsvaogc_1.1.4.zip | 1-click install | ||
|
1.1.4
Looked at the crash report from Solomob422. The NullReferenceException is inside Butchering EntityBehaviorButcherable.Initialize while an entity was spawning from a network packet (creative, flying into unloaded chunks). vsvaogc shows up under Involved Harmony IDs because we postfix ClientMain.ExecuteMainThreadTasks, same bucket as OptiTime. That listing is expected whenever anything on the main thread throws.
Hardening this release anyway: - Outer try/catch on the Finalize prefix (falls back to vanilla Finalize on failure) - Outer try/catch on the ExecuteMainThreadTasks drain postfix so a dispose/queue failure cannot crash the client - Still no GC.Collect, no key injection, DLL-only zip | |||||||
| 1.1.3 | vsvaogc | 238 | Aug 23rd at 6:48 PM | vsvaogc_1.1.3.zip | 1-click install | ||
|
1.1.3
| |||||||
| 1.1.2 | vsvaogc | 257 | Aug 23rd at 12:16 AM | vsvaogc_1.1.2.zip | 1-click install | ||
|
1.1.2 — DLL-only load fix. The 1.1.1 zip included 1.1.2 ships DLL-only at zip root ( No gameplay or input changes. No Does not fix GPU-bound hitch at view 1536 / max lights / HD packs. | |||||||
| 1.1.1 | vsvaogc | 41 | Aug 22nd at 11:59 PM | vsvaogc_1.1.1.zip | 1-click install | ||
|
1.1.1 — No render-thread GC.Collect. No key injection. No cursor warp. VAO queue + Dispose only. Hitch threshold raised so FrameGuard no longer pulses on every 28ms frame. | |||||||
| 1.1.0 | vsvaogc | 34 | Aug 22nd at 11:44 PM | vsvaogc_1.1.0.zip | 1-click install | ||
|
1.1.0 — Initial public release. Client-only Harmony fix for the MeshRef/VAO leak: queue undisposed VAOs from VAO.Finalize and call Dispose() on the GL/render thread via ClientMain.ExecuteMainThreadTasks (16/frame). Chat command: | |||||||

i'm getting this crash on reentering a singleplayer world without restarting the client
Running on 64 bit Windows 10.0.26200.0 with 28524 MB RAM
Game Version: v1.22.7 (Stable) + Optimum v0.3.18
30-09-2026 10:38:36: Critical error occurred
Loaded Mods: advancedsmithing@1.4.0, allsideshaveresin@1.0.0, bearbones@1.0.0, betterforest@0.1.2, birdseye@0.1.4, bloomeryfulldrops@1.0.0, butcheringmatcompat@0.0.2, cbr@2.0.1, chiselpie@1.0.2, chiseltools@1.17.7, claybrickforming@1.0.0, clickuptorches@1.1.1, containersbundle@1.3.2, crawlanddive@0.2.5, crockmod@2.1.1, cutthefat@2.0.0, darkvision@1.3.6, diversediets@1.0.4, dryablegroundstorage@1.0.1, DrystoneParity@1.0.0, dyehard@1.0.0, effortlessstructures@0.2.0, fixedpaths@1.0.2, flintsaw@1.0.1, flintchisel@1.0.5, freeformclay@0.5.0, geoaddons@1.4.8, grasstoropes@1.2.4, instantpickup@1.1.4, interestingoregen@2.3.8, jsonpatcheslib@1.5.9, kilnshelves@1.1.8, madmechanics@1.0.1, moartar@1.0.0, morecalcinedflint@1.0.0, moredrygrassfix@1.1.0, moredrygrass@0.2.0, morepolishedrocks@1.0.3, MoreStoneDrops@1.0.0, moretorchholders@1.0.1, oillampignites@1.0.0, quicklimepkfix@1.1.1, radialcrafting@0.2.7, scrollrackable@1.5.3, spinningwheel@1.2.14, stoneharvesting@1.2.2, stonemallet@1.0.4, stonequarryrepckfipil@3.6.3, stoneroads@1.1.1, meapineapplefatcandle@1.0.1, universalsticks@1.2.0, unpackeddirt@1.2.1, game@1.22.7, wlts@1.0.1, accessibilitytweaks@5.1.0, aculinaryartillery@2.0.0-dev.26, algernonsterrainsampler@1.3.0, ancientlib@1.0.0, ancienttoolsresinharvest@1.0.0, animalcages@5.0.1, attributerenderinglibrary@3.2.0, augur@1.2.1, egocaribautomapmarkers@5.0.3, balanceddiet@0.3.0, beamtweaksmod@2.1.1, betteranthracite@1.0.2, bettererprospecting@3.4.10, betterfruitpress@1.2.1, betterpyrolysis@1.1.4, betterruins@0.6.4, biodiversity@1.1.4, charcoalblasting@1.1.0, blocksoverlay@4.15.0, botanicalleathers@1.3.2, butchering@1.14.3, candlesplease@1.0.1, carryon@1.14.3, charcoalkiln@1.2.0, chiseleverywhere@0.7.1, composterrepack@0.3.2, configkit@1.4.1, configurableroomsize@1.3.2, configureeverything@3.0.0, cruciblesstayhot@1.0.2, customstoragesize0qpchissel@1.1.0, customstoragesize@1.1.0, danatweaks@4.1.0, directionalsmithing@1.1.0, dragchisel@1.0.1, dovidarium@0.9.5, extrainfo@2.2.1, fastcraftinggrid@1.0.4, fastmap@122.6.0-dev.2, fennelswag@1.5.7, fillmybloomery@1.0.3, foodshelves@3.1.0, fornax@1.8.0, gardenersdelight@1.0.2, geologymap@1.1.0, glassview@1.3.0, goodhunting@1.4.7, handbookcrashguard@1.0.5, handbookdeclutterer@2.0.1, helvehammerextcontinued@1.9.1, immersivemodularbackpacks@1.7.10, improvedhandbookrecipesfork@1227.0.5, justthepepper@3.0.1, kilnspreading@1.0.2, knapster@4.1.1, leanable@1.0.7, lumos@1.1.5, mapteleporter@1.2.1, mnflowers@2.0.0, mngeology@2.0.10, materialneeds@2.0.0, mealrevariation@3.2.1, medievalexpansionpatch@1.4.1, mightywalnut@1.4.0, morefogplease@0.0.2, morepiles@3.0.1, ndlclayworks@1.1.1, ndlmushroomgrowth@2.4.4, ndltreegrowth@2.8.0, ndlwoodentorchholder@3.1.0, needpolishedrocks@1.2.0, nomusicinterruptionmod@1.0.0, nowplayingsong@1.0.2, openhand@1.1.2, orekiwoofsbeehives@2.0.0, packrat@1.2.3, petai@5.1.2, pinmatrix@1.7.1, placeonslabs@1.2.0, purposefulstorage@2.1.1, quernrendererfix@1.0.0, quickfind@1.1.0, rapdisinbucket@1.0.0, roamingbees@2.0.0, shadehouse@1.7.0, smithingplusplus@1.10.6, snowcaps@0.0.1, stablesurface@0.0.3, stackedtemporalgear@1.0.0, statushudcont@4.4.0, swapoffhandhotkey@0.1.2, synergy@1.1.25, tabfix@1.0.2, targethealth@1.1.1, terraprety@7.11.1, Thatch2Grass@1.0.1, unchiseloption@1.0.0, universalhusbandry@1.2.1, usefuloils@1.0.0, vanillamoremolds@2.2.0, veinminerrevamp@1.4.0, vintagehorizons@0.3.1, creative@1.22.7, vsroofing@2.0.5, survival@1.22.7, vsvaogc@1.1.4, veganfat@2.2.0, watersheds@7.0.4, woodenwrench@1.0.0, zippyscattailstew@1.1.0, ancienttoolsmortar@1.0.0, betterhoneymod@1.1.2, bdcrop@1.1.1, bdorchard@1.0.6, bdtree@1.0.4, butcheringcompatpatch@1.1.0, butcheringtooldurability@1.0.0, chiseledgroundplacement@0.2.2, chiseledwallmounting@0.3.2, clearquartzmod@1.0.1, rlldtco0001@2.3.2, densegroundstorage@0.3.3, dgsfixes@1.0.0-dev.4, driftersdontspawninrooms@2.3.0, expandedfoods@2.0.0-dev.15, em@3.8.1, flaxtwinecuttermod@1.0.0, greenerytheme@1.0.1, gridforbeams@2.2.196, medievalarchitecture@1.1.1, modularbutcheringbag@1.0.2, moreusesforpeat@0.2.1, mushroomleathermod@1.1.4, obsidiancraft@2.0.1, oillampsanywhere@1.1.0, packmycob@1.0.1, paperfletchingmod@1.0.2, sharonstanninshortcut@1.0.0, soilamendments@1.0.0, storagetweaks@1.4.1-rc.3, universaldisplaylib@1.1.3, vsfarmlandtweaks@1.0.1, vsroofinggrassaddon@1.1.1, waxfatmod@1.2.5, wolftaming@5.0.1, zrustdrops@2.1.1, bloodisegg@2.1.0, cauldronalchemy@1.0.0, efchefstricks@1.0.0-dev.5, efmealsmodule@1.0.0-dev.8, moreblood@1.4.3, ashes@1.5.0, windowdisplay@1.0.4, fennelblooddough@1.2.8
Involved Harmony IDs: vsvaogc
ProtoBuf.ProtoException: Invalid wire-type; this usually means you have over-written a file without truncating or setting the length; see https://stackoverflow.com/q/2152978/23354
at ProtoBuf.ProtoReader.StartSubItem(ProtoReader reader) in C:\Code\Protobuf-net\src\protobuf-net\ProtoReader.cs:line 650
at proto_124(Object, ProtoReader)
at ProtoBuf.Meta.RuntimeTypeModel.Deserialize(Int32 key, Object value, ProtoReader source) in C:\Code\Protobuf-net\src\protobuf-net\Meta\RuntimeTypeModel.cs:line 818
at Vintagestory.Client.NoObf.NetworkAPI.HandleCustomPacket(Packet_Server packet) in C:\Users\office-desktop2\Documents\game\VintagestoryLib\Client\API\NetworkAPI.cs:line 152
at Vintagestory.Client.NoObf.ClientMain.ExecuteMainThreadTasks_Patch4(ClientMain this, Single deltaTime)
at Vintagestory.Client.GuiScreenConnectingToServer.RenderToDefaultFramebuffer(Single dt) in C:\Users\office-desktop2\Documents\game\VintagestoryLib\Client\MainMenu\Screens\GuiScreenConnectingToServer.cs:line 298
at Vintagestory.Client.ScreenManager.Render(Single dt) in C:\Users\office-desktop2\Documents\game\VintagestoryLib\Client\ScreenManager.cs:line 783
at Vintagestory.Client.ScreenManager.OnNewFrame(Single dt) in C:\Users\office-desktop2\Documents\game\VintagestoryLib\Client\ScreenManager.cs:line 686
at Vintagestory.Client.NoObf.ClientPlatformWindows.window_RenderFrame(FrameEventArgs e)
at OpenTK.Windowing.Desktop.GameWindow.Run()
at Vintagestory.Client.ClientProgram.Start(ClientProgramArgs args, String[] rawArgs)
at Vintagestory.Client.ClientProgram.<>c__DisplayClass10_0.<.ctor>b__1() in C:\Users\office-desktop2\Documents\game\VintagestoryLib\Client\ClientProgram.cs:line 131
at Vintagestory.ClientNative.CrashReporter.Start(ThreadStart start) in C:\Users\office-desktop2\Documents\game\VintagestoryLib\Client\ClientPlatform\ClientNative\CrashReporter.cs:line 95
Event Log entries for Vintagestory.exe, the latest 3
==================================
{ TimeGenerated = 22-09-2026 17:09:09, Site = , Source = Application Error, Message = Faulting application name: Vintagestory.exe, version: 1.22.7.0, time stamp: 0x693c0000
Faulting module name: coreclr.dll, version: 10.0.1226.42308, time stamp: 0x6a89b724
Exception code: 0xc0000005
Fault offset: 0x00000000003596cf
Faulting process id: 0x4c38
Faulting application start time: 0x1dd4a868fb28ce3
Faulting application path: C:\Users\r2qu3\AppData\Roaming\Vintagestory\Vintagestory.exe
Faulting module path: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\10.0.12\coreclr.dll
Report Id: b5475c54-4b7a-4f01-a254-892c427bc15b
Faulting package full name:
Faulting package-relative application ID: }
--------------
{ TimeGenerated = 18-09-2026 16:15:18, Site = , Source = Application Error, Message = Faulting application name: Vintagestory.exe, version: 1.22.7.0, time stamp: 0x693c0000
Faulting module name: coreclr.dll, version: 10.0.1226.42308, time stamp: 0x6a89b724
Exception code: 0xc0000005
Fault offset: 0x00000000003596cf
Faulting process id: 0x4c70
Faulting application start time: 0x1dd475a86b8da9a
Faulting application path: C:\Users\r2qu3\AppData\Roaming\Vintagestory\Vintagestory.exe
Faulting module path: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\10.0.12\coreclr.dll
Report Id: 52f06c8e-8b96-482a-8b81-520652d71f6f
Faulting package full name:
Faulting package-relative application ID: }
--------------
{ TimeGenerated = 18-09-2026 16:13:06, Site = , Source = Application Error, Message = Faulting application name: Vintagestory.exe, version: 1.22.7.0, time stamp: 0x693c0000
Faulting module name: openal32.dll, version: 1.23.0.0, time stamp: 0x63dd31ad
Exception code: 0x40000015
Fault offset: 0x00000000000df046
Faulting process id: 0x25ec
Faulting application start time: 0x1dd4757cd1e8016
Faulting application path: C:\Users\r2qu3\AppData\Roaming\Vintagestory\Vintagestory.exe
Faulting module path: C:\Users\r2qu3\AppData\Roaming\Vintagestory\Lib\openal32.dll
Report Id: 8084f598-bc09-4bcd-a971-1b8ca466159f
Faulting package full name:
Faulting package-relative application ID: }
Imma try this out haha thanks for the mention :)
Hell yeah, glad you're checking it out. For real though, huge thanks for TrueScale. That pack is what I run with and it looks incredible. Really appreciate the work you've put into it.
Hope to catch you out there sometime.
Cheers :D and can say this def takes the edge off long play throughs also we are working on something really cool atm that should bring truescale into the next realm :D
i look forward to anything you put out. Ive built this mod with youre texture pack in mind.
cheers haha its been a labor of love this past year seeing what I can do with it. Got a big update on FrameForgeTSR coming out soon too next few days I imagine just finishing some backend stuff, optimizing some new features and adding several runtime avenues for frames that pair with opti time I also made it more compatible with it as currently it uses compute shaders for the temporal stuff so optitime shuts off a few of its features when it detects it which is counter productive. but working on it. so far it is a bit more tedius than I previously thought and a few harmony patches keep crashing I had to remove AO from it its going to be added to my shader mod same with my fogmod. but so far I can fly through big (NOT REDWOOD LOL) forests at mach speed with little to no lag cpu is uhmmmm higher than willy nelson but its smooth at least. next step is cpu thrashing and a few bottle necks I wanna be able to do big forests and redwoods with my texture pack and yes it has been mentioned a few times especially on modded servers haha I DO CARE ABOUT YOU ALL (and listen :P ) haha <3
Does this work alongside the optimum client?
Should be fine in theory. Optimum is its own client, this is just a normal client mod that cleans up leaked meshes. I haven't personally tested the two together though, so if you try it let me know how it goes. After you're in-world, type .vaogc in chat. If it answers, the patch loaded. If Optimum already fixed that leak on their side you might not even need this, but they should not fight each other for settings or anything.Crash log me if something blows up.
Hiya, this seems really good. Is the source available somewhere? I just personally dont install mods that I cant audit the code, too many things sneaking bad stuff into them these days so I'm a bit extra cautious.
yeah fair enough. source is here: https://github.com/leroysquad/vsvaogc
same 1.1.4 that's on here, mit. the zip is dll only on purpose.
Thanks! Could it add to the mods source on the moddb? Makes it easier for others to find as well. Really appreciate btw.
Ye, done. Source Code link is on the listing now: https://github.com/leroysquad/vsvaogc Same 1.1.4 that's up here, MIT. Appreciate you asking for that.
Thank you so much for this mod. When I last played vintage story half a year ago this exact memory leak was so incredibly annoying making me restart the game more often than I wanted to, and I'm glad to see theres a mod that fixes it now that I want to start a new world <3
Appreciate that. Honestly I just ran into the same pain, had the tools to dig into it, and figured if I could fix it for myself I might as well share it. Glad it's helping.
Does this mod have any conflicts with mods like OptiTime?
I actually did experience a crash related to those harmony ids. But it was in creative while going way too fast into unloaded chunks, though it seems to maybe be incompatibility with Butchery?
I don't actually need this fixed, since I can't recreate it. Just thought it might be some context
Appreciate you posting the report, even if you can't recreate it. I dug through it. The actual NullReferenceException is inside Butchering (EntityBehaviorButcherable.Initialize) while an entity was spawning from a network packet. That lines up with what you said: creative, flying too fast into unloaded chunks. Critical error is blamed on butchering@1.14.0. vsvaogc (and OptiTime) show up under Involved Harmony IDs because we both postfix ClientMain.ExecuteMainThreadTasks. The game lists every Harmony ID that patched that method whenever anything running on the main thread throws. So that line is expected noise here, not proof this mod caused the NRE. Still shipped 1.1.4 with outer try/catch around our Finalize prefix and drain postfix so a dispose/queue failure on our side can't take the client down. Grab it if you want, but for this specific crash I'd point at Butchering + entity spawn into unloaded chunks. Thanks again for the context.
<3