PetscMemoryGetMaximumUsage

Barry Smith bsmith at mcs.anl.gov
Tue May 16 07:25:18 CDT 2006


    Shaman,

      OS's generally never "release" memory that has been allocated
to a process. But if that large chunk of memory is no longer used
by your process eventually its pages will get swapped out and
other processes will be able to use the physical memory.

   The memory usage for the solve on the first process should be
roughly the same amount used as on the other processes so yes
675 MB.

    Barry


On Tue, 16 May 2006, Sh.M wrote:

> Hi again,
>
> I am using the function and when solving a system with 32 CPUs I get that
>
> CPU 0 - max memory usage 10GB(this is mostly due to it reading the matrix
> from file(5GB file),  constructing it and then assembling/distributing it)
>
> CPU 1-31 = max memory usage 675MB per CPU. The maximum amount of memory used
> per CPU is during solve.
>
> Total memory usage: 31GB
>
> The OS does not release the 10GB memory CPU 0 is occupying wich is a bit
> annoying and I can attest to that as when I do operations with CPU 0 as in
> reading another matrix, the memory usage that the OS is reporting is not
> increasing, it stays at 10GB even though I just read another matrix into the
> memory. So while the memory is definitely "freed", it is not released by CPU
> 0 and This seems to be an OS configuration thing I guess.
>
> So my problem is that I have no idea how much memory CPU 0 is actually using
> during the solve.
>
> Can you give a hint or advice on how I should calculate CPU 0 memory usage
> during solve? Would it be roughly 675MB as the other CPUs aswell?
>
> Would the total memory usage during solve actually be closer to
> 22GB(32*675MB) rather than the 31GB(20GB+31*675MB) that I naively
> calculated?
>
> With best regards, Shaman Mahmoudi
>
> ----- Original Message -----
> From: "Barry Smith" <bsmith at mcs.anl.gov>
> To: <petsc-users at mcs.anl.gov>
> Sent: Monday, May 08, 2006 9:31 PM
> Subject: Re: PetscMemoryGetMaximumUsage
>
>
>>
>>    Unfortunately that routine is not currently "wired"; getting actual
>> memory usage is not portable and is a pain.
>>
>>    You can use PetscMallocGetMaximumUsage() to see the maximum amount
>> of memory PETSc has allocated at any one time (in all the PETSc objects).
>>
>>     Barry
>>
>>
>> On Mon, 8 May 2006, Sh.M wrote:
>>
>>> Hi,
>>>
>>> If I want to check the maximum amount of memory PETSc has used during a
>>> program run, is PetscMemoryGetMaximumUsage the function to use? I take
> it a
>>> call to this function will print out how much Process ID X has used, is
> this
>>> correct? So If I want to see the total maximum amount of memory used
> during
>>> a program run, each process should call this function and then I add
> them to
>>> get the total amount, correct?
>>>
>>> Thanks in advance.
>>>
>>> With best regards, Shaman Mahmoudi
>>>
>>>
>>
>
>




More information about the petsc-users mailing list