Questions tagged [top-command]

Unix/Linux utility providing a "dynamic, real-time view of a running system".

84 questions
10
votes
4 answers

Descrip "top" command in Android

I'm making a small Android application to show current total CPU usage like tab Performance in Windows Task Manager. I use "top -m 1 -n 1 -d 1" to get CPU usage, but i do not really understand the result of "top". The result like: User 5%, system…
VietAnh
  • 125
  • 1
  • 1
  • 7
6
votes
1 answer

top command's CPU usage calculation

I am trying to use GNU coreutil top's formula for calculating CPU usages in percentage. But top is using some half_total, to calculate the percentage, which is adding 0.5 to the percentage. In utils.c of top's source, the following line (at 3.8…
Sabya
  • 11,534
  • 17
  • 67
  • 94
6
votes
1 answer

top -H option in Macosx

In Unix/Linux the top command has the -H option to give a more details information about the threads within a process. On Macosx there seems to be no -H option! Is there anything similar for Macosx?
Paulo Taylor
  • 716
  • 8
  • 18
6
votes
5 answers

top command first iteration always returns the same result

When running top -b -n 1, the command always returns the same CPU values. Consider the following test run 5 times in succession: [user@server ~]$ top -b -n 5 -d.2 | grep "Cpu(s)" Cpu(s): 18.5%us, 10.0%sy, 0.0%ni, 67.0%id, 4.2%wa, 0.0%hi, …
Yacine Filali
  • 1,762
  • 14
  • 17
5
votes
3 answers

Running 'top' in thread produces SIGTTOU

For reasons I won't go into, I need to run a variant of 'top -m io -d 2 10' within a subprocess from a Python thread on FreeBSD 8.1. The trouble is, it seems that sometimes SIGTTOU gets produced (under certain code-dependent conditions that I…
Anthem
  • 51
  • 3
5
votes
5 answers

Why doesn't exec("top"); work on Linux?

I was trying to execute this command echo exec("top"); and echo exec("/usr/bin/top"); neither works (returns blank output) does anybody know why?
genesis
  • 50,477
  • 20
  • 96
  • 125
5
votes
0 answers

qemu-kvm showing over 100% of CPU usage in top command

I am running openstack on centos 7. All openstack services run within docker containers. I keep seeing high CPU usage from qemu-kvm as I launch more instances on openstack. Below is an image showing output from my top command for about 20 seconds…
Joey Corkey
  • 475
  • 1
  • 6
  • 19
5
votes
3 answers

How to limit the number of rows in top command output on Non interactive mode for LINUX

How can we limit the number of rows in the top command output to a specific number 'say 5' in non interactive mode ?
Mathews Jose
  • 399
  • 6
  • 18
4
votes
3 answers

How to correctly save the unix top command output into a variable?

I've got to save the output of the top command into a variable and I do this: myvar=`top -b -n1 | head -n 18` The problem is that it seems to be ignoring the return characters, so when I echo the content of $myvar I see something like: top -…
Cristian
  • 198,401
  • 62
  • 356
  • 264
3
votes
2 answers

top command in linux

I would like to know meaning of each and every column of top command result. If you see the screenshot, It shows lot of Java process under the user 'resoultion'. But here only one Tomcat is running. %Mem is same for some of the processes, The…
Selvakumar Ponnusamy
  • 5,363
  • 7
  • 40
  • 78
3
votes
1 answer

Why the SWAP listed in the detail list of the TOP command is greater than in the summary?

The TOP command results: Mem: 3991840k total, 1496328k used, 2495512k free, 156752k buffers **Swap**: 3905528k total, **3980k** used, 3901548k free, 447860k cached PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ …
Smartkid
  • 1,772
  • 2
  • 25
  • 34
3
votes
1 answer

How To Capture Unix 'Top' Command Output to a CSV file?

I am trying to get first 5 lines of top command through shell script & I need to write the output to a csv file ( I need to monitor the result in every 15 seconds ). Finally I need to plot a graph using the obtained datasheet. I got the shell scrip…
Arun Ramachandran
  • 1,270
  • 5
  • 23
  • 36
3
votes
0 answers

Android top process CPU usage is higher than user and system usage combined

I am trying to monitor CPU usage using the top command in my android phone, using the following command: Process p = Runtime.getRuntime().exec("top -m 15 -d 1 -n 1"); One of the output's of the top command I got is this: User 2%, System 9%, IOW 0%,…
Vikram Gupta
  • 6,496
  • 5
  • 34
  • 47
3
votes
2 answers

Linux Top command with more than 20 commands

I want to use top in order to monitor numerous processes by process name. I already know about doing $ top -p $(pgrep -d ',' ) but top only limits me to 20 pids. Is there a way to allow for more than 20 pids? Do I have to use a combination…
Marcus Gladir
  • 403
  • 1
  • 8
  • 13
2
votes
1 answer

How to get output of any command run inside k8 POD to stout?

My requirement is that in my POD multiple processes are running and I want to collect the metrices for all the processes i.e (CPU AND MEMORY and other details OF all Process). Now , I want to write the output of any command I run inside my pod to…
beingumang
  • 77
  • 2
  • 11