<div dir="ltr">(+Lang, Orcmaster)<br><br>Any chance you could provide reproduction steps? ("download this code, run this build command, run this test command", etc?) Preferably with a smaller/isolated example, but that's not strictly needed, so long as there's not lots of external dependencies to worry about, etc.<br><br>- Dave<br><br><div class="gmail_quote"><div dir="ltr">On Wed, Nov 15, 2017 at 1:09 PM Alex Denisov via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi folks,<br>
<br>
I have an issue with constant memory growth on Linux.<br>
Here is what I do (real code is here[1]):<br>
<br>
for (auto &module : modules) {<br>
  auto owningObject = orcCompiler.compileModule(module);<br>
  processObjectFile(owningObject.getBinary());<br>
}<br>
<br>
After each compilation of a module memory grows by N megabytes, which is fine and expected.<br>
The problem that the owningObject does not escape the scope, and I expect memory to be freed after each loop iteration.<br>
It works as expected on macOS: memory spikes when we enter the loop body but gets back after we leave the body.<br>
However, on Linux, it grows constantly and eventually exceeds all capacities.<br>
<br>
The questions are: what can I do about it? What could hold the memory allocated for each object file? Why is it different between macOS and Linux? Who is the guilty here: the Elf or the Orc?<br>
<br>
For your info: I use Orc APIs from LLVM 3.9.<br>
Please let me know if I can provide more relevant information.<br>
<br>
I would appreciate any hints and ideas on how to nail the problem down.<br>
<br>
[1] <a href="https://github.com/mull-project/mull/blob/disable_inmemory_cache/lib/Driver.cpp#L231" rel="noreferrer" target="_blank">https://github.com/mull-project/mull/blob/disable_inmemory_cache/lib/Driver.cpp#L231</a><br>
<br>
Cheers,<br>
Alex.<br>
<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div></div>