FATAL: erealloc(): Unable to allocate 577925121 bytes

Brian Candler B.Candler at pobox.com
Tue Sep 27 05:42:42 PDT 2005


> as far as i can see i am not doing anything wrong, then why cant i  
> download a 551 MB file

You're probably hitting the default 512MB maximum process data segment limit
somewhere, I guess on the client end as I would expect Apache to use
sendfile() to transmit a large file. Try typing:

$ ulimit -a
core file size        (blocks, -c) unlimited
data seg size         (kbytes, -d) 524288          << THIS LIMIT
file size             (blocks, -f) unlimited
max locked memory     (kbytes, -l) unlimited
max memory size       (kbytes, -m) unlimited
open files                    (-n) 11095
pipe size          (512 bytes, -p) 1
stack size            (kbytes, -s) 65536
cpu time             (seconds, -t) unlimited
max user processes            (-u) 5547
virtual memory        (kbytes, -v) unlimited

Now, I can never remember how to increase this, and I always have to rummage
around the kernel source code. Ah yes, it's

options     MAXDSIZ=(1024UL*1024*1024)

in the kernel configuration. See /usr/src/sys/conf/NOTES

However, it seems to me that's the wrong thing to do here. If an application
needs to download 1G of data, then it really should download it and spool it
to disk as it goes, not spool it all into RAM and then finally write it to
disk (or worse, spool it into RAM, which gets spooled to swap space on disk,
which then later gets pulled back into RAM and then finally written to the
filesystem). At least, that's a very poor utilisation of system resources.

Regards,

Brian.


More information about the freebsd-isp mailing list