Mailing List Archive
tlug.jp Mailing List tlug archive tlug Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]Re: [tlug] top command: meaning of 'm' in memory related values?
- Date: Sat, 22 Feb 2014 19:09:05 +0100
- From: Bruno Raoult <braoult@example.com>
- Subject: Re: [tlug] top command: meaning of 'm' in memory related values?
- References: <CABEB6AhggofO+qV_BCGF+SAcJgrWw2=5RLZG9o-SWK17q8Zu8w@mail.gmail.com> <CABHGxq6sQiHsSOPyFw+y3R315ytt7EL0fcOnMrLO9F9C9suDQA@mail.gmail.com> <CAAhy3ds5jo9xzc02mr9-qwYSdywhh4OMeiCg0XxhjJ+eefOfkQ@mail.gmail.com> <CAJA1Y2ZX6jbfnfNEiD_W6hufj-CZAS-LiFCXvQFLPK5fmKsGCQ@mail.gmail.com>
On Sat, Feb 22, 2014 at 12:32 PM, Bruno Raoult <braoult@example.com> wrote:
Hi,On Sat, Feb 22, 2014 at 9:02 AM, Raymond Wan <rwan.kyoto@example.com> wrote:
On Sat, Feb 22, 2014 at 7:47 AM, Jim Breen <jimbreen@example.com> wrote:Yes and similarly, "g" means gigabytes. I've seen that a before, too...
> I've always thought it meant "megabytes".
>
> The man page says "VIRT -- Virtual Image (kb)", but I suspect
> it's out-of-date.
The manpage says "VIRT -- Virtual Memory Size (KiB)"I would think that all values in top are expressed in (SIC) "kibibytes (KiB), mebibytes (MiB) or gibibytes (GiB)" rather than kilo/mega/gigabytes.
I had a look on top source code, as I was not 100% sure of my guess...From line 1064 of top.c is the confirmation of hard-coded values in base 2 units:
static const char *scale_num (unsigned long num, const int width, const int type) {
// kilobytes, megabytes, gigabytes, terabytes, duh!
static double scale[] = { 1024.0, 1024.0*1024, 1024.0*1024*1024, 1024.0*1024*1024*1024, 0 };
// kilo, mega, giga, tera, none
#ifdef CASEUP_SUFIX
static char nextup[] = { 'K', 'M', 'G', 'T', 0 };
#else
static char nextup[] = { 'k', 'm', 'g', 't', 0 };
#endifI cannot say I like very much the compilation-time switch between cases (I don't understand this choice at all).
You may note also that top cannot handle more than tera unit, which is surely enough for all of us, and for long enough.
Your grand-children may need to add a few units ;-)br.
--
2 + 2 = 5, for very large values of 2.
- References:
- [tlug] top command: meaning of 'm' in memory related values?
- From: Hector Akamine
- Re: [tlug] top command: meaning of 'm' in memory related values?
- From: Jim Breen
- Re: [tlug] top command: meaning of 'm' in memory related values?
- From: Raymond Wan
- Re: [tlug] top command: meaning of 'm' in memory related values?
- From: Bruno Raoult
Home | Main Index | Thread Index
- Prev by Date: Re: [tlug] top command: meaning of 'm' in memory related values?
- Next by Date: Re: [tlug] What is the Sysadmin pager these days?
- Previous by thread: Re: [tlug] top command: meaning of 'm' in memory related values?
- Next by thread: Re: [tlug] top command: meaning of 'm' in memory related values?
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links