:: Re: [DNG] measure memory usage
Forside
Slet denne besked
Besvar denne besked
Skribent: Ludovic Bellière
Dato:  
Til: dng
Emne: Re: [DNG] measure memory usage
I use the following

>
> watch -n 30 "ps --sort=-rss -eo pmem,rss,vsz,comm|grep ${software} >> ${OUTPUT}"


Where ${software} is a string and ${OUTPUT} is a file. I use the data
stored in the file to plot graphs.

Otherwise, Andy's correct: /proc/${pid}/stat will contain everything you
need.

On 21/08/20 22:23, Hendrik Boom wrote:
> Is there a way for process to ask about its own memory usage?
>
> Something perhaps like the C functions that were available in the dark
> ages on other computer systems that could tell how much memory had
> been allocated but not freed so far? Or some reasonable surrogate?
>
> Yes,I know there are administrative tools that let me survail all the
> processes in the system. But isn't there something the program can do
> for itself without that level of agony?
>
> -- hendrik
>