dynamic_scene sample seems to be leaking memory after each rtcCommit call. I tried to track down the issue and it seems that a call to recurse() from operator() in bvh_builder_sah.h, results in 0,4MB of memory leaking. Our project uses Embree with over a hundred of triangle meshes and every time we update the geometry buffers and call rtcCommit, we end up with a 4MB of memory leaking. Could you please suggest a possible fix or some workaround for this?
Sounds like a bug in the memory allocation for dynamic scenes, I'll have a look at it.
Could give us some more information on the Embree, OS, and compiler version you are using?
OK, this seems to be a problem with the fast two-level BVH builder:
As a quick workaround please add the following line to bvh4_builder_twolevel.cpp (Embree 2.6.2) at line 50:
If this fixes the problem on your side please let me know.
We'll look into a more elegant/efficient solution as the current workaround and update 2.6.2 asap.
Thanks a lot for reporting this issue.
Thanks for the quick reply. I tested the suggested workaround in Embree 2.6.0 and this seem to fix the memory leak issue. Now the memory usage of dynamic_scene sample never goes above 150MB, but oscillates between 150.4 and 150 (debug build). I'll try to update Embree lib in our project to see if the huge memory leak issue we had is also fixed there. Will let you know how it goes
Thanks for you help!