finding free memory as a non-root user


 
Thread Tools Search this Thread
Operating Systems HP-UX finding free memory as a non-root user
# 1  
Old 08-13-2010
Question finding free memory as a non-root user

All,
I have a software application that requires to find the free memory on the machine. It should work in a hpux Out of the box - in other words, it should use the basic OS commands which are available on every HP-UX machine like top, vmstat and doesn't require the user to purchase 3rd party software like glance.
Also, it will run as a non-root user.

I have been reading this forum about calculating free RAM in this forum and the two most common ways are:

1. Glance (3rd party software)
2. /usr/sbin/swapinfo (must run as root).

Considering I cannot use the above two, what is the option...vmstat?

Now when I run vmstat, it shows
free: 162715
avm: 504267

Where as top shows:
Memory: 319792K (283940K) real, 2116880K (2021256K) virtual, 651088K free Page# 1/14


These numbers don't even match...what am I missing here?

Thanks in advance
# 2  
Old 08-15-2010
performance monitoring in hpux can be done using the following,

glance
gpm
caliper
top; sar; vmstat;
iostat; nfsstat; netstat;
uustat; Glance($)


refer Rosetta Stone for Unix
# 3  
Old 08-15-2010
The units of memory in "vmstat" are "pages". One page = 4 kilobytes (but do check this for your systems).

On large memory systems (more than 2 Gb) some versions of "vmstat" and "top" give wrong figures due to arithmetic overflow. I have not seen this issue with "glance".

In your example, how much memory is fitted and how much swap space is configured?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Is there a way to free up memory manually ?

Hi, I am wondering if there is a way to free up memory in Solaris manually ? the way we can do it in Linux for example : echo `/bin/date` "************* Memory Info Before *************" free -m sync echo 1 > /proc/sys/vm/drop_caches echo 2 > /proc/sys/vm/drop_caches echo 3 >... (13 Replies)
Discussion started by: terrykhatri531
13 Replies

2. UNIX for Dummies Questions & Answers

Sudo to delegate permission from non-root user to another non-root user

I've been through many threads before i decide to create a separate thread. I can't really find the solution to my (simple) problem. Here's what I'm trying to achieve: As "canar" user I want to run a command, let's say "/opt/ocaml/bin/ocaml" as "duck" user. The only to achieve this is to... (1 Reply)
Discussion started by: canar
1 Replies

3. Programming

Memory free() in C

Hi guys. I've a question, if we are using a syscall that receives a string allocated dynamicaly to a determined size, or NUL and it will allocate the apropriate size. We should free the memory or the OS will do it for us? If a function returns a pointer we should free that poiter when we are done... (7 Replies)
Discussion started by: pharaoh
7 Replies

4. UNIX for Advanced & Expert Users

Out of Memory error when free memory size is large

I was running a program and it stopped and showed "Out of Memory!". at that time, the RAM used by this process is around 4G and the free memory size of the machine is around 30G. Does anybody know what maybe the reason? this program is written with Perl. the OS of the machine is Solaris U8. And I... (1 Reply)
Discussion started by: lilili07
1 Replies

5. UNIX for Dummies Questions & Answers

How to allow access to some commands having root privleges to be run bu non root user

hi i am new to unix and i have abig task. i have to \run particular commands having root privileges from a non root user. i know sudo is one of the way but i need sum other approach kindly help Thanks (5 Replies)
Discussion started by: suryashikha
5 Replies

6. Solaris

how to get the more memory free space (see memory free column)

Hi all, Could please let me know how to get the more memory free space (not added the RAM) in local zone. -bash-3.00# vmstat 2 5 kthr memory page disk faults cpu r b w swap free re mf pi po fr de sr s0 s1 s1 s1 in sy cs us sy... (3 Replies)
Discussion started by: murthy76
3 Replies

7. Solaris

How to find Total and Free Physical Memory and Logical Memory in SOLARIS 9

Hi, Im working on Solaris 9 on SPARC-32 bit running on an Ultra-80, and I have to find out the following:- 1. Total Physical Memory in the system(total RAM). 2. Available Physical Memory(i.e. RAM Usage) 3. Total (Logical) Memory in the system 4. Available (Logical) Memory. I know... (4 Replies)
Discussion started by: 0ktalmagik
4 Replies

8. AIX

Free Memory

Hi, how to find free memory in aix? for installing oracle,I have used svmon but not getting proper output (1 Reply)
Discussion started by: manoj.solaris
1 Replies

9. Programming

How to free the memory?

For example if i have the piece of code as follows: CountryName = (char *)malloc((strlen(CountryName)+1)*sizeof(char)); memset(CountryName, 0, strlen(CountryName)+1); CountryName = SOME VALUE Now how do i free the memory after use of this code???? :confused: (3 Replies)
Discussion started by: jazz
3 Replies

10. Shell Programming and Scripting

How to get memory size in HP and not as user root?

Hi falks, I'm trying to get the momory size in HP-UX as user oracle. The command to do it is: /usr/sbin/dmesg | grep "Physical" | awk '{print $2}' The problem is that only user root can run this command and i need to run it as user oracle. Do you know another way to get the memory size in HP... (2 Replies)
Discussion started by: nir_s
2 Replies
Login or Register to Ask a Question