In Linux, how to tell how much memory processes are using?

前端 未结 13 939
情歌与酒
情歌与酒 2020-11-30 17:36

I think I may have a memory leak in my LAMP application (memory gets used up, swap starts getting used, etc.). If I could see how much memory the various processes are using

13条回答
  •  有刺的猬
    2020-11-30 17:50

    The tool you want is ps. To get information about what java programs are doing:

    ps -F -C java 
    

    To get information about http:

    ps -F -C httpd
    

    If your program is ending before you get a chance to run these, open another terminal and run:

    while true; do ps -F -C myCoolCode ; sleep 0.5s ; done
    

提交回复
热议问题