There is no destroy call between PetscMemoryGetCurrentUsage(), PetscMemoryGetMaximumUsage - so MaxUsage isn't updated. Perhaps it should be updated in PetscMemoryGetCurrentUsage() call aswell?
Satish On Fri, 18 Sep 2009, Matt Funk wrote: > Ok, > > i am more confused now. > The following is part of my code: > > PetscLogDouble mem; > PetscMemoryGetCurrentUsage(&mem); > cout<<"PetscMemoryGetCurrentUsage: "<<mem<<"\n"; cout.flush(); > PetscMemoryGetMaximumUsage(&mem); > cout<<"PetscMemoryGetMaximumUsage: "<<mem<<"\n"; cout.flush(); > > > This is what is reported: > > PetscMemoryGetCurrentUsage: 5.25525e+08 > PetscMemoryGetMaximumUsage: 3.09055e+08 > > > 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. > > What am i missing here? > > > thanks > matt > > > > > On Thursday 17 September 2009, you wrote: > > On Thu, Sep 17, 2009 at 6:04 PM, Matt Funk <mafunk at nmsu.edu> wrote: > > > Hi, > > > > > > > > > I am wondering whether the -memory_info option and the > > > PetscMemoryGetMaximumUsage<http://www.mcs.anl.gov/petsc/petsc-as/snapshot > > >s/petsc-current/docs/manualpages/Sys/PetscMemoryGetMaximumUsage.html#Petsc > > >MemoryGetMaximumUsage>() call report different things. > > > > > > > > > The reason i am asking is because i call the PetscMemoryGetCurrentUsage > > > fcn in my code and it shows: > > > 5.25558e+08. > > > > This call get_rusage(), so it gives you the entire process size. > > > > > At the end of the run the -memory_info option reports: > > > max process malloc()'ed: 4.00524e+08 > > > > This is a sampling of rusage every time an object is destroyed. > > > > > max petsc malloc()'ed: 1.15254e+08. > > > > This is all the memory malloced using PetscMalloc() summed. > > > > Matt > > > > > So i am a little confused by those numbers unless the fcn call is the > > > more complete picture (as said on the manual page) > > > > > > > > > I guess then my question is whether the -memory_info corresponds to the > > > PetscMalloc* fcns? > > > > > > > > > thanks > > > matt > > >
