![]() ![]() ps -auxĬapture the /proc/PID/smaps and save into some file like BeforeMemInc.txt. procpath plot -d firefox.sqlite -f firefox.Here are the steps that almost guarantee to find what is leaking memory:įind out the PID of the process which causing memory leak. When your application crashes again, you can use this command to visualise CPU usage and resident set size of the application. You can leave it running in a terminal multiplexor (like Byobu) to run it in the background on your server. With this command Procpath will collect and record this tree's Procfs metrics once per 10 seconds. Wit Procpath you can collect process metrics from this tree like the following (and see the documentation if want to ask your allication's process supervisor, say systemd or Docker, for the root PID): procpath record -d firefox.sqlite = "firefox")]' └─ /usr/lib/firefox/firefox -contentproc -childID 8. ![]() ├─ /usr/lib/firefox/firefox -contentproc -parentBuildID. ├─ /usr/lib/firefox/firefox -contentproc -childID 1. ├─ /usr/lib/firefox/firefox -contentproc -childID 2. ├─ /usr/lib/firefox/firefox -contentproc -childID 3. ├─ /usr/lib/firefox/firefox -contentproc -childID 4. On my machine its process tree looks like this: /usr/lib/firefox/firefox Procpath can be used to record Procfs metrics of an application (process trees) including CPU usage and Resident Set Size (RSS). The program quits when you hit Ctrl+C or when the process is killed. You can then redirect its output to a file in order to import it into a spreadsheet later ( python log.py 9391 > firefox_log.txt) and import the data into a spreadsheet selecting Tab as your separator. It will print the cpu usage and ram usage in per cent two times a second: %CPU %MEM You first need to find out the process id of the program you want to monitor, then you can run the script with the PID as an argument: python log.py 3912 ![]() If not len(sys.argv) = 2 or not all(i in string.digits for i in sys.argv): Return (float(d.split()), float(d.split())) if d else None This simple python script should do what you want: import timeĭ = [i for i in commands.getoutput("ps aux").split("\n") ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |