Memory leak in 3362

a21dev3362

#1

Sadly I can’t really tell why, but after ~2h or so (I lose track of time in this game, it’s awesome) I seem to encounter some sort of memory leak. The game is up in the region of 5-6GB of RAM usage (16GB installed) which usually causes something or the other to crash (eg firefox, and for the first time today, SH ). After a restart of steam + SH memory usage starts around 2GB loaded into my save.

EDIT: To clarify, it seems the memory leak is quite constant, the problem reveals itself on my computer around the 2h mark, when the memory usage reaches ~5GB


#2

Posted this right as I crashed the last time. Firefox just crashed with SH @ ~6GB of RAM use (still a 4GB headroom to the 16GB installed, weird) resulting in me exiting SH for now. Memory usage graph from win10 follows:


#3

A save file would likely be useful here for the team to determine the cause. Also are you playing a21, what mods are you using, did you remove the item limit?


#4

Posting save here as well as my in-game settings. Not sure what you mean about item limit but I don’t think so…
Images of relevant settings:
http://images.akamai.steamusercontent.com/ugc/90475754526452039/C99E3B80A1CE99AD9467C27CE2BEFAF5B38DE88B/
http://images.akamai.steamusercontent.com/ugc/90475754526451843/4459591D829AB81D7FFAE710DC58F25739631937/
http://images.akamai.steamusercontent.com/ugc/90475754526451678/678394AEB179C21934C42C0E63B9FC2B0AA62968/
Save file:
https://drive.google.com/file/d/0B8UWV5O23oD7MDBLTTg2NVpMMVE/view?usp=sharing


#5

OK. just from what I’ve seen i can likely provide you with an answer.

You have a massive pit in the middle of your town, it’s FULL of items, on top of this theres a HUGE mining area and on top of that, you’ve got like 600+ wood sitting on the ground next to your houses, on top of this you’ve got tons and tons of items sitting around from monster drops and you’re about 500 items from your towns item limit. Added to all this, you still have scaffolding sitting next to a couple of your houses that should have been removed but it looks like you build the road and the scaffolding got stuck. Plus 31 citizens…

Stonehearth is by no means optimized, and i’m guessing by the time you reach this point your system starts to die under the pressure of trying to move over a thousand items at once, WHILE trying to mine more and still trying to get the pathfind to your loot drops from enemies. ON top of it all, the lua pathfinder is working hard to figure out how to finish your buildings by removing the lasts bits of scaffold so it can stop checking them.

Stonehearth unfortunately can’t do that much at once without a really strong computer. (yet) Also it really dislikes large mining areas and the devs suggest you break such areas up a bit so your little people and mainly your computer don’t get overwhelmed.


#6
  1. I do have a quite strong computer.
    (i7-6700k, R9 290X, 16GB RAM DDR4@3000MHz)
  2. The thing is… The ram usage starts around 2.3-2.5GB and slowly slowly rises to the 5-6GB levels after around an hour or more of play. This leads me to believe that it’s more of a memory leak issue rather than a memory management issue, but that might be way off.

#7

The game is by no means optimized so these issues mentioned while not on their own an issue do add up. I’m not an expert but the game ran fine on my pc a dev or somebody else may have a better answer mind you.


#8

Both of you are correct. Stonehearth has not been optimized for memory usage and also has outstanding memory leaks. We’ve actually fixed a few leaks in the recent alphas, but there is at least one significant leak that we still need to find.

@mickwald - Thanks for posting your save and providing details! We’ll take a look and see what we can find.