<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /></head><body style='font-size: 10pt'>
<p>Hi,</p>
<p><br /></p>
<p>The other day,&nbsp;I quickly tried my hand at implementing Alembic in Cycles standalone, didn't really work out partly since Alembic files don't store lights. Anyway, I did notice the following&nbsp;leak report from GCC:</p>
<p><br /></p>
<p>=================================================================<br />==643==ERROR: LeakSanitizer: detected memory leaks</p>
<p>Direct leak of 32816 byte(s) in 1 object(s) allocated from:<br /> #0 0x7f591193444a in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x9444a)<br /> #1 0x7f590fbe4dd0 (/lib/x86_64-linux-gnu/libc.so.6+0xbcdd0)</p>
<p>SUMMARY: AddressSanitizer: 32816 byte(s) leaked in 1 allocation(s).</p>
<p><br /></p>
<p>It's not very detailed, but I just tried again with master and it's still there, though I don't know if it's the same issue&nbsp;as Thomas' or just GCC being confused. Thought I'd share.</p>
<p><br /></p>
<p>Cheers,</p>
<p>K&eacute;vin</p>
<p><br /></p>
<p>Le 2016-07-12 20:12, Sergey Sharybin a &eacute;crit&nbsp;:</p>
<blockquote type="cite" style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0"><!-- html ignored --><!-- head ignored --><!-- meta ignored -->
<div dir="ltr">Hi,
<div>&nbsp;</div>
<div>In Blender we do use guarded allocator everywhere, including Cycles (at least for it's major parts). I did not see any leaks reported. So can you elaborate a bit more which exact memory is leaking?</div>
<div>&nbsp;</div>
<div>Think it worth addressing the issue unless it leads to some nasty code workaorunds or makes integration into other software creepier.</div>
<div>&nbsp;</div>
<div>But all that being said, please make sure you're doing similar thing to what we do in blender_python.cpp:exit_func(). This was the trick to make staticly initialized data to be freed and make Blender's integration happy.</div>
<div>&nbsp;</div>
<div>We should probably need to move that code to ccl::Session::exit() and call from standalone app as well.</div>
</div>
<div class="gmail_extra"><br />
<div class="gmail_quote">On Tue, Jul 12, 2016 at 6:31 PM, Thomas Krebs <span>&lt;<a href="mailto:Thomas.Krebs@mecadtron.de">Thomas.Krebs@mecadtron.de</a>&gt;</span> wrote:<br />
<blockquote class="gmail_quote" style="margin: 0 0 0 .8ex; border-left: 1px #ccc solid; padding-left: 1ex;">Hi,<br /><br /> We are currently trying to integrate cycles into our 3d app.<br /> We have successfully implemented a collada exporter from our app<br /> and produced some nice images in Blender.<br /> Now we got the standalone cycles app compiled and running.<br /> We found that cycles leaks quite some bit from some static<br /> initializers. As we try to solve leaks by monitoring leaks reports from<br /> MSVC this is somewhat problematic.<br /> Personally I would prefer not to have static initializers rather than<br /> some initialize/terminate functions, which would make cycles even more<br /> usable for integration in other systems.<br /> Is there some effort going on to address that situation or would such<br /> an effort be welcome?<br /> We might supply changes for that but we would leave it up to more<br /> experienced submitters to integrate such changes, if at all.<br /><br /> Thomas<br /> _______________________________________________<br /> Bf-cycles mailing list<br /><a href="mailto:Bf-cycles@blender.org">Bf-cycles@blender.org</a><br /><a href="https://lists.blender.org/mailman/listinfo/bf-cycles" rel="noreferrer">https://lists.blender.org/mailman/listinfo/bf-cycles</a></blockquote>
</div>
<br /><br clear="all" />
<div>&nbsp;</div>
-- <br />
<div class="gmail_signature">
<div><span style="color: #666666;">With best regards, Sergey Sharybin</span></div>
</div>
</div>
<br />
<div class="pre" style="margin: 0; padding: 0; font-family: monospace">_______________________________________________<br /> Bf-cycles mailing list<br /><a href="mailto:Bf-cycles@blender.org">Bf-cycles@blender.org</a><br /><a href="https://lists.blender.org/mailman/listinfo/bf-cycles" rel="noreferrer">https://lists.blender.org/mailman/listinfo/bf-cycles</a></div>
</blockquote>
<p><br /></p>

</body></html>