<html aria-label="message body"><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"><div><br></div>   Unix/Linux has never had a good API for tracking process memory usage. <span style="color: rgb(34, 40, 50); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";">PetscMemoryGetCurrentUsage() gets what it can from the OS, but the exact number should not be considered a true measure of process memory usage at that point in time.  Jumps up and down are not accurate measures of changes in memory usage.</span><div><font color="#222832" face="-apple-system, BlinkMacSystemFont, Segoe UI, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol"><span style="caret-color: rgb(34, 40, 50);"><br></span></font></div><div><font color="#222832" face="-apple-system, BlinkMacSystemFont, Segoe UI, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol"><span style="caret-color: rgb(34, 40, 50);">  </span></font>PetscMallocGetCurrentUsage() and the number from MUMPS are (assuming no bugs in our code and MUMPS counting space) accurate values of memory usage. You should use these to see how memory usage is scaling with your problem size.</div><div><br></div><div>  Barry</div><div><br><div><br><blockquote type="cite"><div>On Dec 3, 2025, at 4:00 PM, neil liu <liufield@gmail.com> wrote:</div><br class="Apple-interchange-newline"><div><div dir="ltr"><div>Dear users and developers, </div><div><br></div><div>I am recently running a large system from Nedelec element, 14 million dofs (complex number). </div><div>A little confused about the memory there. Then I tried a small system (34,000 dofs) to see the memory usage. It was solved with MUMPS with 1 rank. </div><div>Then I used  <span style="color:rgb(34,40,50);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"">PetscMemoryGetCurrentUsage() to show the memory used there. </span></div><div>The pseudocode is </div><div><span style="color:rgb(34,40,50);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"">PetscMemoryGetCurrentUsage (<b>Memory 1:</b> 64.237M)</span></div><div><span style="color:rgb(34,40,50);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"">KSPset</span></div><div><span style="color:rgb(34,40,50);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"">KSPsolve  (</span>INFOG(18) (size of all MUMPS internal data allocated during factorization: value on the most memory consuming processor): <span style="color:rgb(34,40,50);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol""><b>Memory 2:</b></span><span style="color:rgb(34,40,50);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol""> </span> 408 MB<span style="color:rgb(34,40,50);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"">)</span></div><div><span style="color:rgb(34,40,50);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"">PetscMemoryGetCurrentUsage </span><span style="color:rgb(34,40,50);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol""></span><span style="color:rgb(34,40,50);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"">(</span><b><span style="color:rgb(34,40,50);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"">Memory 3:</span><span style="color:rgb(34,40,50);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol""> </span></b><span style="color:rgb(34,40,50);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"">54.307M)</span></div><div><span style="color:rgb(34,40,50);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol""><br></span></div><div>[0] Maximum memory PetscMalloc()ed 49.45MB maximum size of entire process 424MB <span style="color:rgb(34,40,50);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"">(</span><span style="color:rgb(34,40,50);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol""><b>Memory 4:</b></span><span style="color:rgb(34,40,50);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol""> </span><span style="color:rgb(34,40,50);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"">54.307M)</span><br></div><div><span style="color:rgb(34,40,50);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol""><font size="4">The following is my understanding, please correct me if I am wrong, </font></span></div><div>It seems the difference between Memory 1 and 3 is approximately the size of 30 Krylov vectors (complex).<span style="color:rgb(34,40,50);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol""></span></div><div>It seems Memory 4 is not the summation of Memory 2 and 3; but on the same order of magnitude. It is a little confusing here. </div><div><br></div><div>Thanks,</div><div>Xiaodong </div><div><br></div><div><br></div></div>
</div></blockquote></div><br></div></body></html>