What is the lua garbage collector doing?! [A24]

engine
a24r789

#1

Summary:
The garbage collector hovers around 10% while the game is paused but fluctuates up to 20+ and the allocated lua bytes. Occasionally while actually playing I have noticed it as high as 59%.

Steps to reproduce:

  1. Start a new game.
  2. Let it run for a minute I guess.
  3. Hit pause and watch the lua_gc

Expected Results:
I would expect the GC to eventually calm down.

Actual Results:
The GC spikes all over the place.

Notes:
None

Attachments:
None

Version Number and Mods in use:
789 (x64) [C] (whatever that c is for)

Mods:
debugtools

System Information:
Win10 1709
AMD FX-8350 8Core4.00 GHz w/ 16GB
NVIDIA GeForce GT 730


#2

the c means you have a repeated mod, probably one is a smod and the other is a folder.


#3

That is interesting as the only mod loaded was debugtools. Good info to have. After a few checks of adding and removing mods it seems that if you start Stonehearth with dups even when it says it needs to restart to add/remove mods the value for dups stays the same. I suppose the [M] is for unofficial mods then? And thanks @BrunoSupremo


#4

I think M = modded, and C = conflict.

As for the lua garbage, sometimes it runs just after the lua, so we only see the garbage bar. Probably when scanning the map. Could also be a performance problem hidden in the game, but a high bar just means it is running that, it is hard to know why.


#5

Thanks for the explanation. As an example I created a brand new game with no mods and hit pause. Pretty much just the lua_gc running. Not sure it is a bug but it sure looks like it isn’t correct.


#6

We fixed very recently an issue with the Lua garbage collector.

These small spikes while paused might be expected though, maybe @Albert knows why they happen.


#7

The bug we fixed for Alpha 23 was for a client-side garbage collector that wasn’t running.

Other than having the force_full_gc flag set to true in the user_settings.json file, I can’t think of why it would be taking 10% while idle.


#8

Interesting. I still have the issue with the lua_gc with A24 r798. I also do not see that flag in either the user_settings or stonehearth .json files.


#9

kinda necro but now days its using 25-30% 24/7 without any mods even.
with a brand new game both idle and unpaused


#10

Even with no hearthlings at all right?


#11

Yepp that’s also the case