Solaris / OpenSolarisThis forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.
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.
I had a server in which memory utilization can be maximum of 8Gb, but some process utilize very high memory (those are BiBuss process). So i want to kill the BiBus process with maximum execution time when memory utilization for the server is near (say) 7.5Gb. Please help on this.
This would be manual effort, i want to automate this, any help on this.
Thanks,
Ankit
You could schedule a script to run periodically that will
1) use "free" to determine the amount of free memory, and if necessary
2) use "ps" to find the process you want to kill and
3) "kill" it
ankitpandey, high memory utilization is not necessarily bad. If you are using 100% of your memory but most of it is buffers and cache, and you are not using any swap, that's a good thing.
On the other hand, if you go from that situation to one where your cache has been trimmed down substantially and you are using a lot of swap, it might be worthwhile to find the process that is using a lot of virtual memory and putting pressure on real memory. (It may have a memory leak, it might be looping, it might be too ambitious. Who knows?) While it may be relatively easy to find the culprit or culprits programatically, it may not be so easy to come up with the criteria for which process to kill. It's very situational, so you won't find many examples of this. And you better make sure that the code you develop is at least as smart as you are. (Is it possible to write code that is smarter than you are?)
Sorry I have no code to offer, but look at 'ps -ely' and the "sz" and "rss" columns. RSS is real memory that the process is occupying; SIZE is roughly the virtual amount of memory that the process is using. (See 'man ps'.)
When the utilization goes to 8Gb then it automatically kill's the j2se process which brings the services down. We had BIBusTKServerMa process which can be killed in the sake to keep the environment up. So i was thinking to kill the BIBusTKServerMa process with maximum run time when memory utilization is near to 8 Gb.
Please suggest.
Thanks,
Ankit
Last edited by ankitpandey; 02-06-2012 at 02:19 AM.
When the utilization goes to 8Gb then it automatically kill's the j2se process which brings the services down.
What kills the j2se process? Is it something you wrote? Is it the system's OOM Killer?
Quote:
Originally Posted by ankitpandey
We had BIBusTKServerMa process which can be killed in the sake to keep the environment up. So i was thinking to kill the BIBusTKServerMa process with maximum run time when memory utilization is near to 8 Gb.
Please suggest.
The BIBusTKServerMa processes are relatively small. I don't think killing them is going to buy you much. Does it help when you kill them manually?
And I go back to my original statement that your system using 8Gb is normally a good thing and not something to worry about. Under normal conditions as your system runs, it will try to cache all of its I/O data in memory. At some point in time you should have a system using nearly all of real memory with a very large cache, and now able to avoid real I/O if the data is in cache! When memory is needed by your applications, it trims back the cache. But in any event, using all of memory is not necessarily bad.
Having your cache trimmed back due to memory pressure, swapping, and running out of swap are bad things. You shouldn't be keying your actions off of memory use going to 8Gb, you should be looking at the larger picture.
Your high use of swap is a concern. (If virtual memory is swapped out and then infrequently referenced that's no big deal - it's just taking disk space - but is that likely with your app?) In all likelyhood, high virtual storage usage is putting pressure on real memory, the system has had to swap out (and in) a lot of pages, meaning I/O and related poor performance. It has also probably trimmed down cache at the same time meaning you're not finding data in the cache and real I/O has to be performed.
This looks like your system is simply too small for the workload that you are putting on it and trying to kill small processes is not going to buy you much in the long run. It really looks like you need more memory added to this system.
Since this is a java app, have you looked into tuning your java? You may get some relief by adjusting heap size and garbage collection frequency. (Something I am unfamiliar with, but seems to help.)
We have 800+ Linux systems running. Here is the output of a 'free' command run on a heavily used WebSphere (apache/java) system.
Its is system that kills j2se process when utilization reaches its limit.
You are quite right that BiBuss acquire very less memory, but yes killing the BiBuss with maximum run helps us in a drop of memory utilization. I feel that most of them get hung and hence acquire more memory than they should ( i cannot proof this).
Can you tell me on adjusting heap size and garbage collection frequency.
As i am not the owner to this environment i cannot make any changes but just to manage what i have been provided.
I had a server in which memory utilization can be maximum of 8Gb, but some process utilize very high memory (those are BiBuss process). So i want to kill the BiBus process with maximum execution time when memory utilization for the server is near (say) 7.5Gb. Please help on this.
Regards,
Ankit
In the future, please try to use 'vbcode' tags at the top of the reply window when showing long lists or data. 'vbcode' tag # is for code while the balloon to the right is for quotes.
I enclosed your output in post #8 as an example.
Please try to provide descriptive titles so members can have an idea of thread content.
FYI: I suggest that you look at 'How to Ask Questions the Smart Way' so in the future your queries provide information that will aid us in diagnosis of the problem or query.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.