Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Can anyone suggest me any good tutorial for understanding the top. I have searched on net but still not sure that i understand it. Moreover what are other commands to analyse memory usgae at runtime so that we can detect memory leak problem. I am facing some very serious memory related issues and not able to detect the excat reason for it.
Please help.
Regards,
Raghu
Click here to see the post LQ members have rated as the most helpful post in this thread.
Moreover what are other commands to analyse memory usgae at runtime so that we can detect memory leak problem. I am facing some very serious memory related issues and not able to detect the excat reason for it.
Can anyone suggest me any good tutorial for understanding the top.
The top? You mean not atop, htop, etc, etc. As no one has mentioned 'man top', I have to. You have probably read it, but you start there first.
Quote:
Originally Posted by Raghu140
Moreover what are other commands to analyse memory usgae at runtime so that we can detect memory leak problem. I am facing some very serious memory related issues and not able to detect the excat reason for it.
Again, I'll have to mention vmstat, even though I suspect that you want something different.
I think you probably should have read this before posting, and then should be thinking about how to use the tools which don't directly do what exactly you want, to get useful information.
analyse memory usgae at runtime so that we can detect memory leak problem. I am facing some very serious memory related issues
First read the above link. Most people who think they are seeing the symptoms of a serious memory leak are really just misinterpreting normal behavior of Linux. That link might help you understand whether the "serious memory related issues" you think you have are real.
If the problem is real, there are lots of tools for digging into the details. But none of that is simple. If you post the info that makes you believe you have a memory problem, that may make it easier for us to tell you specific tools and/or documentation to understand the problem.
All of sudden i get this error message in the var log:
Jul 26 20:01:02 localhost kernel: mercd_write: unable to allocate memory 16128
Jul 26 20:01:02 localhost kernel: mercd_write: Unmatching Message Class 16128 and 52 35
Jul 26 20:01:02 localhost kernel: mercd_write: Current Message Class 0xfc0 Id 0x1
Jul 26 20:01:02 localhost kernel: mercd_write: Unmatching Message Class 16128 and 52 35
The system runs fine for 3 days. On the 3rd day when the load is at its peak it gives the above error. I took all kinds of logs at this particular time:-
localhost kernel: mercd_write: unable to allocate memory 16128
I don't know what that means. I can only explain why it doesn't mean a shortage of physical memory.
Quote:
I took all kinds of logs at this particular time:-
I assume you mean right after the failure.
There is very little free memory, so either the failing process didn't fully abort or it wasn't using much anonymous memory.
There was very little swap space used, which tends to indicate there was no recent memory pressure.
There are very high buffer and cache levels, also tending to indicate no recent memory pressure.
Top and similar tools tell you about CPU use, which is irrelevant to your problem, and about memory use which also seems to be irrelevant to the problem. So I think you need to be looking elsewhere.
My Problem is that i am not able to locate the problem. Binary seems to be doing fine both in terms of memory and CPU. But the telephony card driver (mercd) is saying its unable to find the memory. Free says that enough memory is availabe. Var log messgae does not say any other thing. I am lost. How to crack this problem.
the telephony card driver (mercd) is saying its unable to find the memory. Free says that enough memory is availabe.
That error message is more likely to mean the driver is either unable to allocate kernel virtual memory or unable to allocate a particular range of low memory for some form of DMA. It does not mean a shortage of the kind of memory reported by free.
Is this a 32 bit or 64 bit system and what distribution and version of Linux is it?
In 32 bit Linux, you might be legitimately exceeding the 1GB limit on kernel virtual memory. There might also be some small resource leak in the mercd or other driver that quickly exhausts the 1GB virtual space before it even becomes obvious that there is a resource leak.
If you were using 64 bit Linux, the kernel virtual memory is nearly unlimited (you'll run out of something else before you run out of kernel virtual memory). So if it is legitimately using over 1GB of kernel virtual, 64 bit would just work. If it is leaking a kernel resource, 64 bit would delay the crash almost indefinitely and certainly long enough to make the leak obvious.
If it is really impractical to switch to 64 bit but you think kernel virtual memory is the problem, you can probably build a new 32 bit kernel with using the option that gives the kernel 2GB virtual.
One of your other posts said RHEL4. RHEL4 had a 32 bit kernel option for 4GB kernel virtual. If you have that kernel, then I'm pretty sure you're not exhausting kernel virtual memory. But that option is an ugly kludge and likely to trigger driver bugs that wouldn't occur in other kernels. So if you have that RHEL4 kernel, it would be better to switch to something else.
Unfortunately, I don't know which tools you would use to investigate the status of kernel virtual memory. The following command gives a lot of info about kernel memory use (you should post its results) but I'm not sure it covers enough uses of kernel virtual memory to see a driver problem with kernel virtual memory.
I don't think so. That seems to report something about "kernel threads" and a lot about non kernel virtual and physical memory. But it doesn't seem to report anything about kernel virtual memory.
Kernel virtual memory is just my wild guess at where the problem might be. I having nothing to support that.
But non kernel virtual and physical memory is the topic already investigated well earlier in this thread and pretty much ruled out as a relevant factor.
I don't think so. That seems to report something about "kernel threads" and a lot about non kernel virtual memory. But it doesn't seem to report anything about kernel virtual memory.
I am using RHEL 4 update 5. uname -a:
Linux localhost.localdomain 2.6.9-55.ELsmp #1 SMP Fri Apr 20 17:03:35 EDT 2007 i686 i686 i386 GNU/Linux.
It's a 32 bit system. vmstat:
procs -----------memory---------- ---swap-- -----io---- --system-- ----cpu----
r b swpd free buff cache si so bi bo in cs us sy id wa
0 0 208 15956 20116 3886644 0 0 4 28 31 7 1 2 97 1
The problem ocuurs after three days of continuous running. I have also observed that the problem occurance time is also same. When suddenly load increases and the telephony card plays the wave file on high load (happens on the third day from restart) then it faces the mentioned problem. when problem starts, it fails to play some request and it also successfully plays some requests. Then number of failures cases keeps on increasing. Finally system hangs and kernel panic error message is generated by the system. Then we do the restart and it works fine for next two days and the problem repeates on third day when suddenly load increases. As per card capacity call peak load is only 30-50% which is ok. if we restart the card driver only (without system restart) then also it the system runs fine for a day.
How to see that what is total size of kernel memory availabe?
How to increase the kernel memory size?
Shall migrating to higher version of RHEL (5.3 etc) will help?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.