![]() ![]() In bash, we need to specify the full path, such as /usr/bin/time, because the bash built-in time keyword doesn’t support the -f option: $ /usr/bin/time -f '%M' top ![]() Apart from memory usage, GNU time with the %P option provides unrelated statistics (%CPU), which depends on the scheduler and is therefore quite variable: $ /usr/bin/time -f "%P %M" top ![]() In this case, it’s the “Maximum resident set size” that tells us so: $ /usr/bin/time -v top | grep "Maximum resident set size" Suppose we want to know the peak memory usage of the ‘ top‘ process. Let’s understand the GNU time in the given context by going through a few examples. We’ll use atop -w if we need to record the output to a file: $ atop -w filenameĪnd we’ll use atop -r if we need to playback the output from that file: To keep a record, we can schedule a cron job to write the output to a file, so it becomes feasible to play back later. Its advantage is the very useful feature of recording the output in a file.Ĭonsider an issue that happens once and again at a particular time window. It has the command column, which is convenient to recognize the process path.Ītop is again a command like top and htop. Htop is similar to top, but shows more data about a process. Tasks: 1 total, 0 running, 1 sleeping, 0 stopped, 0 zombie ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |