I am getting a sudden rise in RAM usage! - C4D
Starting from Corona Renderer 3, the "System is running low on RAM" error message will display a breakdown of various rendering components and their RAM usage. This provides the user with information on what exactly should be optimized to lower the RAM usage. The same pop-up window will appear regardless if you're using 3dsmax or C4D.
Sharp and sudden rise in memory usage may result in incorrect rendering error messages popping up, flickering windows, white squares appearing in the UI, general system slowdown, and even crashes. Numerous things can cause it, and some of them include:
In Corona Renderer, any mesh with material using displacement will be subdivided based on:
- The complexity of the displacement texture
- The quality settings under Render Settings > Performance > Displacement
- Rendering resolution
If the displacement texture is very detailed, if the displacement quality is set to very high, or if the output resolution is very high, this may result in running out of RAM.
Note: Starting from Corona Renderer 3, there is a new Autobump feature, which greatly reduces the RAM usage with no visible quality loss. The below tips were meant for older versions of Corona Renderer, where Autobump was not used, but they may still help you get even lower RAM usage:
- Do not use overly detailed displacement maps. Using displacement for producing fine details usually requires increasing displacement quality, which may lead to running out of RAM. It is better to use displacement for bigger features of the material and bump for the smaller details. For example: when rendering a brick wall, use displacement to obtain the general shape of bricks only, and use bump maps to simulate smaller details such as cracks or other imperfections.
- Optimize the displacement texture by either blurring it or clipping the brightest and darkest areas. This will greatly reduce the number of subdivisions required to displace the mesh. (see: https://corona-renderer.com/forum/index.php/topic,9728.0.html )
- Avoid using overly detailed displacement maps on very high numbers of objects (e.g., on scattered trees forming a forest)
- Avoid using overly detailed displacement maps in materials that cover large areas in the scene (e.g., floors, walls)
- Try lowering displacement quality by increasing its screen size and observe whether the result is acceptable - the default value of 2px usually provides good quality, but when rendering in higher resolution, it can be increased to 4, 8, and often even more.
- If the scene was created in an earlier version of Corona, you will be asked to switch to a "new displacement behavior" when loading it. Make sure you do it as this will activate the new displacement algorithm, which uses significantly less RAM. More information can be found here: What is the Autobump feature?
- Additionally, If you're using 3dsmax, you may use the CoronaDisplacementMod modifier to override the quality of the displacement on various objects. If this modifier is used on an object, the displacement settings in the Render Setup > Performance dialog will be ignored for this specific object; instead, the modifier's settings will be used. This is useful to define a "level of detail" for objects closer or farther away from the camera or closer to the center or the borders of the frame.
2. High-poly objects with Corona Light Mtl applied, scattered, or otherwise heavily instanced (duplicated) throughout the scene.
Such objects cannot be properly instanced, which results in storing every single one of them separately in the memory. Using too many or too detailed objects with the Corona Light Mtl applied may result in RAM running out.
- Reduce the number of polygons on the duplicated object.
- Reduce the total number of instances.
- Use the Corona Mtl with self-illumination enabled instead of the Corona Light Mtl - only if possible! For more information, see: Should I use Corona Light Mtl or Self Illumination?
- When creating many lights (e.g., a factory hall with lots of ceiling lights) - apply a material with self-illumination or Corona Light Mtl with the "Emit light" option disabled for the directly visible part (e.g., light bulb, or filament of a light bulb), and add separate, simple geometry to generate light. This can be a simple rectangle placed below the ceiling.
3. Render Elements
Each render element requires additional memory to be computed. The RAM usage increases with the rendered image's resolution and the number of render elements added.
- If possible, avoid using render elements when rendering high-resolution images or reduce them to the lowest possible number.
- If possible, avoid using denoising when rendering high-resolution images. Each denoised render element counts twice - it stores data for the denoised and non-denoised version.
- Optimize LightMix whenever possible - for example, instead of creating 10 LightSelect elements for each light on a chandelier, group the lights and create one LightSelect element controlling all of them.
- If a light does not need to be controlled individually using the LightMix, it can be left unassigned to any LightSelect element - in such case, it will be automatically included in the "Rest (unassigned)" category, which counts as one render element only.
4. Instancing (duplicating) animated objects
Currently, there is a limitation that makes it impossible to instance animated objects.
My system freezes when I start rendering!