helmut.bressler Posted September 12, 2014 Posted September 12, 2014 Dear Unigine team,we discovered a memory leak in the Unigine Script Materials::setParameterExpression() method by invoking it per frame.The memory leak is easy to reproduce with only a view modifications to the materials/2d_01.cpp sdk example (see attachments).In our project we need to set the reflection plane in a mesh_reflection_2d material per frame. So we are in desperate need of a workaround for this issue!It appears on my machine with the both the 06.04.2014 and 07.07.2014 windows game binary sdk.Thank you!Cheers, Helmut 2d_01.cpp
silent Posted September 15, 2014 Posted September 15, 2014 Hi Helmut, Thank you for the test scene. I've added this issue to our internal bug tracker. However, not sure about workaround at this moment. I will ask devs and report back ASAP. Sorry for the inconvenience caused. How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN
silent Posted September 17, 2014 Posted September 17, 2014 Hi Helmut, Just got responce from developers - this is actually not a bug. You compile expression every update, so memory usage will grow constantly. To avoid such behavior you should modify material and add separate constant parameter that will be changed from outside without expression recompile. So, you need to call setParameterExpression() only once. In attachment you can find modified version of 2d_01 sample with modified materials_mesh_reflection_2d_specular material. Thanks! materials_2d_01.zip How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN
Recommended Posts