Sponsored Content
Top Forums Shell Programming and Scripting Help with implementing available memory status script Post 302808815 by DGPickett on Friday 17th of May 2013 02:59:07 PM
Old 05-17-2013
This is a recurring stress dream from the pre-UNIX, pre-MULTIX O/S including many IBM O/S. UNIX dies of low swap space, but low RAM is quite desirable (you paid for it, so sw that uses it all, all the time is great), since it is a cache for things on disk. When a process exits, it creates some free pages from freed swap or could-swap-but-swap-never-allocated pages, but mmap() pages like linked dynamic libraries remain in RAM awaiting other mmap() of the same file, like libc.so. If lots of stuff ends and nothing new runs, the free RAM may be substantial and persistent, but it just says you are not using the RAM and the whole machine fully, in ways that exploit the RAM you bought. Just booted systems can be a bit slugish as RAM pages get written from disk, then perk up as more of the pages needed for each new process are already in RAM. A process that mmap()'s files and reads them in excess can roll every other app's pages from RAM, a vulnerability; when it stops, they all gradually return to full responsiveness as they roll in their pages.

Some O/S map swap and /tmp together, so either files in /tmp or many programs malloc()ing lots of space (new'ing objects) can draw down the swap space to dangerous levels. You can make more swap using any local files space using mkswap or the like, in an emergency, but usually the trick is to kill the hog. Sometimes a programmer needs to do things in file space or with mmap() not malloc(), or needs to not run 983 parallel processes, but 32 at a time until all are run (I like 2x the CPU Core count, assuming 50% i/o bound processing). Disk is so cheap, so not being stingy on swap is a great direction, too. Fussing over lack of VM is not worth your time.

Last edited by DGPickett; 05-17-2013 at 04:07 PM..
 

10 More Discussions You Might Find Interesting

1. Solaris

Process Status Without Shared Memory

Hello Folks, On a Solaris 8 system I am trying to diagnosis memory usage of the running processes. I've been using prstat, and top , but the outputs of those include the shared memory used by the process. Hence, more a dozen of running processes are using the shared memory, and the total memory... (1 Reply)
Discussion started by: altinkaya
1 Replies

2. HP-UX

Memory dimm status

Hi, How to check the memory dimm status from OS leavel!! My system model HP N4000. Thanks, ARumugam. (2 Replies)
Discussion started by: arumsun
2 Replies

3. Programming

Solaris CPU/memory status monitoring (Shell script or c++)

i'm trying to find a way to monitor the CPU/Memory status of a solaris station using vmstat. I like to write a small script to periodically run vmstat and store the output. Can anyone show me how (preferrably in C++ if possible)? Thanks in advance. (6 Replies)
Discussion started by: shingpui
6 Replies

4. Shell Programming and Scripting

Implementing Ctrl +C in a script as a part of automation

Hi, I am working on Solaris SPARC where we used start the BEA WebLogic Server for some project module. The server is started very simply by changing to its home directory and starting the script called ./startWebLogic.sh. Upto this no big deal. Once the server get started and comes to... (6 Replies)
Discussion started by: bhaskar_m
6 Replies

5. AIX

Memory status

hi, how to checck memory and paging utilization in mb in aix 6.1 vmstat output is not clear thanks to all (3 Replies)
Discussion started by: sunnybee
3 Replies

6. UNIX for Advanced & Expert Users

prtdiag -v problem :Memory Module Groups status not Showing

Hi Friends, I need a help from you all. In my machine which is on Solaris 9. the command prtdiag -v shows the complete output but it doesn't show "Memory Module Groups status" status. I have tried restarting the picl daemon, but still it doesn't work. Memory Module Groups:... (2 Replies)
Discussion started by: vivek.goel.piet
2 Replies

7. Shell Programming and Scripting

Shell script to find Memory status in AIX

Hi All, There is a shell script that captures Memory status in AIX 6.1 64 bits! I need it to be validated by shell script experts for the following: Shell Script: cat memusageAIX.sh #!/usr/bin/ksh # # Memory usage under AIX # USED=`svmon -G | head -2 | tail -1 | awk '{ print $3... (1 Reply)
Discussion started by: a1_win
1 Replies

8. Shell Programming and Scripting

Script will keep checking running status of another script and also restart called script at night

I am using blow script :-- #!/bin/bash FIND=$(ps -elf | grep "snmp_trap.sh" | grep -v grep) #check snmp_trap.sh is running or not if then # echo "process found" exit 0; else echo "process not found" exec /home/Ketan_r /snmp_trap.sh 2>&1 & disown -h ... (1 Reply)
Discussion started by: ketanraut
1 Replies

9. Shell Programming and Scripting

Need help implementing a timout in my Shell Script for RHEL6

Hey Guys, My problem: I have a script that will be querying the database every minute to see if it gets a response, the response its querying for is "UP" in a table i made called dbup in the database. Now, I am trying to add the component to implement a timeout if the script does not get a... (2 Replies)
Discussion started by: mo_VERTICASQL
2 Replies

10. Shell Programming and Scripting

Help with delaying script and implementing checks before completion

Hello everyone, I was wondering if any of you could help me with this. I am an absolute beginner and don't know how to program, but I can follow a tutorial and tweak code sometimes. My understanding of programing is limitted to what for and while loops do, and how if then else logic works. That... (2 Replies)
Discussion started by: tomeurp
2 Replies
MATCHERRC2PERLFILTER.PL(1)				User Contributed Perl Documentation				MATCHERRC2PERLFILTER.PL(1)

NAME
matcherrc2perlfilter -- Conversion of matcherrc rules to perl DESCRIPTION
This script converts matcherrc filtering rules into perl_filter rules for usage with the claws-mail-perl-filter plugin of the Claws Mail mailer. USAGE
matcherrc2perlfilter No arguments required. Conversion is done for current user only. FILES
$HOME/.claws-mail/matcherrc Input file where standard filtering rules lie. $HOME/.claws-mail/perl_filter Output file written by this script. Converted rules are appended if the file already exists, so be careful when running the script more than once. BUGS
This conversion script doesn't produce nice Perl code and is just intended to get you started. If you choose to use the Perl plugin, consider rewriting your rules. SEE ALSO
claws-mail-perl-filter(1), claws-mail(1) AUTHOR
This manual page was written by Ricardo Mones <mones@debian.org>, for the Debian GNU/Linux system (but may be used by others). The matcherrc2perlfilter was written by Holger Berndt <berndth@gmx.de>. perl v5.14.2 2012-11-17 MATCHERRC2PERLFILTER.PL(1)
All times are GMT -4. The time now is 04:14 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy