diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-11-09 18:14:15 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-11-09 19:53:02 +0300 |
commit | 549468365157a075949f2d4b8d9496ff719cefbf (patch) | |
tree | f564368fe509f46e4ec13b350b62aaace571c093 /intern/cycles/blender/blender_session.h | |
parent | cbbf991f62b7f1546771a71b3b9f14a46d1b6b61 (diff) |
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.
Diffstat (limited to 'intern/cycles/blender/blender_session.h')
-rw-r--r-- | intern/cycles/blender/blender_session.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/intern/cycles/blender/blender_session.h b/intern/cycles/blender/blender_session.h index 99b14a09a5c..fdeba7b2f81 100644 --- a/intern/cycles/blender/blender_session.h +++ b/intern/cycles/blender/blender_session.h @@ -106,6 +106,9 @@ public: BL::BlendData b_data; BL::RenderSettings b_render; BL::Depsgraph b_depsgraph; + /* NOTE: Blender's scene might become invalid after call + * free_blender_memory_if_possible(). + */ BL::Scene b_scene; BL::SpaceView3D b_v3d; BL::RegionView3D b_rv3d; @@ -172,6 +175,12 @@ protected: /* Update tile manager to reflect resumable render settings. */ void update_resumable_tile_manager(int num_samples); + + /* Is used after each render layer synchronization is done with the goal + * of freeing render engine data which is held from Blender side (for + * example, dependency graph). + */ + void free_blender_memory_if_possible(); }; CCL_NAMESPACE_END |