<html>#2194: Memory increase during regridding
<table style='border-spacing: 1ex 0pt; '>
<tr><td style='text-align:right'> Reporter:</td><td>Wolfgang Kastaun</td></tr>
<tr><td style='text-align:right'>   Status:</td><td>wontfix</td></tr>
<tr><td style='text-align:right'>Milestone:</td><td>ET_2020_04</td></tr>
<tr><td style='text-align:right'>  Version:</td><td>development version</td></tr>
<tr><td style='text-align:right'>     Type:</td><td>bug</td></tr>
<tr><td style='text-align:right'> Priority:</td><td>minor</td></tr>
<tr><td style='text-align:right'>Component:</td><td>Other</td></tr>
</table>

<p>Comment (by Ian Hinder):</p>
<p>Sorry I didn’t see this before it was closed.  I would suggest that you first confirm that the problem is due to fragmentation.  glibc malloc is fairly useless for this.  I propose</p>
<ol>
<li>Run a test case to confirm the problem, e.g. one of the cases that people have posted above.  Wait until it actually crashes with OOM - don’t just look at reported memory statistics, especially not the RSS, which doesn’t tell you what you need to know.</li>
<li>Repeat the test with tcmalloc (see my instructions in a comment above).  Look at the tcmalloc statistics.  You should be able to determine the amount of “unused” memory (related to fragmentation). Ask me if you need help interpreting the tcmalloc statistics. Run it until it crashes - tcmalloc might help with fragmentation “out of the box”.</li>
</ol>
<p>When I looked into this again in 2018 (I had previously tried to debug the problem for my own runs years before), the tentative conclusion did seem to point to fragmentation (see <a data-is-external-link="true" href="http://lists.einsteintoolkit.org/pipermail/users/2018-August/006434.html" rel="nofollow">http://lists.einsteintoolkit.org/pipermail/users/2018-August/006434.html</a>).  But this was never fully confirmed.  There were also hints that <em>allocated</em> memory was increasing, even though memory allocated for gridfunctions was not.  So before concluding that fragmentation is the reason, it would be good to see a clear demonstration of this.  If fragmentation is the reason, use of tcmalloc might reduce fragmentation, and there are parameters and strategies you can use to help.  </p>
<p>My own solution to the problem was to run shorter jobs between checkpoints, so that the memory didn’t grow too high before the job checkpoint-terminated.</p>
<p>‌</p>
<p>--<br/>
Ticket URL: <a href='https://bitbucket.org/einsteintoolkit/tickets/issues/2194/memory-increase-during-regridding'>https://bitbucket.org/einsteintoolkit/tickets/issues/2194/memory-increase-during-regridding</a></p>
</html>