Page 1 of 1
Factorio uses too much RAM
Posted: Tue Oct 18, 2016 9:54 am
by kilbith
Hello community,
I really love Factorio, however I find it uses RAM in excess for a simple 2D game which don't even use HD textures. To be accurate it uses between 2-3 GB of memory. In comparison, Skyrim uses roughly 700-800 MB with the greatest textures.
I have 4 GB RAM here, if I play Factorio on Linux w/ GNOME, Factorio ends up running in the swap partition (because not enough RAM available) and that makes the game really slow.
Factorio is fairly light in every other aspects except memory consumption. Can the devs consider greatly reducing that ?
Best regards.
Re: Factorio uses too much RAM
Posted: Tue Oct 18, 2016 10:40 am
by Adil
Do you use any mods? Is your base very big? For me in my longplay maps it's about 1.5 - 2 gb.
And you know, ram usage is not all about textures and graphics at any given time skyrim holds in memory about a hundred maybe a thousand of objects (guards, dragon, sweet rolls), that all have some information about them, factorio needs to remember much more.
Also, default linux swappiness is rather ridiculous, googling up on how to finetune it might be worthwhile.
Re: Factorio uses too much RAM
Posted: Tue Oct 18, 2016 11:32 am
by kilbith
I don't use any mod, only vanilla Factorio 0.14.x. My base has ~50h of work, I think it's rather big.
I'm aware that memory usage is not all about textures and graphics, but these are the most greedy RAM consumers. Informations or "metadatas" on the map are just strings or tables internally and they're usually much smaller than media files.
What do you mean exactly by "default linux swappiness is ridiculous" ?
Re: Factorio uses too much RAM
Posted: Tue Oct 18, 2016 12:46 pm
by Deadly-Bagel
Graphics are handled by the GPU which Skyrim will probably be hammering compared to Factorio (until you get a really dense factory all churning stuff around and you try to zoom out).
However, there is one big difference that is easy to overlook. When you leave a town in Skyrim, the game unloads it. All those people, the houses, the animals, the items, weapons, shops, all disappear. This goes for pretty much any other game, including Minecraft. As you approach an area everything is loaded back into memory while everything behind you is dumped.
Stop and think how the game would play out if Factorio tried to do this ^^
Re: Factorio uses too much RAM
Posted: Tue Oct 18, 2016 2:16 pm
by daniel34
Re: Factorio uses too much RAM
Posted: Tue Oct 18, 2016 2:25 pm
by Adil
kilbith wrote:What do you mean exactly by "default linux swappiness is ridiculous" ?
It prefers to swap the needed data on disk instead of dropping cache of dubious usefulness.
[1][2]
And do not underestimate the size of 'just strings and tables'.
In a particular set of problems those easily get over Gb size cutoff.
In Dwarf Frotress they've recently moved to 64 bit because they consistently needed more and more memory, without much graphical complexity.
Re: Factorio uses too much RAM
Posted: Fri Oct 21, 2016 1:29 am
by Rseding91
We don't "waste" or "over allocate" RAM anywhere. What it uses is exactly what it needs to run. The base Factorio graphics take up 600 MB of RAM. The base prototypes take up about 200 MB. Anything past that is data required to simulate a given save file.
There's a simple solution: get more RAM. It's cheap and required if you want to play larger saves.
Re: Factorio uses too much RAM
Posted: Fri Oct 21, 2016 9:19 am
by kilbith
Thanks for the informations, Adil and Rseding91.
RAM is indeed cheap, but think to those who play on laptops... It's not always possible or easy to add more RAM.
Also, the fact that it uses 600 MB for the base graphics is quite concerning for me, Factorio uses simple graphics. This is roughly what Skyrim uses for everything including high quality graphics. That requirement is disproportionately high compared to the rest, that's a pity.
Re: Factorio uses too much RAM
Posted: Fri Oct 21, 2016 9:39 am
by Deadly-Bagel
You guys developed a game that synchronises tens to hundreds of thousands of entities in real time across up to 400 players and you still can't be trusted to handle memory

just can't catch a break can you. Well I believe in you ^^
Re: Factorio uses too much RAM
Posted: Fri Oct 21, 2016 10:45 am
by bergi9
kilbith wrote:Also, the fact that it uses 600 MB for the base graphics is quite concerning for me, Factorio uses simple graphics. This is roughly what Skyrim uses for everything including high quality graphics. That requirement is disproportionately high compared to the rest, that's a pity.
You don't know what you're talking about. Rendering 2D game with Bitmaps (can be compressed) is different than rendering a 3D game with Meshes and Textures. Factorio uses Sprites (multiple images with different positions) to render them, this require more memory than a 3D game which have lower images for texture.
Re: Factorio uses too much RAM
Posted: Fri Oct 21, 2016 11:23 am
by kilbith
bergi9 wrote:You don't know what you're talking about.
Probably, yes. I'm just expressing facts and concerns here, then no need to be offensive or snarky. As a customer I would feel somewhat fscked if Factorio 1.x reached 8 GB or more as RAM requirement.
Also, I do know for sure that Skyrim uses 1024x1024px textures on meshes (Factorio's ones are of much lower resolution). But I agree 2D and 3D engines does not handle texturing the same way, but still...
Re: Factorio uses too much RAM
Posted: Fri Oct 21, 2016 11:47 am
by hoho
kilbith wrote:Also, I do know for sure that Skyrim uses 1024x1024px textures on meshes
Only in high-res texture DLC. In vanilla, they used 512x512 textures.
Skyrim also "cheats" by overlaying small detail textures over others for emulating higher detail levels. It's most visible on ground textures IIRC.
kilbith wrote: (Factorio's ones are of much lower resolution).
Accumulators use three textures - one 124x103 pixel icon. 1104x405px charge animation sheet and 1176x384px discharge animation sheet. In total, that's almost as much as a single 1024x1024px texture. Tank uses 14 texture sheets for a total of a little more than 4096x1024 pixels.
2D games require a LOT of memory for textures. In addition, the game map itself has to store a bunch of data, the more you explore the more it takes. In comparison, skyrim uses mostly heightmap with massively lesser amount of data per unit of area and unloads parts that are too far from player while factorio has to keep EVERYTHING in memory at all times.