<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">I did this<div class=""><br class=""></div><div class=""><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(195, 55, 32); background-color: rgb(255, 255, 255);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">   </span><span style="font-variant-ligatures: no-common-ligatures; color: #34bc26" class="">do</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> i</span><span style="font-variant-ligatures: no-common-ligatures; color: #34bc26" class="">=</span><span style="font-variant-ligatures: no-common-ligatures" class="">1</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">,</span><span style="font-variant-ligatures: no-common-ligatures" class="">10000000</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">   </span><span style="font-variant-ligatures: no-common-ligatures; color: #33bbc8" class="">call</span><span style="font-variant-ligatures: no-common-ligatures" class=""> VecGhostUpdateBegin(p%v_u, INSERT_VALUES, SCATTER_FORWARD, </span><span style="font-variant-ligatures: no-common-ligatures; color: #d53bd3" class="">&</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">                            ierr); CHKERRQ(ierr)</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">   </span><span style="font-variant-ligatures: no-common-ligatures; color: #33bbc8" class="">call</span><span style="font-variant-ligatures: no-common-ligatures" class=""> VecGhostUpdateEnd  (p%v_u, INSERT_VALUES, SCATTER_FORWARD, </span><span style="font-variant-ligatures: no-common-ligatures; color: #d53bd3" class="">&</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">                            ierr); CHKERRQ(ierr)</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">   </span><span style="font-variant-ligatures: no-common-ligatures; color: #33bbc8" class="">call</span><span style="font-variant-ligatures: no-common-ligatures" class=""> PetscMallocGetCurrentUsage(space, ierr); CHKERRQ(ierr)</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">   </span><span style="font-variant-ligatures: no-common-ligatures; color: #34bc26" class="">if</span><span style="font-variant-ligatures: no-common-ligatures" class="">(rank</span><span style="font-variant-ligatures: no-common-ligatures; color: #34bc26" class="">==</span><span style="font-variant-ligatures: no-common-ligatures; color: #c33720" class="">0</span><span style="font-variant-ligatures: no-common-ligatures" class="">) </span><span style="font-variant-ligatures: no-common-ligatures; color: #34bc26" class="">print*</span><span style="font-variant-ligatures: no-common-ligatures" class="">,space</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(52, 188, 38); background-color: rgb(255, 255, 255);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">   </span><span style="font-variant-ligatures: no-common-ligatures" class="">enddo</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(52, 188, 38); background-color: rgb(255, 255, 255);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><span class="">and the value printed is zero, so this means the problem must come from mpi. Since I am not directly using MPI, what should I look for with valgrind and how will that help to solve this ?</span></div><div class=""><br class=""></div><div class="">There is a recent issue related to memory leak</div><div class=""><br class=""></div><div class=""><a href="https://github.com/open-mpi/ompi/issues/4567" class="">https://github.com/open-mpi/ompi/issues/4567</a></div><div class=""><br class=""></div><div class="">Thank you</div><div class="">praveen</div><div class=""><br class=""></div><div class=""><span class=""><blockquote type="cite" class="">On 26-Dec-2017, at 7:33 PM, Jed Brown <<a href="mailto:jed@jedbrown.org" class="">jed@jedbrown.org</a>> wrote:<br class=""><br class="">First check PetscMallocGetCurrentUsage() in the loop to confirm that<br class="">there is no leak of PetscMalloc()'ed memory.  That would mean the leak<br class="">comes from elsewhere, maybe MPI.<br class=""><br class="">Then get a stack trace for the leaking memory (e.g., using valgrind<br class="">--tool=massif or a debugger)?<br class=""></blockquote></span><br class=""></div></body></html>