cancel
Showing results for 
Search instead for 
Did you mean: 

"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
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.

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"
Brian Bientz
Advisor

Re: "Not enough memory" errors

Could you elaborate? When would it be advantagous to decrease the size of the SGA and why?

What should I not forget about DB Block Buffers?
Satar Naghshineh
Occasional Advisor

Re: "Not enough memory" errors

Hi,

In regards to Database buffers, I meant that you should test the results of adding or decreasing the number of buffers. I believe the parameter was DB_BLOCK_LRU (I forget the utility/parameter needed to test DB Block Buffers).

In regards to having a large SGA, I asked the same question. Below is a partial response I received from Thomas Kyte (a top leader in the Oracle Database world):

I could speculate that the queries didn't ever re-use the data (the data was
never read twice, lots of reading going on but not lots of re-reading of data).
In this case, having lots of data in the cache and managing that would slow
things down (lots to manage and more to look through to discover that it isn't
already cached and you have to go to disk anyway).

I could speculate that the machine was swapping like crazy and need the ram
back.

Its not necessarily a good thing to cache entire databases. We are expecting,
and are optimized for, to have to go to disk sometimes. We have a feature
called the VLM (very large memory) for caching more (showing the the bigger the
cache, you need different algorithms to manage).

Regards,
Satar Naghshineh
"Comments are of my own and do not reflect my employer"