Memory usage while building

I think we passed a threshold with our project and the build process needs close to 4GB of memory, which is over the Java heap limit for people with 8GB of RAM. It’s easily solvable with -Xmx4096m, but I’d rather not have our artists and designers have to do that each update (as config is overwritten each update).

Is there any way you could optimise memory usage while building so that it doesn’t scale linearly with the project size? Maybe use streaming in some fashion?

If not, at least make a workaround to automatically increase the max Java heap size on low-memory devices, so that it doesn’t have to be done manually?

3 Likes

Ping @Erik_Angelin @mats.gisselson and @ragnar.svensson

3 Likes

+1 . Our project passed this size as well.

3 Likes

We are painfully aware of our huge memory consumption, which is due to our caching policy. Fast builds are very important for us so we try to cache just about everything. We are discussing other heuristics to use the cache smarter, but it’s pretty tricky to come up with something that works across all different project types and thats also “plays fair” with the other activities we want to be snappy, like the scene view for instance. There might be some quick-wins left to pick in the build pipe until we come up with something better.

6 Likes

In the meantime, would it be possible to have a persistent config file that doesn’t get overwritten on every update? The data inside is very much static, isn’t it? I have created a script that adds the parameter for me, so I don’t have to manually open up the file in a text editor, but it’s still far from perfect. This coupled with the editor autodownloading new updates and not deleting the older ones are my biggest pet peeves with the updating process.

1 Like

The memory usage is clearly the biggest issue for us right now and @Erik_Angelin is currently working on it. We are aware of the frustration and also the issue with user configs. We do update the config file once in a while (rarely, but it happens) so what I think would be the best option is a separate user file that overrides the config in the installation. When we have a way forward on the memory usage, we’ll know if it makes sense to fix the config issue first (for easier workarounds) or go straight for the memory. Obviously, people should not need to do JVM config in order to build their projects.

6 Likes