LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Get max memory usage by process ? (https://www.linuxquestions.org/questions/linux-newbie-8/get-max-memory-usage-by-process-753293/)

Alexiia 09-07-2009 07:55 AM

Get max memory usage by process ?
 
Hello,
I have some issue with a process: it use to much memory.
I am trying to reduce its usage by change parameters and I would like to get the max memory usage.
DO you know how can I get that ?

top and htop do not show me that, as it is only instant usage, and refresh all x seconds. I will miss the memory spike.

Thx

Alexia

clvic 09-07-2009 03:14 PM

I also don't know a specific method to track memory spikes, other than having instruments sampling more often. You could play with ps options and make it run, say, very often to print a specific process' memory utilization to a file.

Another option, is to use the command ulimit (run it from the command line) to limit the maximum memory usage for a process. If you set it to a certain value and you find your program crashing, it is because the program exceeded this limit.

Alexiia 09-08-2009 07:42 AM

thx

I am looking to output the ps command frequently.
A friend spot out that time could fit this usage. I am currently trying to find out how it works.

A.

zhjim 09-08-2009 08:06 AM

Maybe a look at the systat family might help
http://pagesperso-orange.fr/sebastien.godard/

It includes a programm that collects statistics about single processes. pidstat its name


All times are GMT -5. The time now is 01:48 AM.