bartek_zgo wrote: ↑Mon Nov 15, 2021 2:24 pm
Hi guys. I want to ask how should I clean after render. When render ends I destroy session, renderConfig and scene but still a lot of memory is used. I can see that after calling each delete the memory usage is reduced but still a lot of memory is used. When I create scene I set: scene->SetDeleteMeshData(True) do remove points and vertex created by AllocVerticesBuffer and AllocTrianglesBuffer.
If the scene is delete or not when you delete the RenderConfig depends on how the scene has been created (i.e. if the owner is you or LuxCore). you can use RenderConfig::DeleteSceneOnExit() to force a specific behavior:
https://github.com/LuxCoreRender/LuxCor ... re.h#L1263
bartek_zgo wrote: ↑Mon Nov 15, 2021 2:24 pm
I add a lot of textures using properties:
scene.textures.83042_265_kd.file = "/mnt/nodeHDD1/cache/Texture/595/17922.jpg"
If I create Properties should I dispose them after calling scene->Parse(properties); ?
Yes, you allocated the object, it is up to you to delete it.
Note also that all unused LuxCore binding of objects, materials, textures, etc. are deleted by LuxCore only if you call:
- Scene::RemoveUnusedImageMaps()
- Scene::RemoveUnusedTextures()
- Scene::RemoveUnusedMaterials()
- Scene::RemoveUnusedMeshes()
If some definition is not used, it is still kept (because you may re-use it in the future). It is removed only if call Scene::Remove*().
bartek_zgo wrote: ↑Mon Nov 15, 2021 2:24 pm
In my test with with a big scene
after the render the process use 12GB or RAM.
RAM USAGE 11.5GB
RAM USAGE 11.5GB
RAM USAGE 8.8GB
You should end with the same amount of free memory you had at the start.