Operating System - HP-UX
1753456 Members
5487 Online
108794 Solutions
New Discussion юеВ

"Not enough memory" errors

 
SOLVED
Go to solution
Brian Bientz
Advisor

"Not enough memory" errors

We have an N-Class HP with 2 GB of memory. In an attempt to support a large concurrent user base using Oracle's MTS, we have an SGA of about 1.25 GB.

Just recently, we have begun to have problems with our nightly database backup (disk to disk hot backup). Part way through we begin seeing memory errors. Oracle reports ORA-04030 - out of process momory when trying to allocate x bytes. In addition, I was getting errors while logged into the HP system doing simple commands like ls (sh: fork function failed. There is not enough memory.).

However, all the while my top command is showing anywhere from 20 - 50 MB free. Any ideas?

Is there kernal parameters that need to be adjusted or do we just need more physical memory?
11 REPLIES 11
CHRIS ANORUO
Honored Contributor
Solution

Re: "Not enough memory" errors

Hi Brian,

Check your kernel shared memory parameters, I have attached my sample kernel configuration file. I hope your swap space is up to 2Gb.
Check also Documentations on "Using Memory Windows with 11.0". Document Id KBAN00000306
And "Understanding Shared Memory on PA-RISC Systems"
Document Id RCMEMKBAN00000027

When We Seek To Discover The Best In Others, We Somehow Bring Out The Best In Ourselves.
Carlos Fernandez Riera
Honored Contributor

Re: "Not enough memory" errors

is your swap configured correctly?

See:
http://forums.itrc.hp.com/cm/QuestionAnswer/1,1150,0x9fa20cb17a32d5118fef0090279cd0f9,00.html

max_dsize parameter in kernel must be configured too.
unsupported
Brian Bientz
Advisor

Re: "Not enough memory" errors

Do I have to worry about memory windows with 64-bit HPUX and 64-bit Oracle? It was my understanding that I did not!
Carlos Fernandez Riera
Honored Contributor

Re: "Not enough memory" errors

Step by step:

Please run swapinfo. Your swap sapce ( adding all swap spaces) must be at least the size of your memory. If this it not true you will not use all the memory.

By the messages you show it seems to be this kind of misconfiguration ( IMMO).

Regards.
unsupported
Brian Bientz
Advisor

Re: "Not enough memory" errors

Here is the result of swapinfo -tm

Mb Mb Mb PCT START/ Mb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 1024 0 1024 0% 0 - 1 /dev/vg00/lvol2
reserve - 869 -869
memory 1539 1539 0 100%
total 2563 2408 155 94% - 0 -

This machine is supposed to have 2GB of physical memory. Do we need to configure 4GB of swap?
Thierry Poels_1
Honored Contributor

Re: "Not enough memory" errors

Hi Brian,
"theoretically" your swap needs to be the double of your physical memory.
I can give you on a platter that your optimal setting will be somewhere between 2 and 5 GB ;)
good luck,
Thierry.
All unix flavours are exactly the same . . . . . . . . . . for end users anyway.
Servio Cabrera
Advisor

Re: "Not enough memory" errors

And if you can have 4-5GB for swap, turn off the swapmem_on kernel parameter, it will help you for performance as well.
Mladen Despic
Honored Contributor

Re: "Not enough memory" errors

Brian,

The "memory" line in your "swapinfo -tm" output indicates that your pseudo-swap reservations are
at the maximum. I think this is why you are getting the
memory errors.

If you add another gigabyte of device swap and then
reboot your system, your problem should be solved.

You could also add more device swap and turn off
the pseudo-swap (set swapmem_on=0). This is
recommended for performance reasons, particularly
if your applications use a lot of locked memory
(e.g., a database server). In any case, if you have
enough disk, I would recommend at least 3Gb of
swap space for your system.

Choose a different disk, if possible, for each additional 1-gig swap device that you create. For example, if /dev/dsk/c0t1d0 and /dev/dsk/c1t1d0 are two disks in vg01 that can be used, then do something like:

lvcreate -n swaplv1 -C y -r n vg01
lvcreate -n swaplv2 -C y -r n vg01

and then

lvextend -L 1000 /dev/vg01/swaplv1 /dev/dsk/c0t1d0
lvextend -L 1000 /dev/vg01/swaplv2 /dev/dsk/c1t1d0

Since the priority of your primary swap is at the default value 1, you can then append the following lines to /etc/fstab :

/dev/vg01/swaplv1 . swap defaults 0 0
/dev/vg01/swaplv2 . swap defaults 0 0

Set swapmem_on=0 in SAM (if you choose to do so) and then reboot.

HTH

Mladen




Satar Naghshineh
Occasional Advisor

Re: "Not enough memory" errors

Hi Brian,

Although the users provided excellent feedback as to how to correct this problem, you still have a tuning issue.

1. determine what your hit ratio is, and see if you can lower your SGA. Sometimes a smaller SGA in a huge environment is more beneficial than a large one. Don't forget about the DB Buffers!

2. Keep in mind the UGA and PGA with memory management.

3. Avoid paging and swapping at all cost.

Regards,
Satar Naghshineh
Oracle DBA/UNIX sys admin
"Comments are of my own and do not reflect my employer"