Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Zviadi_V_
Beginner
75 Views

Memory leak in dynamic_scene sample?

Hello,

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?

Thanks

0 Kudos
5 Replies
BenthinC_Intel
Employee
75 Views

Hi,

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?

Thanks.

 

Zviadi_V_
Beginner
75 Views

Hi,

Embree version used is 2.6.0 64 bit, but latest one (2.6.2) has the same issue.

using Visual Studio 2013 on Win8.1 64 bit

Thanks

BenthinC_Intel
Employee
75 Views

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:

bvh->alloc.clear();

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. 

Zviadi_V_
Beginner
75 Views

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!

Zviadi_V_
Beginner
75 Views

This indeed fixed our issue. Thanks again!

Reply