microsoft / microsoft/mimalloc

Using synchronized_pool_resource with largest_required_pool_block > 1mb does not work

Open
#576 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
13.4k
Forks
1.2k
Avg merge
4d 45m
Merged PRs (30d)
13

Description

We are trying to use std::pmr:::synchronized_pool_resource with a pool block size of 16 * 1024 * 1024, but this will cause the pmr allocator to request an alignment of 4 * 1024 * 1024, resulting in an assert/error because MI_ALIGNMENT_MAX is 1024 * 1024.

mimalloc: error: aligned allocation has a maximum alignment of 1048576 (size 16777272, alignment 4194304)

Versions of mimalloc we tried: 1.6.7, 1.7.5, 2.0.3.

Is there any way to work around this without setting the largest_required_pool_block to 1024*1024? We would like pooling to work for bigger blocks than this.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with std::pmr::synchronized_pool_resource and largest_required_pool_block set to 16 * 1024 * 1024. Trace how the resulting 4 * 1024 * 1024 alignment reaches mimalloc, then verify that pooling works for blocks larger than 1 MiB without the reported alignment assertion, or document the supported limit and workaround.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.