1833949 Members
1678 Online
110063 Solutions
New Discussion

out of memory

 
SOLVED
Go to solution

out of memory

Hello,

I receive the following error when trying to run a software on HP-UX v11:
Out of memory during request for 7992 bytes, total sbrk() is 65508528 bytes!

What is this error about and how this can be fixed?

Thank you.
13 REPLIES 13
Donald Kok
Respected Contributor

Re: out of memory

Hi,
obviously the memory of the system is all being used. you can:
- use top, to see which processes use the memory
- stop processes (kill PID)
- add swapspace to inrease memory
- add real memory
HTH
Donald
My systems are 100% Murphy Compliant. Guaranteed!!!
Geoff Wild
Honored Contributor

Re: out of memory

Depending on the availabe ram:

# cat /usr/local/bin/hpmem
#!/bin/ksh
#
# Taken from the HP/UniGraphics FAQ
# You must be ROOT to execute this since it uses adb to
# examine the running kernel
#
GetKernelSymbol()
{
echo "$1/D" | \
adb $hpux /dev/kmem | \
tr "\012" " " | \
read junk junk2 kval
}
hpux=/hp-ux
rev=$(uname -r | cut -d. -f2)
if ((rev > 9)); then hpux=/stand/vmunix ;fi
/bin/uname -a
# if 11iv2 or higher - get cpu this way
ver=$(uname -r | cut -d. -f3)
if ((ver > 22)); then
kval=`echo "processor_count/D" | adb /stand/vmunix /dev/kmem |tail -1|awk -F: '{print $2}' `
else
GetKernelSymbol "processor_count"
fi
print CPU Count: $kval
GetKernelSymbol "itick_per_tick"
let speed=kval/10000
print CPU Speed: $speed MHz
if ((rev > 10)); then
print CPU HW Support: `getconf HW_CPU_SUPP_BITS`-bit
print Kernel Support: `getconf KERNEL_BITS`-bit
GetKernelSymbol "memory_installed_in_machine"
else
GetKernelSymbol "physmem"
fi
# if 11iv2 or higher - get memory this way
ver=$(uname -r | cut -d. -f3)
if ((ver > 22)); then
kernel=$(/usr/sbin/kcpath -x)
hexval=$(echo "phys_mem_pages/A" | adb $kernel /dev/kmem|tail +2|awk '{print $2}')
REAL_MEM=$(echo ${hexval}=D|adb)
mb=$(expr ${REAL_MEM} / 256)
else
let mb=kval*4/1024 # convert pages to MB
fi
print RAM Size: $mb MB
GetKernelSymbol "bufpages"
let mb=kval*4/1024 # convert pages to MB
print bufpages: $mb MB
GetKernelSymbol "maxuprc"
print maxuprc: $kval
GetKernelSymbol "maxvgs"
print maxvgs: $kval
GetKernelSymbol "maxfiles"
print maxfiles: $kval
GetKernelSymbol "max_thread_proc"
print max_thread_proc: $kval
GetKernelSymbol "nfile"
print nfile: $kval
GetKernelSymbol "nproc"
print nproc: $kval
GetKernelSymbol "ninode"
print ninode: $kval
GetKernelSymbol "vfd_cw"
print shmmax: $kval
GetKernelSymbol "shmmni"
print shmmni: $kval
GetKernelSymbol "dbc_max_pct"
print dbc_max_pct: $kval


you could decrease dbc_max_pct

A good setting is so it works out to somewhere between 400 and 800 MB.

IE: if you have 8 GB - then set to 9 or 10
if 4 GB try 16
if 2 GB try 25

That will free up some ram (default is 50) - requires a reboot unless you have 11iv2 installed.

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Vibhor Kumar Agarwal
Esteemed Contributor

Re: out of memory

Further check whether there are some zombie processes or not.

You can find them out by greping "defunct"
In this case you will have to reboot.

Rest has been mentioned in the above post.
Vibhor Kumar Agarwal

Re: out of memory

Hello,

I executed the sctipt for hpmem that you've sent me. here is the answer:

# /usr/local/bin/hpmem
HP-UX pocko B.11.00 U 9000/800 1834910661 unlimited-user license
CPU Count: Elf file: No Elf header processor_count: processor_count: 1 Error from elf64_getehdr(application core file)
HP-UX pocko B.11.00 U 9000/800 1834910661 unlimited-user license
CPU Count: Elf file: No Elf header processor_count: processor_count: 1 Error from elf64_getehdr(application core file)
/usr/local/bin/hpmem[52]: Elf file: No Elf^Iheader itick_per_tick: itick_per_tick:^I6500000 Error from elf64_getehdr(application core file): Syntax error
CPU Speed: MHz
CPU HW Support: 64-bit
Kernel Support: 64-bit
/usr/local/bin/hpmem[69]: Elf file: No Elf^Iheader memory_installed_in_machine: memory_installed_in_machine:^I262144 Error from elf64_getehdr(application core file): Syntax error
RAM Size: MB
/usr/local/bin/hpmem[73]: Elf file: No Elf^Iheader bufpages: bufpages:^I26041 Error from elf64_getehdr(application core file): Syntax error
bufpages: MB
maxuprc: Elf file: No Elf header maxuprc: maxuprc: 256 Error from elf64_getehdr(application core file)
maxvgs: Elf file: No Elf header maxvgs: maxvgs: 10 Error from elf64_getehdr(application core file)
maxfiles: Elf file: No Elf header maxfiles: maxfiles: 2048 Error from elf64_getehdr(application core file)
max_thread_proc: Elf file: No Elf header max_thread_proc: max_thread_proc: 1024 Error from elf64_getehdr(application core file)
nfile: Elf file: No Elf header nfile: nfile: 8202 Error from elf64_getehdr(application core file)
nproc: Elf file: No Elf header nproc: nproc: 2068 Error from elf64_getehdr(application core file)
ninode: Elf file: No Elf header ninode: ninode: 2492 Error from elf64_getehdr(application core file)
shmmax: Elf file: No Elf header vfd_cw: vfd_cw: 1073741824 Error from elf64_getehdr(application core file)
shmmni: Elf file: No Elf header shmmni: shmmni: 500 Error from elf64_getehdr(application core file)
dbc_max_pct: Elf file: No Elf header dbc_max_pct: dbc_max_pct: 50 Error from elf64_getehdr(application core file)

this dbc_max_pct is 50. what value should it have?

Thanks.
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: out of memory

It almost certainly means that the kernel tunable maxdsiz is too small. It's probably set to 64MB.
If it ain't broke, I can fix that.
Geoff Wild
Honored Contributor

Re: out of memory

It looks like (I might be wrong) that you only have 256MB of ram? Is that correct?

Try

dmesg |grep Physical

It might show....

If so - you need more ram...

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.

Re: out of memory

Hello,

the value for the tunable kernel parametar maxdsiz is 64MB, that's correct. Do you know if changed this parametar will solve the problem? What should the value be?

Mel Burslan
Honored Contributor

Re: out of memory

as you have not mentioned any system hardware model and how much physical memory you have, I can only give you an example

for an rp3440 (L2000 similar) w/ 2GB physucal memory

maxdsiz 4294963200 - 4294963200
maxdsiz_64bit 17179869184 - 17179869184


unless you have much lesser system, your maxdsize at 64M is very low. maxdsiz parameter is very dependent on the amount of physical memory you have, hence a blind suggestion is not going to help you.

your dbc_max_pct kernel parameter at 50 is very high. Usually, this needs to be set somewhere between 5 and 10. Again, this percentage of your total physical memory should not exceed 700MB (more than that is wasting memory in very large memory carrying systems) and this percentage set to 10 is more than enough for all intents and puroposes, hence do not set it any higher. I still do not understand why HP is setting this value to 50 by default at the OS install time.

if you can post the output of these commands for it will help the people of ITRC forms to understand your situation and help you better (last command shows the amount of physical memory you have on your system):

vmstat

swapinfo

echo phys_mem_pages/D | adb -k /stand/vmunix /dev/mem | awk \
'{print 4096*$2}'

________________________________
UNIX because I majored in cryptology...

Re: out of memory

Hello,

the system we are talking about is hp rp2470 server, with 2 x 650MHz PA8700 CPUs and 2 x 1024MB of RAM.
the swapinfo output from the system:

# swapinfo
Kb Kb Kb PCT START/ Kb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 4194304 0 4194304 0% 0 - 1 /dev/vg00/lvol2
reserve - 482728 -482728

the other requested outputs, I will send them as soon as i have them.

can you please now tell me what should the values vo maxdsize kernel parametar be?

Re: out of memory

Hello,

here is further info from the system you have requested:

# vmstat
procs memory page
faults cpu
r b w avm free re at pi po fr de sr in
sy cs us sy id
0 0 0 25076 240349 8 0 0 0 0 0 0 469
14211 82 2 1 97


# echo phys_mem_pages/D | adb -k /stand/vmunix /dev/mem | awk \ '{print 4096*$>
0
2.14748e+09


Mel Burslan
Honored Contributor

Re: out of memory

Your system is very similar to mine with the exception of hardware model. I think you can try these values:

maxdsiz : 1073741824
maxdsiz_64bit : 17179869184

hope this helps
________________________________
UNIX because I majored in cryptology...
Scott Lindstrom_2
Regular Advisor

Re: out of memory

When running this section of Geoff's code on 11.23:

# if 11iv2 or higher - get memory this way
ver=$(uname -r | cut -d. -f3)
if ((ver > 22)); then
kernel=$(/usr/sbin/kcpath -x)
hexval=$(echo "phys_mem_pages/A" | adb $kernel /dev/kmem|tail +2|awk '{print $2}')
REAL_MEM=$(echo ${hexval}=D|adb)
mb=$(expr ${REAL_MEM} / 256)
else
let mb=kval*4/1024 # convert pages to MB
fi

Specifically this line:
hexval=$(echo "phys_mem_pages/A" | adb $kernel /dev/kmem|tail +2|awk '{print $2}')

I get this error message:
adb: warning: Unrecognized format character - 'A'.

Any ideas?

Scott
Tim Nelson
Honored Contributor

Re: out of memory

bump maxdsiz and maxtsiz up to 1GB.
64MB for data or text images will not get you far.

reduce dbc_max_pct to 5 or 10 as mentioned.
If running a database 5 or less is better.

might as well look at shmmax and set to 1GB as well