1833780 Members
2380 Online
110063 Solutions
New Discussion

Confused over memory

 
SOLVED
Go to solution
Tim O'Connell
Regular Advisor

Confused over memory

Hi,

We have 2 x RP5430 HP-UX 11.11 servers. Last night, a HP engineer added an extra 2GB of memory to each server bringing the total memory to 4GB on each server. If I look at the physical memory on the servers thru' sam or thru sysinfo(which runs cstm) I can verify that there is 4GB installed. I need to be sure that it is all available for use. I know TOP isn't very accurate but when I run it server 1 I get very little (49mb) memory free but on the other server it shows almost 2GB free.Swapinfo -tam gives similar results on both servers as below:
swapinfo -tam
Mb Mb Mb PCT START/ Mb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 4096 96 4000 2% 0 - 1 /dev/vg00/lvol2
reserve - 1784 -1784
memory 3149 2215 934 70%
total 7245 4095 3150 57% - 0 -

Output from Top:
Cpu states:
LOAD USER NICE SYS IDLE BLOCK SWAIT INTR SSYS
0.40 18.9% 0.0% 4.2% 76.9% 0.0% 0.0% 0.0% 0.0%

Memory: 1470992K (749640K) real, 2008552K (982068K) virtual, 23920K free Page#
1/21

Is there another way that I can check the memory in use/free or do I need to change some kernel params after increasing the memory

Thanks,

Tim
12 REPLIES 12
Muthukumar_5
Honored Contributor

Re: Confused over memory

Use vmstat to get the memory free statistics. Or else go to sam as,

sam -> performance monitor -> system properties -> memory

check active and total memory usage statistics. Use Refresh button to update satistics.

PS: Top output is not correct always.

hth.
Easy to suggest when don't know about the problem!
Joseph Loo
Honored Contributor

Re: Confused over memory

hi,

use vmstat command to check the free memory:

# vmstat 2 15
15 2 seconds interval

under the free memory column, it is virtual memory, so multiply about 4k to get free memory.

regards.
what you do not see does not mean you should not believe
Tim O'Connell
Regular Advisor

Re: Confused over memory

Thanks for the replies. I'm still not sure if I have 4gb of memory available. Below are outputs from SAM & vmstat:
SAM:
Physical Memory: 4099.7 MB
Real Memory:
Active: 724184.3 KB
Total: 1500580.1 KB
Virtual Memory:
Active: 957716.9 KB
Total: 2083485.1 KB
Free Memory Pages: 13068 at 4 KB/page
Swap Space:
Avail: 4096 MB .
Used: 1953 MB


Output from vmstat:

procs memory page
faults cpu
r b w avm free re at pi po fr de sr in
sy cs us sy id
1 0 0 235827 16817 63 46 1 0 0 0 42 814
5237 1133 12 6 82

Free is showing as 16817

Thanks,

Tim
john korterman
Honored Contributor

Re: Confused over memory

Hi,

judging by this swapinfo line:

dev 4096 96 4000 2% 0 - 1 /dev/vg00/lvol2

"96%" means - in my opinion - that you have at a certain time since last boot used 96% of your swaparea.
However, the value is not immediately updated, but since memory was inserted last night, the last boot was probably not long ago.

But instead of looking at memory consumption it is - again my opinion - more interesting to watch the here-and-now situation, which you can do by executing vmstat and look for the value of the "po" column; if that amounts to more than 0, it means that the system is paging/swapping or whatever people prefer calling it, and it definitely means that the system has used its entire memory.

It is up to discussion which value for "po" would be acceptible; my opinion is that the best would be "0".

Since you have doubled your memory and - mu guess - still have memory/performance problems, you should investigate recent changes on your system.

regards,
John K.
it would be nice if you always got a second chance
Tim O'Connell
Regular Advisor

Re: Confused over memory

Thanks, John for the reply.

The reason I wan to determine what actual memory I have & what is free is that I come from a Unixware background & I can remember years ago fitting extra memory & thinking all was OK but the memory was not picked up until I added an extra entry to the /stand/boot file. I don't appear to have any performance issues with either server but I want to be clear what memory I have installed & how much we are currently using. From sysinfo & SAM I have 4GB installed but I can't figure out if that 4GB is available & how much is in use & how much is free.

Thanks,

Tim
john korterman
Honored Contributor

Re: Confused over memory

Hi,

please forget about the my comment about the swapinfo line in the post before, "96" is of course not 96%, only 96 mb, which is not a lot. However, as it is not "0" it still indicates that your system has swapped/paged since last boot.

After my previous posting I have noticed your vmstat posting, where the values for "po" seems to be "0", which looks good. Does it change when doing e.g.:
# vmstat 2 20


regards,
John K.
it would be nice if you always got a second chance
Tim O'Connell
Regular Advisor

Re: Confused over memory

John,

PO stays at 0

Rgds,

Tim
Tim O'Connell
Regular Advisor

Re: Confused over memory

Using the following script I have determined that I have 4GB memory installed but the free memory is only 80mb. Something has chewed up the extra 2GB of memory. Anyone help me in identifying where the memory has gone?.

Script:

FREE=$(vmstat 2 1 |awk '{print $5}'|tail -1)
TOTMEM=$(echo "phys_mem_pages/D" |adb -k /stand/vmunix /dev/mem|tail -1|awk '{FS
=":";print $2}')
(( PERCENT = $FREE * 100 / $TOTMEM ))
echo "TOTAL MEMORY $TOTMEM Free MEMORY $FREE"
echo "Free memory is $PERCENT %"

Output (multiply result * 4)

# ksh ky_check_mem
TOTAL MEMORY 1048576 Free MEMORY 19671
Free memory is 1 %
Alex Glennie
Honored Contributor
Solution

Re: Confused over memory

Please check your email's in tray. I've attached kmeminfo which may help here ...
Tim O'Connell
Regular Advisor

Re: Confused over memory

Thanks, Alex

kmeminfo has identified where my problem is - -how to resolve it is the next question. I rebooted our 2nd server(which is identical to the main one) & ran kmeminfo which shows 2GB of memory free which is what I would expect. I then ran kmeminfo on the live server & memory is similar in usage except for KERNEL usage. On the live server there is 658284 * 4 in use which is my extra 2GB + what it was using but on the 2nd server its only 143932 *4. The major differences are in Bufcache + Dynamic. Last night after the HP Engineer installed the memory ther was 2GB free (TOP) on the LIVE server. Can you help me further. Do I need to do some Kernel tuning?.

Thanks,

Tim
Patrick Wallek
Honored Contributor

Re: Confused over memory

What is max_dbc_pct set to on both machines? It is possible that one machine is still set to the (dumb) default of 50, while the other was tuned down to some more reasonable value.

If it is still the default, then change the value to something around 10 or 15 (15% of 4GB RAM = 600MB) which is more reasonable. 2GB (50% of 4GB) is overkill.
Tim O'Connell
Regular Advisor

Re: Confused over memory

Thanks, Patrick

That's the problem. The test server is set to 10 (dbc-max-pct) but the live one is set to 50. Will make the changes tonight. Thanks to everyone who contributed. Assigning points now & closing the thread.

Thanks a million,

Tim