MariaDB on Windows Server 2012 R2 – out of memory

Posted on

Question :

I have two servers, one with Windows Small Business Server 2008 and the other runs Windows Server 2012 R2. The servers have running multi-master replication. Both use MariaDB 10.2.6. In the old 2008, everything works fine, even that the database is 32-bits. But in 2012 I get frequently “Out of memory”, the database uses only ~450MB and the system has 6GB free memory when the error shows up. Here are my complete my.ini, I tried already everything:

# password       = your_password 
port            = 3306 
socket          = "D:/OCS/MariaDB/mysql.sock"
plugin-dir      = D:/OCS/MariaDB/lib/plugin

# Here follows entries for some specific programs 

# The MySQL server

performance_schema = off
default-storage-engine = myisam
query_cache_type = 1
query_cache_limit = 10M
query_cache_size = 128M
port= 3306
socket = "D:/OCS/MariaDB/mysql.sock"
basedir = "D:/OCS/MariaDB" 
tmpdir = "D:/OCS/MariaDB/tmp" 
datadir = "D:/OCS/MariaDB/data"
pid_file = ""
# enable-named-pipe
key_buffer = 16M
max_allowed_packet = 1M
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M
log_error = "mysql_error.log"
event_scheduler = ON
auto-increment-increment = 2
auto-increment-offset = 2
# Change here for bind listening
# bind-address="" 
# bind-address = ::1          # for ipv6

# Where do all the plugins live
plugin_dir = "D:/OCS/MariaDB/lib/plugin/" 

innodb_data_home_dir = "D:/OCS/MariaDB/data"
innodb_data_file_path = ibdata1:10M:autoextend
innodb_log_group_home_dir = "D:/OCS/MariaDB/data"
#innodb_log_arch_dir = "D:/OCS/MariaDB/data"
## You can set .._buffer_pool_size up to 50 - 80 %
## of RAM but beware of setting memory usage too high
innodb_buffer_pool_size = 16M
#innodb_additional_mem_pool_size = 2M
## Set .._log_file_size to 25 % of buffer pool size
innodb_log_file_size = 5M
innodb_log_buffer_size = 8M
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 50

## UTF 8 Settings
#init-connect='SET NAMES utf8'

max_allowed_packet = 16M

max_execution_time = 5000
# Remove the next comment character if you are not familiar with SQL

key_buffer = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M

key_buffer = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M


I am running out of ideas why this happens. I have tested if the system has some limitations but a small python program allocates over 2GB of RAM with no problems. Both servers are running the same config – in 2008 the memory usage goes up to 1.5GB with no problems.

Answer :

The 32bit is the culprit. Due to a strange rounding up when calculating buffers, the server would allocate almost twice as much memory (3GB instead of 1.5GB), leaving only 1GB address space for anything else .It is fixed in 10.2.7 and later, the bug report is here

Leave a Reply

Your email address will not be published. Required fields are marked *