1846819 Members
11365 Online
110256 Solutions
New Discussion

Re: memory full problem

 
Stefano_10
Advisor

memory full problem

Sometimes i have a full memory and full swap problem.
Many processes fail for not enough memory.
Running swapinfo i find memory used up to 100% and swap full up to 98%.
This is not normal it's happened only twice in a year, so i would know which is the cause of this problem.
Which command can i use to understand the possible cause of this problem?
top command and swapinfo are not enough to understand.
Thank you
Stefano
11 REPLIES 11
Tim D Fulford
Honored Contributor

Re: memory full problem

glance is the tool

glance -m # this will show memory usage
glance -w # swap space

You can also look at memory usage by process, when in glance do "M" & enter PID.

Regards

Tim
-
Stefano_10
Advisor

Re: memory full problem

And if i haven't glance?
Ian Dennison_1
Honored Contributor

Re: memory full problem

Glance resides on Application CD 1 or 2 for the current level of OS, with a 60-day instant on trial license.

Does the problem go away by itself or after reboot? is this a possible memory leak?

ps -eafl

Look in the SZ column to see which processes are tying up memory.

Share and Enjoy! Ian
Building a dumber user
Stefano_10
Advisor

Re: memory full problem

Yes, the problem disappear after reboot.
So could you explain me what is a memory leak and how can i manage it?
Thank you
Stefano
Zeev Schultz
Honored Contributor

Re: memory full problem

You say that this happens twice a year?
If this is a memory leak in some of your (or
system ) applications - would require an ammount of work to be done.
Anyway,
1)swapinfo -mt (or glance) for swap
2)vmstat (or glance) for paging activities
Glance can be obtained to evaluational period (60 days I think)

Zeev
So computers don't think yet. At least not chess computers. - Seymour Cray
Wouter Jagers
Honored Contributor

Re: memory full problem

What kind of system are we talking about ? What is its function ? (fileserver, webserver, database, application..)

A memory leak usually drains your resources quite slowly. Is this the case, or is it more of an 'explosive' problem ? The latter might indicate user action: are there any 'special' jobs run by any user (or even cron) around these times ?

Do install that glance trial, it will indeed prove very useful. You will know which process is the problem in a glance !

Regards
an engineer's aim in a discussion is not to persuade, but to clarify.
Caesar_3
Esteemed Contributor

Re: memory full problem

Hello!

Glance will help a lot to see who is take
the memory and how much.
Also in top you could see this.
vmstat good if you not have glance.
swapinfo will show the information about the swap.
And another thing is if you will see that
is your program eat the memory you could
use purify from rational to compile
your code and find where is the leaks.

Caesar
Bill Hassell
Honored Contributor

Re: memory full problem

To solve this problem, you have to determine whether your system is being asked to use all of memory and swap. If this is correct, then your only choice is to add more swap (and RAM to improve performance). To make this determination, you need to know what the normal requirements are for all processes that must run at the same time. If you don't know this information, start by sorting all the running processes by size:

UNIX95= ps -e -o "vsz,ruser,args" | sort -rn

You may want to print this list for future reference. Now if a program(or several program) begin to grow in size (and this is not expected) then the program(s) have a memory leak and the programmer must fix the errors. There is nothing you can do in the operating system to fix a bad program.

Now you may have a number of users that login to your system and then do not log out properly. This will leave shells and processes running until the next reboot. This is a user education problem. You can fix it for a while by adding more RAM and swap space but that just prevents the problem users from making the system run out of memory.

NOTE: using a lot of swap means your system is probably running quite slow. You may need to double or triple the amount of RAM you have in order to improve performance.


Bill Hassell, sysadmin
Massimo Bianchi
Honored Contributor

Re: memory full problem

Hi,
you asked what is a memory leak...

When a programmes writes its code, there are functions to allocate and deallocate memory.
You relaim memory, use it for data, and then release it to the operating system, for the other programs.

A leak is when:
- the programmer did not properly deallocate memory
or
- the function for de-allocating memory didn't work properly.

Which one is hard to tell.

Usually the function for allocating/deallocating memory are written well, but you should check the patched looking tohe word leak, some will appear.
I don't see if you specified your O.S., but in ITRC, under the patch section, choose your O.S. and check if you have all the right patches

In the first case, you must check if your product had a flaw, in the sense i explained.
Usually these are published in the website of the product, you should check there too.


In addition to other suggestion, i will look at this thread:

http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x5daa3a7b3682d611abdb0090277a778c,00.html



Many many good ansers, suggestion, tips and scripts.

HTH,
Massimo

T G Manikandan
Honored Contributor

Re: memory full problem

Also,with all suggestions Please re-check the values of all the kernel parameters.

Higher values of the kernel parameters will increase the amount of locked memory and decrease the amount of available memory.

Parameters like buffer cache(dbc_max_pct),the default value is 50% of memory.
Assume you have 2GB memory,by default 1Gb is taken for buffer cache if you have enabled the dynamic buffer cache.
In this case you can bring that to around 300MB.

ALso some parameters with higher values like the semaphore values will bring down the amount of available memory for the user processes


Thanks
Dagmar Boelen
Frequent Advisor

Re: memory full problem

Hi,

I suggest you write a simple script which logs the output of the commands mentioned above. You can schedule it in crontab and let it run once in every 5 minutes. By making a trend-analysis (when does my memory dissapear? and how fast? by which process? at which time?) you can analyze the problem much easier. If

Regards,

Dagmar