microsoft / microsoft/mimalloc

How mimalloc behave when allocating a really large memory block?

オープン
#413 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
C
スター
13.4k
フォーク
1.2k
平均マージ
4日 45分
マージ済み PR(30日)
13

説明

I am now working with some database projects. I found that in the case of Clickhouse, instead of trusting the allocator, they do mmap/mremap on their own if they want to allocate a really large block of memory (bigger than 64MB, and can expand to several GiBs).

While I do not quite understand why this is needed (AFAIK, 64MiB is still a valid size class for snmalloc and mimalloc), I do observe that doing so will actually reduce the performance of large hashtables (tons of syscalls during rehashing). So I begin to wonder why mmap/mremap are favored by them? and how do modern allocators like mimalloc handle large allocation in the user space?

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

リポジトリのファイル、テスト、エントリポイントは指定されていません。まず、64MBを超えるアロケーションの mimalloc における処理を追跡し、ClickHouse の mmap/mremap アプローチと比較してください。戦略が異なる理由と、大規模なアロケーションがどのように動作するかを文書化できれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
c
領域
operating-systems, performance
issue の種類
ドキュメント
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。