<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"><html><head><meta name="qrichtext" content="1" /><style type="text/css">p, li { white-space: pre-wrap; }</style></head><body style=" font-family:'Arial'; font-size:12pt; font-weight:400; font-style:normal;">Ok,<br>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p>i am more confused now.<br>
The following is part of my code:<br>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p> PetscLogDouble mem;<br>
PetscMemoryGetCurrentUsage(&mem);<br>
cout<<"PetscMemoryGetCurrentUsage: "<<mem<<"\n"; cout.flush();<br>
PetscMemoryGetMaximumUsage(&mem);<br>
cout<<"PetscMemoryGetMaximumUsage: "<<mem<<"\n"; cout.flush();<br>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p><p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p>This is what is reported:<br>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p>PetscMemoryGetCurrentUsage: 5.25525e+08<br>
PetscMemoryGetMaximumUsage: 3.09055e+08<br>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p><p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p>Now, unless i am missing something obvious, i am completely confused how it is that the maximum usage can be less than the current usage.<br>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p>What am i missing here?<br>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p><p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p>thanks<br>
matt<br>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p><p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p><p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p><p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p>On Thursday 17 September 2009, you wrote:<br>
> On Thu, Sep 17, 2009 at 6:04 PM, Matt Funk <mafunk@nmsu.edu> wrote:<br>
> > Hi,<br>
> ><br>
> ><br>
> > I am wondering whether the -memory_info option and the<br>
> > PetscMemoryGetMaximumUsage<http://www.mcs.anl.gov/petsc/petsc-as/snapshot<br>
> >s/petsc-current/docs/manualpages/Sys/PetscMemoryGetMaximumUsage.html#Petsc<br>
> >MemoryGetMaximumUsage>() call report different things.<br>
> ><br>
> ><br>
> > The reason i am asking is because i call the PetscMemoryGetCurrentUsage<br>
> > fcn in my code and it shows:<br>
> > 5.25558e+08.<br>
><br>
> This call get_rusage(), so it gives you the entire process size.<br>
><br>
> > At the end of the run the -memory_info option reports:<br>
> > max process malloc()'ed: 4.00524e+08<br>
><br>
> This is a sampling of rusage every time an object is destroyed.<br>
><br>
> > max petsc malloc()'ed: 1.15254e+08.<br>
><br>
> This is all the memory malloced using PetscMalloc() summed.<br>
><br>
> Matt<br>
><br>
> > So i am a little confused by those numbers unless the fcn call is the<br>
> > more complete picture (as said on the manual page)<br>
> ><br>
> ><br>
> > I guess then my question is whether the -memory_info corresponds to the<br>
> > PetscMalloc* fcns?<br>
> ><br>
> ><br>
> > thanks<br>
> > matt<br>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p><p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p></body></html>