Check which process is using most memory and summary total used memory
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
by the following command we can check which process is using most memory
as we can see the first field show in MB the used for each process
is it possible by awk to sum all the numbers and to get final used number in MB?
for example
24738.3 MB
the command to show all process and their used in MB ( memory )
ps aux | awk 'print $6/1024 " MBtt" $01' | sort -n
4.74609 MB postgres
5.01562 MB postgres
5.19922 MB postgres
5.3125 MB postgres
5.33203 MB postgres
5.35156 MB postgres
5.43359 MB postgres
5.53906 MB WEPLO_qw
5.56641 MB postgres
5.56641 MB postgres
5.64062 MB WEPLO_qw
5.65234 MB postgres
5.68359 MB postgres
5.75391 MB postgres
5.97656 MB postgres
6.33594 MB postgres
6.55469 MB postgres
6.57031 MB postgres
6.60547 MB postgres
6.63672 MB postgres
7 MB postgres
7.81641 MB postgres
8.07812 MB postgres
9.67578 MB postgres
10.0234 MB YTE
11.5156 MB YTE
14.8828 MB HTE_DS
15.2305 MB hdfs
16.9297 MB postgres
18.0781 MB postgres
18.1172 MB postgres
18.2812 MB postgres
19.2695 MB WEPLO_qw
21.1055 MB postgres
21.1914 MB postgres
21.6367 MB postgres
21.9062 MB postgres
23.5078 MB postgres
24.4727 MB polkitd
27.0938 MB postgres
27.4375 MB apache
28.0234 MB apache
28.6445 MB WEPLO_qw
29 MB apache
30.4336 MB apache
30.5664 MB apache
32.4727 MB apache
32.9023 MB apache
50.1758 MB WEPLO_qw
69.3398 MB HTE_DS
72.7852 MB HTE_DS
72.7891 MB HTE_DS
72.7969 MB HTE_DS
72.8008 MB HTE_DS
72.8047 MB HTE_DS
72.8125 MB HTE_DS
72.8242 MB HTE_DS
72.8281 MB HTE_DS
72.832 MB HTE_DS
72.8359 MB HTE_DS
72.8438 MB HTE_DS
72.8477 MB HTE_DS
72.8516 MB HTE_DS
72.8555 MB HTE_DS
72.8594 MB HTE_DS
72.8633 MB HTE_DS
73.6602 MB HTE_DS
74.418 MB HTE_DS
75.2188 MB HTE_DS
76.6641 MB HTE_DS
76.75 MB HTE_DS
78.4688 MB HTE_DS
78.9492 MB HTE_DS
85.2031 MB WEPLO_qw
87.2344 MB gdm
87.6367 MB WEPLO_qw
100.711 MB hdfs
114.703 MB hdfs
132.32 MB rabbitmq
191.383 MB hdfs
204.285 MB hdfs
298.152 MB hdfs
360.168 MB hdfs
360.402 MB mapred
383.41 MB Jko_+
387.973 MB HTE_DS
412.961 MB hdfs
499.574 MB hdfs
562.395 MB hdfs
689.383 MB hdfs
802.691 MB WEPLO_qw
886.816 MB YTE
1017.73 MB PLOT
1531.73 MB zookeep+
1566.29 MB HUT_OP
1739.48 MB kafka
2275.65 MB YTE
2738.92 MB Grt-worker
4222.77 MB anti-spam
linux awk process perl memory
add a comment |
up vote
0
down vote
favorite
by the following command we can check which process is using most memory
as we can see the first field show in MB the used for each process
is it possible by awk to sum all the numbers and to get final used number in MB?
for example
24738.3 MB
the command to show all process and their used in MB ( memory )
ps aux | awk 'print $6/1024 " MBtt" $01' | sort -n
4.74609 MB postgres
5.01562 MB postgres
5.19922 MB postgres
5.3125 MB postgres
5.33203 MB postgres
5.35156 MB postgres
5.43359 MB postgres
5.53906 MB WEPLO_qw
5.56641 MB postgres
5.56641 MB postgres
5.64062 MB WEPLO_qw
5.65234 MB postgres
5.68359 MB postgres
5.75391 MB postgres
5.97656 MB postgres
6.33594 MB postgres
6.55469 MB postgres
6.57031 MB postgres
6.60547 MB postgres
6.63672 MB postgres
7 MB postgres
7.81641 MB postgres
8.07812 MB postgres
9.67578 MB postgres
10.0234 MB YTE
11.5156 MB YTE
14.8828 MB HTE_DS
15.2305 MB hdfs
16.9297 MB postgres
18.0781 MB postgres
18.1172 MB postgres
18.2812 MB postgres
19.2695 MB WEPLO_qw
21.1055 MB postgres
21.1914 MB postgres
21.6367 MB postgres
21.9062 MB postgres
23.5078 MB postgres
24.4727 MB polkitd
27.0938 MB postgres
27.4375 MB apache
28.0234 MB apache
28.6445 MB WEPLO_qw
29 MB apache
30.4336 MB apache
30.5664 MB apache
32.4727 MB apache
32.9023 MB apache
50.1758 MB WEPLO_qw
69.3398 MB HTE_DS
72.7852 MB HTE_DS
72.7891 MB HTE_DS
72.7969 MB HTE_DS
72.8008 MB HTE_DS
72.8047 MB HTE_DS
72.8125 MB HTE_DS
72.8242 MB HTE_DS
72.8281 MB HTE_DS
72.832 MB HTE_DS
72.8359 MB HTE_DS
72.8438 MB HTE_DS
72.8477 MB HTE_DS
72.8516 MB HTE_DS
72.8555 MB HTE_DS
72.8594 MB HTE_DS
72.8633 MB HTE_DS
73.6602 MB HTE_DS
74.418 MB HTE_DS
75.2188 MB HTE_DS
76.6641 MB HTE_DS
76.75 MB HTE_DS
78.4688 MB HTE_DS
78.9492 MB HTE_DS
85.2031 MB WEPLO_qw
87.2344 MB gdm
87.6367 MB WEPLO_qw
100.711 MB hdfs
114.703 MB hdfs
132.32 MB rabbitmq
191.383 MB hdfs
204.285 MB hdfs
298.152 MB hdfs
360.168 MB hdfs
360.402 MB mapred
383.41 MB Jko_+
387.973 MB HTE_DS
412.961 MB hdfs
499.574 MB hdfs
562.395 MB hdfs
689.383 MB hdfs
802.691 MB WEPLO_qw
886.816 MB YTE
1017.73 MB PLOT
1531.73 MB zookeep+
1566.29 MB HUT_OP
1739.48 MB kafka
2275.65 MB YTE
2738.92 MB Grt-worker
4222.77 MB anti-spam
linux awk process perl memory
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
by the following command we can check which process is using most memory
as we can see the first field show in MB the used for each process
is it possible by awk to sum all the numbers and to get final used number in MB?
for example
24738.3 MB
the command to show all process and their used in MB ( memory )
ps aux | awk 'print $6/1024 " MBtt" $01' | sort -n
4.74609 MB postgres
5.01562 MB postgres
5.19922 MB postgres
5.3125 MB postgres
5.33203 MB postgres
5.35156 MB postgres
5.43359 MB postgres
5.53906 MB WEPLO_qw
5.56641 MB postgres
5.56641 MB postgres
5.64062 MB WEPLO_qw
5.65234 MB postgres
5.68359 MB postgres
5.75391 MB postgres
5.97656 MB postgres
6.33594 MB postgres
6.55469 MB postgres
6.57031 MB postgres
6.60547 MB postgres
6.63672 MB postgres
7 MB postgres
7.81641 MB postgres
8.07812 MB postgres
9.67578 MB postgres
10.0234 MB YTE
11.5156 MB YTE
14.8828 MB HTE_DS
15.2305 MB hdfs
16.9297 MB postgres
18.0781 MB postgres
18.1172 MB postgres
18.2812 MB postgres
19.2695 MB WEPLO_qw
21.1055 MB postgres
21.1914 MB postgres
21.6367 MB postgres
21.9062 MB postgres
23.5078 MB postgres
24.4727 MB polkitd
27.0938 MB postgres
27.4375 MB apache
28.0234 MB apache
28.6445 MB WEPLO_qw
29 MB apache
30.4336 MB apache
30.5664 MB apache
32.4727 MB apache
32.9023 MB apache
50.1758 MB WEPLO_qw
69.3398 MB HTE_DS
72.7852 MB HTE_DS
72.7891 MB HTE_DS
72.7969 MB HTE_DS
72.8008 MB HTE_DS
72.8047 MB HTE_DS
72.8125 MB HTE_DS
72.8242 MB HTE_DS
72.8281 MB HTE_DS
72.832 MB HTE_DS
72.8359 MB HTE_DS
72.8438 MB HTE_DS
72.8477 MB HTE_DS
72.8516 MB HTE_DS
72.8555 MB HTE_DS
72.8594 MB HTE_DS
72.8633 MB HTE_DS
73.6602 MB HTE_DS
74.418 MB HTE_DS
75.2188 MB HTE_DS
76.6641 MB HTE_DS
76.75 MB HTE_DS
78.4688 MB HTE_DS
78.9492 MB HTE_DS
85.2031 MB WEPLO_qw
87.2344 MB gdm
87.6367 MB WEPLO_qw
100.711 MB hdfs
114.703 MB hdfs
132.32 MB rabbitmq
191.383 MB hdfs
204.285 MB hdfs
298.152 MB hdfs
360.168 MB hdfs
360.402 MB mapred
383.41 MB Jko_+
387.973 MB HTE_DS
412.961 MB hdfs
499.574 MB hdfs
562.395 MB hdfs
689.383 MB hdfs
802.691 MB WEPLO_qw
886.816 MB YTE
1017.73 MB PLOT
1531.73 MB zookeep+
1566.29 MB HUT_OP
1739.48 MB kafka
2275.65 MB YTE
2738.92 MB Grt-worker
4222.77 MB anti-spam
linux awk process perl memory
by the following command we can check which process is using most memory
as we can see the first field show in MB the used for each process
is it possible by awk to sum all the numbers and to get final used number in MB?
for example
24738.3 MB
the command to show all process and their used in MB ( memory )
ps aux | awk 'print $6/1024 " MBtt" $01' | sort -n
4.74609 MB postgres
5.01562 MB postgres
5.19922 MB postgres
5.3125 MB postgres
5.33203 MB postgres
5.35156 MB postgres
5.43359 MB postgres
5.53906 MB WEPLO_qw
5.56641 MB postgres
5.56641 MB postgres
5.64062 MB WEPLO_qw
5.65234 MB postgres
5.68359 MB postgres
5.75391 MB postgres
5.97656 MB postgres
6.33594 MB postgres
6.55469 MB postgres
6.57031 MB postgres
6.60547 MB postgres
6.63672 MB postgres
7 MB postgres
7.81641 MB postgres
8.07812 MB postgres
9.67578 MB postgres
10.0234 MB YTE
11.5156 MB YTE
14.8828 MB HTE_DS
15.2305 MB hdfs
16.9297 MB postgres
18.0781 MB postgres
18.1172 MB postgres
18.2812 MB postgres
19.2695 MB WEPLO_qw
21.1055 MB postgres
21.1914 MB postgres
21.6367 MB postgres
21.9062 MB postgres
23.5078 MB postgres
24.4727 MB polkitd
27.0938 MB postgres
27.4375 MB apache
28.0234 MB apache
28.6445 MB WEPLO_qw
29 MB apache
30.4336 MB apache
30.5664 MB apache
32.4727 MB apache
32.9023 MB apache
50.1758 MB WEPLO_qw
69.3398 MB HTE_DS
72.7852 MB HTE_DS
72.7891 MB HTE_DS
72.7969 MB HTE_DS
72.8008 MB HTE_DS
72.8047 MB HTE_DS
72.8125 MB HTE_DS
72.8242 MB HTE_DS
72.8281 MB HTE_DS
72.832 MB HTE_DS
72.8359 MB HTE_DS
72.8438 MB HTE_DS
72.8477 MB HTE_DS
72.8516 MB HTE_DS
72.8555 MB HTE_DS
72.8594 MB HTE_DS
72.8633 MB HTE_DS
73.6602 MB HTE_DS
74.418 MB HTE_DS
75.2188 MB HTE_DS
76.6641 MB HTE_DS
76.75 MB HTE_DS
78.4688 MB HTE_DS
78.9492 MB HTE_DS
85.2031 MB WEPLO_qw
87.2344 MB gdm
87.6367 MB WEPLO_qw
100.711 MB hdfs
114.703 MB hdfs
132.32 MB rabbitmq
191.383 MB hdfs
204.285 MB hdfs
298.152 MB hdfs
360.168 MB hdfs
360.402 MB mapred
383.41 MB Jko_+
387.973 MB HTE_DS
412.961 MB hdfs
499.574 MB hdfs
562.395 MB hdfs
689.383 MB hdfs
802.691 MB WEPLO_qw
886.816 MB YTE
1017.73 MB PLOT
1531.73 MB zookeep+
1566.29 MB HUT_OP
1739.48 MB kafka
2275.65 MB YTE
2738.92 MB Grt-worker
4222.77 MB anti-spam
linux awk process perl memory
linux awk process perl memory
edited Nov 29 at 13:38
Jeff Schaller
37.4k1052121
37.4k1052121
asked Nov 29 at 11:45
yael
2,3321956
2,3321956
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
up vote
1
down vote
accepted
Try this ,
If you want to add the total of the memory column from ps aux
,
ps aux | awk 'print $6/1024' | xargs | sed -E 's/ /+/g' | bc
This will give you the answer in MegaBytes.
On the other hand you can also check the memory
statistics of the system using sar
, free
, vmstat
, pidstat
, or top
. Just refer their man
pages for more info.
add a comment |
up vote
1
down vote
Yes awk can add:
ps aux | awk 't+=$6 ENDprint t/1024 "MB"'
# or if you prefer to be explicit
ps aux | awk 't=t+$6 ENDprint t/1024 "MB"'
# or even more explicit (though awk does NOT need this)
ps aux | awk 'BEGINt=0 t=t+$6 ENDprint t/1024 "MB"'
It can do lots of other clever and sometimes powerful things also. But they remain closely held secrets because to find them you would have to look at the man page (or in prehistoric times, a thing called a "book" published by OReilly) and no one in the modern world can do that.
I don't see how computing the total memory used by all processes helps you "check which process is using the most memory" though.
If what you want is to display each item AND the total, awk can do that:
ps aux | awk 'print $6/1024 "tt" $1; t+=$6 ENDprint t/1024 "ttTOTAL"'
If you wanted to sort the items in order of decreasing (or for that matter increasing) memory size, GNU awk (a common implementation but not the only one) can do that, but on Unix there is a sort
program already available that is often more convenient.
your answer is very good but sai was the first solution , but any way thank you so much
– yael
Nov 29 at 13:49
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
Try this ,
If you want to add the total of the memory column from ps aux
,
ps aux | awk 'print $6/1024' | xargs | sed -E 's/ /+/g' | bc
This will give you the answer in MegaBytes.
On the other hand you can also check the memory
statistics of the system using sar
, free
, vmstat
, pidstat
, or top
. Just refer their man
pages for more info.
add a comment |
up vote
1
down vote
accepted
Try this ,
If you want to add the total of the memory column from ps aux
,
ps aux | awk 'print $6/1024' | xargs | sed -E 's/ /+/g' | bc
This will give you the answer in MegaBytes.
On the other hand you can also check the memory
statistics of the system using sar
, free
, vmstat
, pidstat
, or top
. Just refer their man
pages for more info.
add a comment |
up vote
1
down vote
accepted
up vote
1
down vote
accepted
Try this ,
If you want to add the total of the memory column from ps aux
,
ps aux | awk 'print $6/1024' | xargs | sed -E 's/ /+/g' | bc
This will give you the answer in MegaBytes.
On the other hand you can also check the memory
statistics of the system using sar
, free
, vmstat
, pidstat
, or top
. Just refer their man
pages for more info.
Try this ,
If you want to add the total of the memory column from ps aux
,
ps aux | awk 'print $6/1024' | xargs | sed -E 's/ /+/g' | bc
This will give you the answer in MegaBytes.
On the other hand you can also check the memory
statistics of the system using sar
, free
, vmstat
, pidstat
, or top
. Just refer their man
pages for more info.
answered Nov 29 at 12:34
sai sasanka
754110
754110
add a comment |
add a comment |
up vote
1
down vote
Yes awk can add:
ps aux | awk 't+=$6 ENDprint t/1024 "MB"'
# or if you prefer to be explicit
ps aux | awk 't=t+$6 ENDprint t/1024 "MB"'
# or even more explicit (though awk does NOT need this)
ps aux | awk 'BEGINt=0 t=t+$6 ENDprint t/1024 "MB"'
It can do lots of other clever and sometimes powerful things also. But they remain closely held secrets because to find them you would have to look at the man page (or in prehistoric times, a thing called a "book" published by OReilly) and no one in the modern world can do that.
I don't see how computing the total memory used by all processes helps you "check which process is using the most memory" though.
If what you want is to display each item AND the total, awk can do that:
ps aux | awk 'print $6/1024 "tt" $1; t+=$6 ENDprint t/1024 "ttTOTAL"'
If you wanted to sort the items in order of decreasing (or for that matter increasing) memory size, GNU awk (a common implementation but not the only one) can do that, but on Unix there is a sort
program already available that is often more convenient.
your answer is very good but sai was the first solution , but any way thank you so much
– yael
Nov 29 at 13:49
add a comment |
up vote
1
down vote
Yes awk can add:
ps aux | awk 't+=$6 ENDprint t/1024 "MB"'
# or if you prefer to be explicit
ps aux | awk 't=t+$6 ENDprint t/1024 "MB"'
# or even more explicit (though awk does NOT need this)
ps aux | awk 'BEGINt=0 t=t+$6 ENDprint t/1024 "MB"'
It can do lots of other clever and sometimes powerful things also. But they remain closely held secrets because to find them you would have to look at the man page (or in prehistoric times, a thing called a "book" published by OReilly) and no one in the modern world can do that.
I don't see how computing the total memory used by all processes helps you "check which process is using the most memory" though.
If what you want is to display each item AND the total, awk can do that:
ps aux | awk 'print $6/1024 "tt" $1; t+=$6 ENDprint t/1024 "ttTOTAL"'
If you wanted to sort the items in order of decreasing (or for that matter increasing) memory size, GNU awk (a common implementation but not the only one) can do that, but on Unix there is a sort
program already available that is often more convenient.
your answer is very good but sai was the first solution , but any way thank you so much
– yael
Nov 29 at 13:49
add a comment |
up vote
1
down vote
up vote
1
down vote
Yes awk can add:
ps aux | awk 't+=$6 ENDprint t/1024 "MB"'
# or if you prefer to be explicit
ps aux | awk 't=t+$6 ENDprint t/1024 "MB"'
# or even more explicit (though awk does NOT need this)
ps aux | awk 'BEGINt=0 t=t+$6 ENDprint t/1024 "MB"'
It can do lots of other clever and sometimes powerful things also. But they remain closely held secrets because to find them you would have to look at the man page (or in prehistoric times, a thing called a "book" published by OReilly) and no one in the modern world can do that.
I don't see how computing the total memory used by all processes helps you "check which process is using the most memory" though.
If what you want is to display each item AND the total, awk can do that:
ps aux | awk 'print $6/1024 "tt" $1; t+=$6 ENDprint t/1024 "ttTOTAL"'
If you wanted to sort the items in order of decreasing (or for that matter increasing) memory size, GNU awk (a common implementation but not the only one) can do that, but on Unix there is a sort
program already available that is often more convenient.
Yes awk can add:
ps aux | awk 't+=$6 ENDprint t/1024 "MB"'
# or if you prefer to be explicit
ps aux | awk 't=t+$6 ENDprint t/1024 "MB"'
# or even more explicit (though awk does NOT need this)
ps aux | awk 'BEGINt=0 t=t+$6 ENDprint t/1024 "MB"'
It can do lots of other clever and sometimes powerful things also. But they remain closely held secrets because to find them you would have to look at the man page (or in prehistoric times, a thing called a "book" published by OReilly) and no one in the modern world can do that.
I don't see how computing the total memory used by all processes helps you "check which process is using the most memory" though.
If what you want is to display each item AND the total, awk can do that:
ps aux | awk 'print $6/1024 "tt" $1; t+=$6 ENDprint t/1024 "ttTOTAL"'
If you wanted to sort the items in order of decreasing (or for that matter increasing) memory size, GNU awk (a common implementation but not the only one) can do that, but on Unix there is a sort
program already available that is often more convenient.
answered Nov 29 at 13:36
dave_thompson_085
2,04711011
2,04711011
your answer is very good but sai was the first solution , but any way thank you so much
– yael
Nov 29 at 13:49
add a comment |
your answer is very good but sai was the first solution , but any way thank you so much
– yael
Nov 29 at 13:49
your answer is very good but sai was the first solution , but any way thank you so much
– yael
Nov 29 at 13:49
your answer is very good but sai was the first solution , but any way thank you so much
– yael
Nov 29 at 13:49
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f484887%2fcheck-which-process-is-using-most-memory-and-summary-total-used-memory%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown