Open sibojia opened 7 years ago
I can confirm this and it's much worse when streaming big lists (like lots of vehicles and pedestrians). I don't know how to fix this for RapidJSON unfortunately. It would probably be a good idea to replace RapidJSON with protobuf or flatbuffers. The latter looks particularly interesting, but haven't tried it so far.
There is a memory leak for about 0.2MB when the rate is set to 30Hz. After some debugging I found that it is with the json message construction. Commenting out the json code and leaving all the ScriptHook codes will make the leak disappear. I guess it has something to do with the "Allocator" of the RapidJSON library, but can not find a solution. Anyone has the same problem?