You are not logged in.

#1 2010-07-21 11:44:15

crossecter
Member
Registered: 2010-07-21
Posts: 3

top "-M" option missing in Arch

Hello everyone, I have a small issue that bugs me a bit in my day-to-day stuff.

At work I always keep a top command running on the crunching machine. It has around 32 gigs of ram, so I always use the "-M" option to display the used memory in megabytes (it runs some form of redhat I believe). However, on my home computer running Arch there is no -M option! The only difference I can find is that arch uses top v2.8 and redhat uses v2.7

So should I downgrade? That seems a bit silly for such a simple option...

Offline

#2 2010-07-21 11:50:37

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: top "-M" option missing in Arch

Seems you're right, no -M here.
But I do get

 2897 karol     20   0  370m 190m  24m S  2.0 19.2  15:57.50 firefox

so this only affects the total memory used.

Edit: do you need a list of processes or just the totals? If the latter, there's 'free -m'.

Last edited by karol (2010-07-21 11:59:53)

Offline

#3 2010-07-21 12:27:43

crossecter
Member
Registered: 2010-07-21
Posts: 3

Re: top "-M" option missing in Arch

Yes, the individual processes do get rounded off. I know about free, but I just want to be able to keep track of the total free memory in mb without having to type "free -m" everytime.

Offline

#4 2010-07-21 12:29:41

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: top "-M" option missing in Arch

crossecter wrote:

Yes, the individual processes do get rounded off. I know about free, but I just want to be able to keep track of the total free memory in mb without having to type "free -m" everytime.

Looks like a job for 'watch'!

watch -n 1 -t free -m

Last edited by karol (2010-07-21 12:31:51)

Offline

#5 2010-07-21 12:35:18

crossecter
Member
Registered: 2010-07-21
Posts: 3

Re: top "-M" option missing in Arch

Wow, didn't know that command! That will be useful elsewhere as well, thanks.

Offline

#6 2010-07-21 12:39:03

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: top "-M" option missing in Arch

You can get the memory info from <drum-roll> /proc/meminfo.

less /proc/meminfo

Offline

#7 2010-07-21 13:44:41

manx
Member
From: Staffordshire, England
Registered: 2008-09-27
Posts: 35

Re: top "-M" option missing in Arch

I've always prefered using htop as a direct replacement to top. It shows mbs used by default and has more features.

Offline

#8 2010-07-21 13:46:15

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: top "-M" option missing in Arch

manx wrote:

I've always prefered using htop as a direct replacement to top. It shows mbs used by default and has more features.

At times you don't want features.
To each his own.

Offline

Board footer

Powered by FluxBB