Skip to content

Commit 4877659

Browse files
committed
MDEV-12097 : avoid too large memory allocation in innodb buffer pool
on Windows Align innodb_pool_size up to the innodb_buf_pool_chunk_unit.
1 parent bf262bd commit 4877659

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

storage/innobase/srv/srv0start.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1636,10 +1636,10 @@ innobase_start_or_create_for_mysql()
16361636
/* Do not allocate too large of a buffer pool on
16371637
Windows 32-bit systems, which can have trouble
16381638
allocating larger single contiguous memory blocks. */
1639+
srv_buf_pool_size = static_cast<ulint>(ut_uint64_align_up(srv_buf_pool_size, srv_buf_pool_chunk_unit));
16391640
srv_buf_pool_instances = ut_min(
16401641
static_cast<ulong>(MAX_BUFFER_POOLS),
1641-
static_cast<ulong>(srv_buf_pool_size
1642-
/ (128 * 1024 * 1024)));
1642+
static_cast<ulong>(srv_buf_pool_size / srv_buf_pool_chunk_unit));
16431643
#else /* defined(_WIN32) && !defined(_WIN64) */
16441644
/* Default to 8 instances when size > 1GB. */
16451645
srv_buf_pool_instances = 8;

0 commit comments

Comments
 (0)