Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 25 Jan 2004 21:13:31 +0100
From:      "Christian B." <>
To:        <>
Subject:   FreeBSD 5.2: malloc(): error: allocation failed

Next in thread | Raw E-Mail | Index | Archive | Help

First, I have FreeBSD 5.1 installed on my dual-Xeon machine with 2GB RAM.
Now, I delete the disk and installed FreeBSD 5.2 with the same ports and

For the MySQL 4.0.17, I use following configuration (the same as under
FreeBSD 5.1):
key_buffer = 256M
max_allowed_packet = 1M
table_cache = 256
sort_buffer_size = 1M
read_buffer_size = 1M
myisam_sort_buffer_size = 64M
thread_cache = 8
query_cache_size= 16M
thread_concurrency = 4
max_connections = 2000

But after I start the mysql-server, I get following error:
mysqld in malloc(): error: allocation failed
mysqld got signal 6;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help
the problem, but since we have already crashed, something is definitely
and this may fail.

It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_connections =
bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

If I reduce the key_buffer to 128M, mysql starts normal.

So, I installed the Port "Memtest". But if I run it with more than 511MB
("memtest 512M 1"), I get the following error:
Current limits:
  RLIMIT_RSS  0xffffffff
  RLIMIT_VMEM 0xffffffff
Raising limits...
memtest in malloc(): error: allocation failed
Abort (core dumped)

The output from top:
61 processes:  3 running, 48 sleeping, 10 waiting
Mem: 76M Active, 12M Inact, 47M Wired, 16K Cache, 21M Buf, 1872M Free
Swap: 5120M Total, 5120M Free

I read the whole documentation about FreeBSD 5.2-update, but I cannot find
any changes about the memory-functions.

Can anyone say me, why I have problems with memory-allocation?

Thanks for your help!

Best regards,

Want to link to this message? Use this URL: <!~!UENERkVCMDkAAQACAAAAAAAAAAAAAAAAABgAAAAAAAAAjsr3Y8m61BGK3QDgfQG1wCKBAAAQAAAAQw7wR/MadkyKklRl7q1e3gEAAAAA>