From 549468365157a075949f2d4b8d9496ff719cefbf Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Fri, 9 Nov 2018 16:14:15 +0100 Subject: Cycles: Free Blender side data as soon as we don't need it Currently this is possible after built-in images are loaded in memory. Allows to save memory used by dependency graph and copy-on-write. In practice this lowers peak system memory usage from 52GB to 42GB on a production file of spring 03_035_A.lighting. Note, that this only applies to F12 and command line renders. Bigger note, that this optimization is currently only possible if there are no grease pencil objects to be rendered. --- source/blender/makesrna/intern/rna_render.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source/blender/makesrna/intern/rna_render.c') diff --git a/source/blender/makesrna/intern/rna_render.c b/source/blender/makesrna/intern/rna_render.c index 1e9f68c577b..46b77b80d49 100644 --- a/source/blender/makesrna/intern/rna_render.c +++ b/source/blender/makesrna/intern/rna_render.c @@ -685,6 +685,9 @@ static void rna_def_render_engine(BlenderRNA *brna) parm = RNA_def_int(func, "pixel_size", 0, 1, 8, "Pixel Size", "", 1, 8); RNA_def_function_return(func, parm); + RNA_def_function(srna, "free_blender_memory", "RE_engine_free_blender_memory"); + RNA_def_function_ui_description(func, "Free Blender side memory of render engine"); + RNA_define_verify_sdna(0); prop = RNA_def_property(srna, "is_animation", PROP_BOOLEAN, PROP_NONE); -- cgit v1.2.3