• Tracker

    Spaces
    Browse
    Statistics
  • /
  • /Stable Feedback
  • /DZG-2913
Back
2

JsonFileLoader memory leak

2

State

Open
Issue key
DZG-2913
Access
Public
Space
DayZ
Project
Stable Feedback
Creator
lbmaster
Created
Nov 21, 2026
Views
7
Platform
PC Steam
What happened?

The JsonFileLoader class is leaking memory / not freeing memory after being used. This is especially noticable when reading and writing json files often. The main problem is not the JsonFileLoader class iteself, but rather the fact, that the JsonSerializer does not free the memory after it's use. The JsonFileLoader has the protected static ref JsonSerializer m_Serializer = new JsonSerializer(); object to cache the JsonSerializer object for faster access. The problem is, that there seems to be some bug, which does not free memory anymore. From my tests it seems like the JsonLoadFile method is causing this problem and I bet it's related to this problem reported a year ago: https://feedback.bistudio.com/T195468 . when I restructure the JsonFileLoader and always construct a new JsonSerializer in each of the functions instead of having one static cached object, both problems disappear. The Desctructor is called again and the memory is stable again.

Reproduction steps

Create a class with some fields, which take up some memory like a bunch of strings, lists etc.

create a json file, which has the structure of the file to read from

repeatedly load the class using the JsonFileLoader<>.JsonLoadFile("", obj); in something like MissionServer OnUpdate and note, that the destructor of the class is never called and the memory footprint of the DayZ Server is just rising

Exact build version (optional)
1.30.164289
Where did it happen?
Community
Is it modded?
Yes
Expected result

The destructor should be called regardless of the JsonSerializer instance

Section
Mod list

just vanilla + test the scripts

Load order / launch params
—
Reactions

Activity

    22 minutes ago
  • lbmaster
    created issue22 minutes ago

You are not signed in. Please sign in to see more details and to reply.

State

Open
Issue key
DZG-2913
Access
Public
Space
DayZ
Project
Stable Feedback
Creator
lbmaster
Created
Nov 21, 2026
Views
7