I have a shell script which sets some variables and then calls modules of a program in succession, one by one. Problem is that the script is executed on servers with many users, so sometimes the script starts running, runs for 10 minutes and then breaks due to lack of resources when other users run memory intensive processes.
So, I have an assignment to somehow reserve enough memory when the script is started, so that memory problems are avoided. Also, is there a way to reserve certain number of processes? I don't need a complete solution, just an idea to get started is enough.
From the sounds of it you're on Linux, and running into the OOM-killer when things get tight. Correct me if I'm wrong.
Preallocating memory won't prevent the OOM-killer from hitting you, if anything, hogging more memory and more processes will put you higher in its list. Band-aiding a fix onto your scripts won't stop the server from running out of memory anyway, at best it'll deflect the OOM-kill to something else. What would they rather have die, your scripts, the memory-intensive processes, some daemon, or things more system-critical? They need to add more memory and/or swap, or to start restricting the stupid users that keep bombing the system.
One way to "preallocate" memory in a shell would be to make and clear a large shell variable, I suppose, but that's subject to the max size of a shell variable in your shell and all kinds of hackish and ugly and unlikely to work:
Last edited by Corona688; 09-16-2010 at 12:44 PM..
Hi, i have 2 identical web servers using AIX. I use nmon analyser to check their performance.
The server A exceeds 20% memory usage for system, 5% for cache and the rest 75% for processes. While, it uses 4% of Paging Space.
The server B exceeds 20% for system, 45% for cache and 35% for processes.... (24 Replies)
Hi,
i have this scenario, when i start about 20 java processes simultaneously in unix and run ps -eaf command i can see that processes are running but memory is not getting allocated to them immediately and it stays ideal for at least 10-15 min.
Meanwhile i run free command to check the RAM,... (5 Replies)
Here is the output of top command
So you see 99% of memory is in use -> Mem: 66005468k total, 65662548k used,
How can I find out all processes consuming this 99% memory in descending order of consumption i.e. starting with processes eating more memory.
I need the total of the output to... (3 Replies)
I wanted to know what is the best way to monitor use of memory on an RHEL server. We have 16 GB of memory for the RHEL instance but the usage at any time is more than 99%. I use /proc/meminfo on the server to check memory.
I hope, my question is clear that what is the best way to monitor use of... (2 Replies)
I have the processes (100+) by the oracle id and I'd to get the summarized view of the oracle processes' usage of the memory and the cpu.
top would give me some, but not all.
Thanks (3 Replies)
Hi again!
I have 2 questions ..:
How can i create exactly one number of processes ?
For example i want to create l*n processes and i tried this:
for(i=0;i<l*n;i++){
pid=fork()}
But it creates more than l*n
Also, i want each child to run another x.c program with 3 command line... (1 Reply)
Hi again!
I have 2 questions ..:
How can i create exactly one number of processes ?
For example i want to create l*n processes and i tried this:
for(i=0;i<l*n;i++){
pid=fork()}
But it creates more than l*n
Also, i want each child to run another x.c program with 3 command line... (1 Reply)
Hello ,
I would like to know how to check if a given process id belongs to particualr shared memory segment .
Please help
Thanks in advance (3 Replies)
We have several containers on one machine and would like to reserve some memory for the global zone. capped-memory only allows max physical/swap and setting a max on each container isn't an option. The server has 32GB physical and 30GB swap. Currently there are ten containers on it. Normally... (6 Replies)