Operating System - HP-UX
1836118 Members
2079 Online
110089 Solutions
New Discussion

Apache:: FATAL: erealloc(): Unable to allocate 1572864 bytes

 
Hemmetter
Esteemed Contributor

Apache:: FATAL: erealloc(): Unable to allocate 1572864 bytes

Hello Forum

I have installed:
$ swlist | grep -i -E "apach|sql"
hpuxwsApache A.2.0.54.02 HP-UX Apache-based Web Server
mysql 4.0.15a mysql
an upon this
Mediawiki 1.5.2

My System is a B2000/400MHz/2Gbyte with HP-UX 11.00

Now my Problem is when working with my wiki i sometimes can't update a page and apache/logs/error_log shows:

FATAL: erealloc(): Unable to allocate 98304 bytes

with different Byte counts.

What setting do i have to adjust?
10 REPLIES 10
RAC_1
Honored Contributor

Re: Apache:: FATAL: erealloc(): Unable to allocate 1572864 bytes

Any other message text other than what you
posted??

Any error messages/warnings etc in syslog.log?? in dmesg??

Any bottlenecks on systems??-memory, swapspace, network, cpu or disk??
glance -m
glance -i
glance -l
glance -w
swapinfo -mat
There is no substitute to HARDWORK
Joseph Loo
Honored Contributor

Re: Apache:: FATAL: erealloc(): Unable to allocate 1572864 bytes

hi,

just curious, can u reply on:

# ulimit -a

regards.
what you do not see does not mean you should not believe
Hemmetter
Esteemed Contributor

Re: Apache:: FATAL: erealloc(): Unable to allocate 1572864 bytes

$ swapinfo -mat
Mb Mb Mb PCT START/ Mb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 512 0 512 0% 0 - 1 /dev/vg00/lvol2
dev 2048 0 2048 0% 0 - 0 /dev/vg00/lvol12
reserve - 197 -197
memory 1560 348 1212 22%
total 4120 545 3575 13% - 0 -

$ id www
uid=30(www) gid=1(other)

$ ulimit -a
time(seconds) unlimited
file(blocks) unlimited
data(kbytes) 131072
stack(kbytes) 8192
memory(kbytes) unlimited
coredump(blocks) 4194303
nofiles(descriptors) 60
Muthukumar_5
Honored Contributor

Re: Apache:: FATAL: erealloc(): Unable to allocate 1572864 bytes

Post informations for,

1) Memory usage = vmstat
2) Is there any relavent error in syslog.log file?
3) Post kernel parameter informations of,
kmtune -q maxssiz
kmtune -q maxdsiz
kmtune -q maxtsiz

hth.
Easy to suggest when don't know about the problem!
Hemmetter
Esteemed Contributor

Re: Apache:: FATAL: erealloc(): Unable to allocate 1572864 bytes

Hi hth

The machine is mostly idle, because it is my personal play area.

$ vmstat 5 5
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 3867 325502 6 1 0 0 1 0 0 137 317 51 0 0 99
0 0 0 2820 325446 0 0 0 0 0 0 0 142 143 39 0 0 100
0 0 0 5768 325446 0 0 0 0 0 0 0 134 119 27 0 0 100
0 0 0 3354 325446 0 0 0 0 0 0 0 137 237 69 0 0 100
0 0 0 3354 325446 0 0 0 0 0 0 0 136 130 38 0 0 100


syslog shows nothing abnormal.

$ kmtune -q maxssiz
Parameter Value
==================================
maxssiz 0x00800000

$ kmtune -q maxdsiz
Parameter Value
==================================
maxdsiz 0X08000000

$ kmtune -q maxtsiz
Parameter Value
==================================
maxtsiz 0x04000000


regards
hgh
Hemmetter
Esteemed Contributor

Re: Apache:: FATAL: erealloc(): Unable to allocate 1572864 bytes

Hi again

I reproduced the error while running vmstat:

This is while ia successful action:
$ vmstat 1 200
<...>
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 3622 316782 27 5 0 0 5 0 0 167 1065 127 0 0 100
0 0 0 3622 316782 21 4 0 0 4 0 0 162 888 109 5 1 94 <<<<<
0 0 0 3622 314943 17 3 0 0 3 0 0 154 938 96 89 11 0 <<<<<
0 0 0 3622 313160 14 2 0 0 2 0 0 146 1273 123 87 2 11 <<<<<
1 0 0 21126 311475 11 1 0 0 1 0 0 139 1392 157 92 8 0 <<<<<
1 0 0 21126 309921 9 0 0 0 0 0 0 132 1638 167 58 0 42 <<<<<
1 0 0 21126 309917 7 0 0 0 0 0 0 138 1333 142 0 0 100 <<<<<
1 0 0 21126 309917 5 0 0 0 0 0 0 145 1086 126 0 0 100
1 0 0 21126 309917 4 0 0 0 0 0 0 144 895 107 0 0 100
0 0 0 7058 309917 3 0 0 0 0 0 0 143 745 93 0 0 100
<...>

This is while a unsuccessful action:
$ vmstat 1 200
<...>
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 4375 306724 30 5 16 0 18 0 0 189 1157 127 0 0 100
0 0 0 4375 306724 24 4 12 0 14 0 0 179 965 108 0 0 100
0 0 0 4375 306724 19 3 10 0 11 0 0 171 792 92 1 0 99
0 0 0 4176 306724 15 2 8 0 8 0 0 168 651 81 0 0 100
0 0 0 4176 306724 12 1 7 0 6 0 0 160 541 70 0 0 100
0 0 0 4176 306724 10 0 6 0 4 0 0 158 470 64 0 0 100
0 0 0 4176 306724 8 0 4 0 3 0 0 157 394 59 0 0 100
0 0 0 4176 306724 6 0 3 0 2 0 0 152 336 52 0 0 100
0 0 0 6979 306724 14 10 2 0 12 0 0 157 506 55 1 1 98 <<<<<
0 0 0 6979 306724 11 8 1 0 9 0 0 153 444 49 0 0 100 <<<<<
0 0 0 6979 306724 9 6 1 0 7 0 0 156 385 49 0 1 99 <<<<<
0 0 0 6979 306632 8 4 0 0 5 0 0 151 339 47 13 1 86 <<<<<
0 0 0 6979 336349 6 3 0 0 4 0 0 137 639 59 55 24 21 <<<<<
0 0 0 3104 336357 5 2 0 0 3 0 0 138 826 134 1 0 99 <<<<<
0 0 0 3104 336357 4 1 0 0 2 0 0 149 702 123 0 0 100
<...>


rgds
hgh
rick jones
Honored Contributor

Re: Apache:: FATAL: erealloc(): Unable to allocate 1572864 bytes

When you get that failure, do you keep getting the failure, when you retry, or is it intermittent?

When ithappens, what is the process size for your apache process(s) and how does it relate to the values you get from ulimit?

Is there a chance that the application code is attempting to realloc something that is no longer allocated?
there is no rest for the wicked yet the virtuous have no pillows
Hemmetter
Esteemed Contributor

Re: Apache:: FATAL: erealloc(): Unable to allocate 1572864 bytes

Hi Rick,

i was observing that my httpd processes where growing with each access.

The highest SIZE i've seen in top before process termination was:
TTY PID USERNAME PRI NI SIZE RES STATE TIME %WCPU %CPU COMMAND
? 26435 www 152 20 154M 125M run 0:38 8.33 8.31 httpd

Now it seems to me like a memory leak.



rick jones
Honored Contributor

Re: Apache:: FATAL: erealloc(): Unable to allocate 1572864 bytes

You could try upping maxdsize but if there is indeed a leak, all that would do is postpone the inevitable.

At some point I think I saw Apache had a kludge for this sort of problem - a setting that would cause the given apache process to terminate after servicing N requests - ostensibly the main process would fork a replacement. A massive kludge to be certain.

Otherwise, linking against some form of malloc-debug library might be helpful. Not sure what is available on something as old as 11.0 though.
there is no rest for the wicked yet the virtuous have no pillows
Hemmetter
Esteemed Contributor

Re: Apache:: FATAL: erealloc(): Unable to allocate 1572864 bytes

Since it seems to be a memeory leak, now i use that MaxRequestsPerChild - Parameter to prevent httpd processes to grow over-the-top.

rgds
HGH