* [sisyphus] Статистика использования памяти @ 2003-11-02 8:37 Yura Zotov 2003-11-02 11:18 ` Eugene Ostapets 0 siblings, 1 reply; 6+ messages in thread From: Yura Zotov @ 2003-11-02 8:37 UTC (permalink / raw) To: Sisyphus List Решил я собрать статистику использования памяти и понял, что ничего не понимаю. Почему-то в /proc/meminfo нет параметра "использовано памяти", зато есть куча других, из которых мне понятны только три MemTotal, SwapTotal и SwapFree. Например сейчас показывается что у меня из гигабайта свободно всего 300 мегабайт памяти, хотя все запущенные приложения не могут столько занимать. При этом gkrellm сообщает, что занято "на самом деле" всего 240 мегабайт. Откуда он это берёт я тоже не понимаю. Если верить в свободные 300, то пора покупать память, если в занятые 240, то не пора. Так как же это всё понимать? Как из параметров в /proc/meminfo сделать правильные выводы? Где бы почитать и разобраться? Заранее спасибо за помощь. -- Юрий А. Зотов ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [sisyphus] Статистика использования памяти 2003-11-02 8:37 [sisyphus] Статистика использования памяти Yura Zotov @ 2003-11-02 11:18 ` Eugene Ostapets 2003-11-02 15:25 ` [sisyphus] Re: [JT] " Michael Shigorin 2003-11-02 19:03 ` [sisyphus] " Yura Zotov 0 siblings, 2 replies; 6+ messages in thread From: Eugene Ostapets @ 2003-11-02 11:18 UTC (permalink / raw) To: sisyphus Yura Zotov пишет: > Решил я собрать статистику использования памяти и понял, что > ничего не понимаю. > > Почему-то в /proc/meminfo нет параметра "использовано памяти", > зато есть куча других, из которых мне понятны только три > MemTotal, SwapTotal и SwapFree. Например сейчас показывается что > у меня из гигабайта свободно всего 300 мегабайт памяти, хотя все > запущенные приложения не могут столько занимать. При этом gkrellm > сообщает, что занято "на самом деле" всего 240 мегабайт. Откуда он > это берёт я тоже не понимаю. > > Если верить в свободные 300, то пора покупать память, если в > занятые 240, то не пора. Так как же это всё понимать? Как из > параметров в /proc/meminfo сделать правильные выводы? Где бы > почитать и разобраться? > > Заранее спасибо за помощь. > > -- > Юрий А. Зотов > В ядра 2.4 исповедуется Сановский принцип: свободная память - потерянная память. Т.е. из вывода команды free: eugene@master ~ $ free total used free shared buffers cached Mem: 192400 187592 4808 0 9984 54948 -/+ buffers/cache: 122660 69740 Swap: 506008 7252 498756 Размер свободной памяти явлется суммой free+cached. -- С уважением, Евгений Остапец +380 44 459 28 79 http://www.unisoft.com.ua ^ permalink raw reply [flat|nested] 6+ messages in thread
* [sisyphus] Re: [JT] Статистика использования памяти 2003-11-02 11:18 ` Eugene Ostapets @ 2003-11-02 15:25 ` Michael Shigorin 2003-11-02 21:13 ` Eugene Ostapets 2003-11-02 19:03 ` [sisyphus] " Yura Zotov 1 sibling, 1 reply; 6+ messages in thread From: Michael Shigorin @ 2003-11-02 15:25 UTC (permalink / raw) To: sisyphus On Sun, Nov 02, 2003 at 01:18:41PM +0200, Eugene Ostapets wrote: > В ядра 2.4 исповедуется Сановский принцип: свободная память - > потерянная память. s/2\.4/Linux/ :-) -- ---- WBR, Michael Shigorin <mike@altlinux.ru> ------ Linux.Kiev http://www.linux.kiev.ua/ ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [sisyphus] Re: [JT] Статистика использования памяти 2003-11-02 15:25 ` [sisyphus] Re: [JT] " Michael Shigorin @ 2003-11-02 21:13 ` Eugene Ostapets 0 siblings, 0 replies; 6+ messages in thread From: Eugene Ostapets @ 2003-11-02 21:13 UTC (permalink / raw) To: sisyphus Michael Shigorin пишет: > On Sun, Nov 02, 2003 at 01:18:41PM +0200, Eugene Ostapets wrote: > >>В ядра 2.4 исповедуется Сановский принцип: свободная память - >>потерянная память. > > > s/2\.4/Linux/ > :-) > Не суть важно:) -- С уважением, Евгений Остапец +380 44 459 28 79 http://www.unisoft.com.ua ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [sisyphus] Статистика использования памяти 2003-11-02 11:18 ` Eugene Ostapets 2003-11-02 15:25 ` [sisyphus] Re: [JT] " Michael Shigorin @ 2003-11-02 19:03 ` Yura Zotov 2003-11-02 23:24 ` Yura Zotov 1 sibling, 1 reply; 6+ messages in thread From: Yura Zotov @ 2003-11-02 19:03 UTC (permalink / raw) To: sisyphus On Sun, Nov 02, 2003 at 01:18:41PM +0200, Eugene Ostapets wrote: > Yura Zotov пишет: > >Решил я собрать статистику использования памяти и понял, что > >ничего не понимаю. > > > >Почему-то в /proc/meminfo нет параметра "использовано памяти", > >зато есть куча других, из которых мне понятны только три > >MemTotal, SwapTotal и SwapFree. Например сейчас показывается что > >у меня из гигабайта свободно всего 300 мегабайт памяти, хотя все > >запущенные приложения не могут столько занимать. При этом gkrellm > >сообщает, что занято "на самом деле" всего 240 мегабайт. Откуда он > >это берёт я тоже не понимаю. > > > >Если верить в свободные 300, то пора покупать память, если в > >занятые 240, то не пора. Так как же это всё понимать? Как из > >параметров в /proc/meminfo сделать правильные выводы? Где бы > >почитать и разобраться? > > > >Заранее спасибо за помощь. > > > >-- > >Юрий А. Зотов > > > > В ядра 2.4 исповедуется Сановский принцип: свободная память - потерянная > память. Т.е. из вывода команды free: > eugene@master ~ $ free > total used free shared buffers cached > Mem: 192400 187592 4808 0 9984 54948 > -/+ buffers/cache: 122660 69740 > Swap: 506008 7252 498756 > > Размер свободной памяти явлется суммой free+cached. Что ж, спасибо. С этим, вроде бы, разобрался. Правда, не без помощи исходников gkrellm. Непонятность заключалась в том, что vmstat в колонке cache показывает значение, отличное от значения в /proc/meminfo. /proc/meminfo: total: used: free: shared: buffers: cached: Mem: 1058619392 822013952 236605440 0 180596736 309510144 ... SwapCached: 29816 kB .... Так вот, vmstat cache = cached - SwapCached. В gkrellm для вычисления занятой памяти используют формулу (для значений в /proc/meminfo) "использовано" = used - buffers - cached. Похоже, что формула достаточно адекватно отражает статистику использования памяти. Как влияет вычитание SwapCached я ещё не определил, так как не было ситуации с активным использованием свопа. К тому же оказалось, что при периодическом режиме работы (с ключом -n), vmstat показывает не procs memory swap io system cpu r b w swpd free buff cache si so bi bo in cs us sy id 2 0 0 117128 226492 176444 274564 2 2 42 62 0 21 5 1 29 а procs memory swap io system cpu r b w swpd free inact active si so bi bo in cs us sy id 3 0 0 117128 226464 285700 479964 2 2 42 62 2 21 5 1 29 4 0 0 117128 226472 285692 479964 0 0 0 0 146994 1416 52 2 46 т.е. появляются какие-то inact и active. Кто знает, что они значат и как их использовать для вычисления использованной памяти? Никакой комбинации из total, free, active и inactive я не придумал, чтобы она была равна значению из вышеприведённой формулы. А график то хочется построить! Значения в одноимённых полях у программ top, free и vmstat совпадают. -- Юрий А. Зотов ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [sisyphus] Статистика использования памяти 2003-11-02 19:03 ` [sisyphus] " Yura Zotov @ 2003-11-02 23:24 ` Yura Zotov 0 siblings, 0 replies; 6+ messages in thread From: Yura Zotov @ 2003-11-02 23:24 UTC (permalink / raw) To: sisyphus On Sun, Nov 02, 2003 at 10:03:04PM +0300, Yura Zotov wrote: > On Sun, Nov 02, 2003 at 01:18:41PM +0200, Eugene Ostapets wrote: > > Yura Zotov пишет: <skip> > К тому же оказалось, что при периодическом режиме работы (с > ключом -n), vmstat показывает не > procs memory swap io system cpu > r b w swpd free buff cache si so bi bo in cs us sy id > 2 0 0 117128 226492 176444 274564 2 2 42 62 0 21 5 1 29 > > а > > procs memory swap io system cpu > r b w swpd free inact active si so bi bo in cs us sy id > 3 0 0 117128 226464 285700 479964 2 2 42 62 2 21 5 1 29 > 4 0 0 117128 226472 285692 479964 0 0 0 0 146994 1416 52 2 46 > > т.е. появляются какие-то inact и active. Кстати, это оказался баг. В операторе case забыли поставить break. :-) А я два дня понять не мог, что же у меня за цифры в логах! Кошмар! Баг в bugzilla записан. -- Юрий А. Зотов ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2003-11-02 23:24 UTC | newest] Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2003-11-02 8:37 [sisyphus] Статистика использования памяти Yura Zotov 2003-11-02 11:18 ` Eugene Ostapets 2003-11-02 15:25 ` [sisyphus] Re: [JT] " Michael Shigorin 2003-11-02 21:13 ` Eugene Ostapets 2003-11-02 19:03 ` [sisyphus] " Yura Zotov 2003-11-02 23:24 ` Yura Zotov
ALT Linux Sisyphus discussions This inbox may be cloned and mirrored by anyone: git clone --mirror http://lore.altlinux.org/sisyphus/0 sisyphus/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 sisyphus sisyphus/ http://lore.altlinux.org/sisyphus \ sisyphus@altlinux.ru sisyphus@altlinux.org sisyphus@lists.altlinux.org sisyphus@lists.altlinux.ru sisyphus@lists.altlinux.com sisyphus@linuxteam.iplabs.ru sisyphus@list.linux-os.ru public-inbox-index sisyphus Example config snippet for mirrors. Newsgroup available over NNTP: nntp://lore.altlinux.org/org.altlinux.lists.sisyphus AGPL code for this site: git clone https://public-inbox.org/public-inbox.git