OpenVZ Forum


Home » General » Support » memory consumed suddenly increases inspite of no activity taking place..
memory consumed suddenly increases inspite of no activity taking place.. [message #8617] Wed, 29 November 2006 12:59 Go to next message
sanjooz_2002 is currently offline  sanjooz_2002
Messages: 19
Registered: October 2006
Junior Member
Hi,

I am a newbee. So, kindly bear with me if this sounds silly. I have created 4 virtual servers (all running centos) on a main hardware node (which has got centos). I am using 1GB RAM. Recently I found a strange anamoly in the RAM space utilization. After I booted the main hardware node I did a "free -m" and found this:
              total       used       free     shared    buffers     cached
Mem:           942        535        406          0        106        209
-/+ buffers/cache:        219        723
Swap:         1919          0       1919

After some time (approx half an hour), inspite of no activity taking place on the machine, I found the following by using the free -m command:
             total       used       free     shared    buffers     cached
Mem:           942        536        406          0        106        209
-/+ buffers/cache:        219        723
Swap:         1919          0       1919



I tried it again after an hour, and again I found the memory utilization increasing.
             total       used       free     shared    buffers     cached
Mem:           942        537        405          0        107        210
-/+ buffers/cache:        219        723
Swap:         1919          0       1919


It keeps increasing this way, although the system is idle.
I have read few articles suggested in the forum (FAQ) like the foll:
http://gentoo-wiki.com/FAQ_Linux_Memory_Management

But, I really doubt if this is the case because the cache and buffer size are the same and only the amount of memory getting utilzed is increasing.

The only thing that is puzzling me is this that, if there is no activity taking place on my system, how come the memory utilized is increasing???
Can anyone help me in this regard????Thanks in advance!!!

[Moderator: added CODE tags to read free output more easy]

[Updated on: Wed, 29 November 2006 13:20] by Moderator

Report message to a moderator

Re: memory consumed suddenly increases inspite of no activity taking place.. [message #8619 is a reply to message #8617] Wed, 29 November 2006 13:23 Go to previous messageGo to next message
kir is currently offline  kir
Messages: 1645
Registered: August 2005
Location: Moscow, Russia
Senior Member

You can only be sure that there is no activity if you will switch to runlevel 1 and check there are no other processes than init. Otherwise, you certainly have crond, syslogd, sshd and a few other services running -- and they do something from time to time. More to say -- since you have 4 VEs running, they also have crond, syslogd and some other stuff which is running and doing something.

And what you see does not mean there is memory leak or smth. To my mind, it's quite normal.


Kir Kolyshkin
http://static.openvz.org/userbars/openvz-developer.png

[Updated on: Wed, 29 November 2006 13:24]

Report message to a moderator

Re: memory consumed suddenly increases inspite of no activity taking place.. [message #8625 is a reply to message #8617] Wed, 29 November 2006 16:57 Go to previous messageGo to next message
rickb is currently offline  rickb
Messages: 368
Registered: October 2006
Senior Member
For your question about used ram, disregard all lines from 'free -m' except:

-/+ buffers/cache: 219 723

The linux kernel will move data from ram to swap or vice versa and also buffer file reads to try and optimize the overall system. This explains why the values can change despite very little userspace activity. The line above tells you how much ram you have left for allocation by software in your HN and your VEs. This is your main concern. Its good to have extra memory laying around for disk buffers but its not required for your software to function.

When I look at your three free outputs, I only see a few changed values and by only a few megs of ram. This really is nothing to be concerned about.


-------------
Common Terms I post with: http://wiki.openvz.org/Category:Definitions

UBC. Learn it, love it, live it: http://wiki.openvz.org/Proc/user_beancounters
Re: memory consumed suddenly increases inspite of no activity taking place.. [message #8642 is a reply to message #8625] Thu, 30 November 2006 06:56 Go to previous messageGo to next message
sanjooz_2002 is currently offline  sanjooz_2002
Messages: 19
Registered: October 2006
Junior Member
Thanks rickb and kir for the info.

What is puzzling me is this that after couple of hours the memory utilized shoots up to 700+ MB. Furthermore, after that when I try to access my webpage running on one of the virtual servers, which uses mysql db to search for some values, it gave me memory related error.
I believe nobody is accessing the server using any of the available services on the sys for e.g ssh,http,https,mysql etc. Hence, I mentioned that "there was no activity on the system". I apologize if this statement caused any sort of ambiguity. Please do let me know if any further info is required from me inorder to solve this issue (or my doubt incase you dont find this as an issue). Please help!!

Thanks.
Re: memory consumed suddenly increases inspite of no activity taking place.. [message #8645 is a reply to message #8642] Thu, 30 November 2006 07:12 Go to previous messageGo to next message
rickb is currently offline  rickb
Messages: 368
Registered: October 2006
Senior Member
when you say "utilization", what numbers are you referring to?

for memory error, check /proc/user_beancounters first


-------------
Common Terms I post with: http://wiki.openvz.org/Category:Definitions

UBC. Learn it, love it, live it: http://wiki.openvz.org/Proc/user_beancounters
Re: memory consumed suddenly increases inspite of no activity taking place.. [message #8647 is a reply to message #8617] Thu, 30 November 2006 07:40 Go to previous messageGo to next message
sanjooz_2002 is currently offline  sanjooz_2002
Messages: 19
Registered: October 2006
Junior Member
Hi rickb,

By the term "utilization" im referring to the used coloumn in the following output:
total used free shared buffers cached
Mem: 942 561 381 0 106 227
-/+ buffers/cache: 227 715
Swap: 1919 0 191

Following is the memory related error, that i had mentioned previously
ERROR --> Warning: mysql_connect(): Can't create a new thread (errno 12); if you are not out of available memory, you can consult the manual for a possible OS-dependent bug

Please do let me know If my assumtpion that this is a result of memory crunch, is correct or not.

Thanks!
Re: memory consumed suddenly increases inspite of no activity taking place.. [message #8658 is a reply to message #8647] Thu, 30 November 2006 14:00 Go to previous message
dev is currently offline  dev
Messages: 1693
Registered: September 2005
Location: Moscow
Senior Member

12 == ENOMEM means that fork failed due to processes limit.
Check output of /proc/user_beancounters in host system for this VE.
You most likely hit the numproc or kmemsize VE limit.


http://static.openvz.org/userbars/openvz-developer.png
Previous Topic: Swap in OpenVZ
Next Topic: Abilty to read VE /proc without being constrained by UBC
Goto Forum:
  


Current Time: Tue Feb 27 15:04:51 GMT 2024

Total time taken to generate the page: 0.02719 seconds