microsoft / microsoft/mimalloc

How mimalloc behave when allocating a really large memory block?

Offen
#413 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Vorherrschende Sprache
C
Sterne
13.4k
Forks
1.2k
Ø Merge
4 T. 45 Min.
Gemergte PRs (30 T.)
13

Beschreibung

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?

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Es wird keine Repository-Datei, kein Test und kein Einstiegspunkt genannt. Beginne damit, mimallocs Umgang mit Allokationen über 64MB nachzuverfolgen, und vergleiche ihn mit dem ClickHouse-Ansatz mit mmap/mremap; als erledigt gilt die Aufgabe, wenn dokumentiert ist, warum sich die Strategien unterscheiden und wie sich große Allokationen verhalten.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
c
Bereich
operating-systems, performance
Issue-Typ
Dokumentation
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.