grinning_serpent Posted 13 hours ago Report Posted 13 hours ago (edited) I've noticed that RAM usage increases over time when creating new worlds, and it often never goes back down. When taking screenshots with printscreen, it'll often be a picture of something several minutes old, potentially even a previously-loaded world. This can also happen when quitting out of a world, particularly as RAM usage approaches the total system memory. Why does this happen? Is there anything that can be done about it? It's very odd behavior that I haven't been able to find any explanations for, maybe because I don't have any specific terms to search with. It's a source of frustration when attempting to generate a good map (or even just checking behavior of worldgen) with various combinations of mod or even just stock vanilla, as I have to quit out of VS entirely for it to finally let go of the RAM it's grabbing. As an example, upon launching VS, it holds steady at about 10-11GB of RAM use (counting Firefox, which I'm using to write this post of course.) RAM usage climbs to 17-18GB upon creating and loading into a world for the first time. If I quit out and then go create a new world, usage climbs further into the low 20's, and will eventually hit around 29GB of my 32GB of memory on a third repetition. Even if I leave the game idle on the menu for a few minutes between iterations, the RAM usage never drops back towards the original 10-11GB or even the 17-18GB used when only a single world is active. Why is the game seemingly holding onto assets for worlds that aren't in use anymore? Shouldn't it discard all of that once the world has closed and been saved to disk? Edited 13 hours ago by grinning_serpent
MKMoose Posted 12 hours ago Report Posted 12 hours ago (edited) 1 hour ago, grinning_serpent said: When taking screenshots with printscreen, it'll often be a picture of something several minutes old, potentially even a previously-loaded world. This seems to be an unrelated fullscreen issue (may also occur on maximized borderless in some cases), at least on Windows but I'm not sure about other systems. Windowed mode doesn't seem to have this issue. You can also check whether you can Alt-Tab out of the game and back in to get the screenshot to be what you had on the screen when Alt-Tabbing out. 1 hour ago, grinning_serpent said: Why does this happen? Is there anything that can be done about it? It's very odd behavior that I haven't been able to find any explanations for, maybe because I don't have any specific terms to search with. It's a source of frustration when attempting to generate a good map (or even just checking behavior of worldgen) with various combinations of mod or even just stock vanilla, as I have to quit out of VS entirely for it to finally let go of the RAM it's grabbing. Is there actually a problem, though, or is it just that you don't like how it looks? Does the RAM usage keep climbing and affecting performance? Does it prevent other apps from using that RAM? Do keep in mind, also, that if there are any actual problems, they could be caused purely by mods. Apparent RAM usage remaining high when it is no longer in use is perfectly normal, as there is no need to clear RAM right the moment it's unused - the same behavior occurs in many other apps. This is often referred to as lazy garbage collection - releasing memory only when it is actively needed. Some systems apparently also deliberately keep data in memory to be able to reuse it immediately if it's needed again instead of loading it from scratch, though I'd need to double-check that to be sure. Either way, RAM which is being actively utilized is not the same as RAM which is no longer in use but not yet cleared out. Additionally, some of the data stored in RAM may be data which intentionally persists between worlds, like maybe texture atlases or shader data - I don't know whether this is actually the case and how much it contributes if it is, but I wouldn't dismiss the possibility. Running a different RAM-heavy app alongside VS seems to cause VS to release most of the memory it's holding. I can also get it to release most of the unused memory by just... waiting. Edited 12 hours ago by MKMoose
grinning_serpent Posted 12 hours ago Author Report Posted 12 hours ago Yes, it's a problem. I wouldn't ask otherwise. Once the RAM usage hits ~29GB the game must frequently "close" for moments (black screen with the Windows blue circle "thinking" mouse cursor or sometimes the initial world load/startup screen) in between normal play. I don't understand why the game is seemingly choosing to hold onto information and assets that aren't in use. Performance in programs other than VS also tanks while VS is running, adding hitches and delays even to something as simple as writing text into notepad. That's another thing I haven't had any luck finding information on, but games and applications that are much more demanding don't cause this so I'm assuming it's something to do with how VS runs. I've wondered if VS just really hammers a few cores while leaving the rest untouched - that would leave CPU usage showing fairly low overall, but I'd have to reinstall hwinfo or something to be sure.
MKMoose Posted 11 hours ago Report Posted 11 hours ago (edited) 1 hour ago, grinning_serpent said: I've wondered if VS just really hammers a few cores while leaving the rest untouched - that would leave CPU usage showing fairly low overall, but I'd have to reinstall hwinfo or something to be sure. While VS can and does use multiple cores, the bulk of the game tends to run on a single thread as far as I know. A quick glance at my resource monitor on world load: 1 hour ago, grinning_serpent said: I don't understand why the game is seemingly choosing to hold onto information and assets that aren't in use. Lazy garbage collection, perhaps, as I've mentioned? Just like in thousands of other games? If it has some issues and causes performance issues then maybe that's a bug or some other problem, but the general idea of lazy garbage collection is extremely common and basic. 2 hours ago, grinning_serpent said: As an example, upon launching VS, it holds steady at about 10-11GB of RAM use (counting Firefox, which I'm using to write this post of course.) RAM usage climbs to 17-18GB upon creating and loading into a world for the first time. If I quit out and then go create a new world, usage climbs further into the low 20's, and will eventually hit around 29GB of my 32GB of memory on a third repetition. Even if I leave the game idle on the menu for a few minutes between iterations, the RAM usage never drops back towards the original 10-11GB or even the 17-18GB used when only a single world is active. I can see the exact same RAM usage behavior you're describing - minus the freezing - in multiple other games I've briefly tested as well as in VS. I would propose that this could be a matter of .NET or the operating system, not something specific to VS. I'm not getting the freezing, though, as my RAM usage seems to neatly and gradually get cleared up with no obvious performance impact when reaching very high values, or just cap out and start struggling when playing with jacked up render distance - I wasn't able to have it cause any meaningful performance issues otherwise, even after creating new worlds several times. Your predicament may depend heavily on the specifics on your system and your VS configuration with mods, which I am unfamiliar with currently and likely unable to meaningfully help with even if I was. Edited 11 hours ago by MKMoose 1
Diff Posted 11 hours ago Report Posted 11 hours ago Does this behavior happen without any mods enabled?
Professor Dragon Posted 7 hours ago Report Posted 7 hours ago Try using "F12" - which is the game's own "Print Screen which saves a File (see the General Tab for the name of the save and location) - and seeing if the saved image matches the on-screen images. It should.
LadyWYT Posted 7 hours ago Report Posted 7 hours ago Welcome to the game and forums! 5 hours ago, grinning_serpent said: It's a source of frustration when attempting to generate a good map (or even just checking behavior of worldgen) with various combinations of mod or even just stock vanilla, as I have to quit out of VS entirely for it to finally let go of the RAM it's grabbing. Out of curiosity, have you tried rebooting your computer between testing with mods and testing without? When trying to troubleshoot memory issues, sometimes that's necessary. Knowing what game version you're playing and what your modlist is might also help as well. Sometimes there are known issues with certain mods or game versions, but it's hard to say for sure without having those details. Likewise, knowing what graphical settings you're running could also help, since higher settings will be more demanding on performance. You may also wish to list your OS and hardware specs, just to make sure all the bases are covered. 4 hours ago, grinning_serpent said: Yes, it's a problem. I wouldn't ask otherwise. Correct me if wrong @MKMoose, but I think what he was trying to ask is whether there are actual performance issues with playing the game and what those issues are(aside from the mentioned screenshot delay, there's not much else described), or whether it's just some funky looking numbers but the game itself is running fine.
Zaph42nd Posted 3 hours ago Report Posted 3 hours ago Echoing others, garbage collector is probably main contributor (and .NET being finicky as always), I believe GC can be altered in .ini though? via the RAM optimization settings (find aggressive optimization tends to actually have more issues on my system; however MacOS is a bit of an uncommon OS to play on if I'd happen to guess). Otherwise surefire way to force GC to activate is alt + F8 which should help at least a tiny bit. Larger mod-lists and/or long-continuous playtimes also tend to cause the game to eat up RAM, same goes for alt-tabbing or window-switching (anything that changes application priority).
Recommended Posts