{
  "type": "excalidraw",
  "version": 2,
  "source": "https://excalidraw.com",
  "elements": [
    {
      "type": "text",
      "version": 1,
      "id": "title",
      "x": 200,
      "y": 16,
      "width": 500,
      "height": 24,
      "angle": 0,
      "strokeColor": "#1a1a1a",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "strokeStyle": "solid",
      "roughness": 1,
      "opacity": 100,
      "groupIds": [],
      "fontSize": 20,
      "fontFamily": 1,
      "text": "The C++ allocator stack — where the cost actually lives",
      "textAlign": "center",
      "verticalAlign": "middle"
    },
    {
      "type": "rectangle",
      "version": 1,
      "id": "app",
      "x": 200,
      "y": 60,
      "width": 500,
      "height": 44,
      "angle": 0,
      "strokeColor": "#4a73b8",
      "backgroundColor": "#e8f0fb",
      "fillStyle": "solid",
      "strokeWidth": 1.5,
      "strokeStyle": "solid",
      "roughness": 1,
      "opacity": 100,
      "groupIds": [],
      "roundness": { "type": 3 }
    },
    {
      "type": "text",
      "version": 1,
      "id": "app-label",
      "x": 220,
      "y": 70,
      "width": 460,
      "height": 28,
      "angle": 0,
      "strokeColor": "#1a1a1a",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "strokeStyle": "solid",
      "roughness": 1,
      "opacity": 100,
      "groupIds": [],
      "fontSize": 13,
      "fontFamily": 1,
      "text": "C++ application\nstd::vector<T> v; v.push_back(...); pmr::vector<T> vp{&arena};",
      "textAlign": "center",
      "verticalAlign": "middle"
    },
    {
      "type": "rectangle",
      "version": 1,
      "id": "pmr",
      "x": 200,
      "y": 124,
      "width": 500,
      "height": 60,
      "angle": 0,
      "strokeColor": "#5a8870",
      "backgroundColor": "#d8e8df",
      "fillStyle": "solid",
      "strokeWidth": 1.5,
      "strokeStyle": "solid",
      "roughness": 1,
      "opacity": 100,
      "groupIds": [],
      "roundness": { "type": 3 }
    },
    {
      "type": "text",
      "version": 1,
      "id": "pmr-label",
      "x": 220,
      "y": 134,
      "width": 460,
      "height": 44,
      "angle": 0,
      "strokeColor": "#1a1a1a",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "strokeStyle": "solid",
      "roughness": 1,
      "opacity": 100,
      "groupIds": [],
      "fontSize": 12,
      "fontFamily": 1,
      "text": "std::pmr resource (often request-scoped)\nmonotonic_buffer_resource → bump-allocate from a hot arena\nunsynchronized_pool_resource → fixed-size object pools",
      "textAlign": "center",
      "verticalAlign": "middle"
    },
    {
      "type": "rectangle",
      "version": 1,
      "id": "alloc",
      "x": 200,
      "y": 204,
      "width": 500,
      "height": 60,
      "angle": 0,
      "strokeColor": "#b89540",
      "backgroundColor": "#f0e8d8",
      "fillStyle": "solid",
      "strokeWidth": 1.5,
      "strokeStyle": "solid",
      "roughness": 1,
      "opacity": 100,
      "groupIds": [],
      "roundness": { "type": 3 }
    },
    {
      "type": "text",
      "version": 1,
      "id": "alloc-label",
      "x": 220,
      "y": 214,
      "width": 460,
      "height": 44,
      "angle": 0,
      "strokeColor": "#1a1a1a",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "strokeStyle": "solid",
      "roughness": 1,
      "opacity": 100,
      "groupIds": [],
      "fontSize": 12,
      "fontFamily": 1,
      "text": "allocator (LD_PRELOAD or default)\nglibc malloc / jemalloc / mimalloc / tcmalloc\n'returns to OS quickly?' is the column that matters in a container",
      "textAlign": "center",
      "verticalAlign": "middle"
    },
    {
      "type": "rectangle",
      "version": 1,
      "id": "page",
      "x": 200,
      "y": 294,
      "width": 500,
      "height": 60,
      "angle": 0,
      "strokeColor": "#b86742",
      "backgroundColor": "#ecdfd8",
      "fillStyle": "solid",
      "strokeWidth": 1.5,
      "strokeStyle": "solid",
      "roughness": 1,
      "opacity": 100,
      "groupIds": [],
      "roundness": { "type": 3 }
    },
    {
      "type": "text",
      "version": 1,
      "id": "page-label",
      "x": 220,
      "y": 304,
      "width": 460,
      "height": 44,
      "angle": 0,
      "strokeColor": "#1a1a1a",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "strokeStyle": "solid",
      "roughness": 1,
      "opacity": 100,
      "groupIds": [],
      "fontSize": 12,
      "fontFamily": 1,
      "text": "kernel page cache + page table\nfirst write to a page: minor or major fault → page table update\nthis is the latency event, not malloc() returning a pointer",
      "textAlign": "center",
      "verticalAlign": "middle"
    },
    {
      "type": "rectangle",
      "version": 1,
      "id": "cgroup-high",
      "x": 200,
      "y": 374,
      "width": 500,
      "height": 40,
      "angle": 0,
      "strokeColor": "#d68a1e",
      "backgroundColor": "#fbe6c2",
      "fillStyle": "solid",
      "strokeWidth": 1.5,
      "strokeStyle": "solid",
      "roughness": 1,
      "opacity": 100,
      "groupIds": [],
      "roundness": { "type": 3 }
    },
    {
      "type": "text",
      "version": 1,
      "id": "cgroup-high-label",
      "x": 220,
      "y": 384,
      "width": 460,
      "height": 24,
      "angle": 0,
      "strokeColor": "#1a1a1a",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "strokeStyle": "solid",
      "roughness": 1,
      "opacity": 100,
      "groupIds": [],
      "fontSize": 12,
      "fontFamily": 1,
      "text": "cgroup memory.high (throttle)  →  kernel reclaims; process keeps running, tail degrades",
      "textAlign": "center",
      "verticalAlign": "middle"
    },
    {
      "type": "rectangle",
      "version": 1,
      "id": "cgroup-max",
      "x": 200,
      "y": 434,
      "width": 500,
      "height": 40,
      "angle": 0,
      "strokeColor": "#b8721a",
      "backgroundColor": "#f5e2ce",
      "fillStyle": "solid",
      "strokeWidth": 1.5,
      "strokeStyle": "solid",
      "roughness": 1,
      "opacity": 100,
      "groupIds": [],
      "roundness": { "type": 3 }
    },
    {
      "type": "text",
      "version": 1,
      "id": "cgroup-max-label",
      "x": 220,
      "y": 444,
      "width": 460,
      "height": 24,
      "angle": 0,
      "strokeColor": "#1a1a1a",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "strokeStyle": "solid",
      "roughness": 1,
      "opacity": 100,
      "groupIds": [],
      "fontSize": 12,
      "fontFamily": 1,
      "text": "cgroup memory.max (ceiling)  →  OOM killer fires on memory.current, not RSS",
      "textAlign": "center",
      "verticalAlign": "middle"
    },
    {
      "type": "rectangle",
      "version": 1,
      "id": "host",
      "x": 200,
      "y": 494,
      "width": 500,
      "height": 34,
      "angle": 0,
      "strokeColor": "#7a6f55",
      "backgroundColor": "#e8e1d3",
      "fillStyle": "solid",
      "strokeWidth": 1.5,
      "strokeStyle": "solid",
      "roughness": 1,
      "opacity": 100,
      "groupIds": [],
      "roundness": { "type": 3 }
    },
    {
      "type": "text",
      "version": 1,
      "id": "host-label",
      "x": 380,
      "y": 504,
      "width": 140,
      "height": 18,
      "angle": 0,
      "strokeColor": "#1a1a1a",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "strokeStyle": "solid",
      "roughness": 1,
      "opacity": 100,
      "groupIds": [],
      "fontSize": 14,
      "fontFamily": 1,
      "text": "host kernel + RAM",
      "textAlign": "center",
      "verticalAlign": "middle"
    },
    {
      "type": "rectangle",
      "version": 1,
      "id": "result",
      "x": 720,
      "y": 124,
      "width": 160,
      "height": 200,
      "angle": 0,
      "strokeColor": "#c0392b",
      "backgroundColor": "#fdfbf7",
      "fillStyle": "solid",
      "strokeWidth": 1.5,
      "strokeStyle": "solid",
      "roughness": 1,
      "opacity": 100,
      "groupIds": [],
      "roundness": { "type": 3 }
    },
    {
      "type": "text",
      "version": 1,
      "id": "result-label",
      "x": 730,
      "y": 134,
      "width": 140,
      "height": 180,
      "angle": 0,
      "strokeColor": "#1a1a1a",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "strokeStyle": "solid",
      "roughness": 1,
      "opacity": 100,
      "groupIds": [],
      "fontSize": 11,
      "fontFamily": 1,
      "text": "PMR result (r96)\nbatch, 200 iters/req\n\nstd::allocator:\n  p50  8.66 µs\n  p99 15.29 µs\n\nstd::pmr:\n  p50  4.08 µs\n  p99  5.61 µs\n  2.12× faster\n\n(serve mode: no\nwin — see §7)",
      "textAlign": "left",
      "verticalAlign": "top"
    },
    {
      "type": "arrow",
      "version": 1,
      "id": "arrow-app-pmr",
      "x": 450,
      "y": 104,
      "width": 0,
      "height": 20,
      "angle": 0,
      "strokeColor": "#2d2d2d",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 1.4,
      "strokeStyle": "solid",
      "roughness": 1,
      "opacity": 100,
      "groupIds": [],
      "points": [ [0, 0], [0, 20] ],
      "endArrowhead": "arrow"
    },
    {
      "type": "arrow",
      "version": 1,
      "id": "arrow-pmr-alloc",
      "x": 450,
      "y": 184,
      "width": 0,
      "height": 20,
      "angle": 0,
      "strokeColor": "#2d2d2d",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 1.4,
      "strokeStyle": "solid",
      "roughness": 1,
      "opacity": 100,
      "groupIds": [],
      "points": [ [0, 0], [0, 20] ],
      "endArrowhead": "arrow"
    },
    {
      "type": "arrow",
      "version": 1,
      "id": "arrow-alloc-page-RED",
      "x": 450,
      "y": 264,
      "width": 0,
      "height": 30,
      "angle": 0,
      "strokeColor": "#c0392b",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 2.5,
      "strokeStyle": "solid",
      "roughness": 1,
      "opacity": 100,
      "groupIds": [],
      "points": [ [0, 0], [0, 30] ],
      "endArrowhead": "arrow"
    },
    {
      "type": "text",
      "version": 1,
      "id": "page-fault-label",
      "x": 465,
      "y": 274,
      "width": 200,
      "height": 16,
      "angle": 0,
      "strokeColor": "#c0392b",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "strokeStyle": "solid",
      "roughness": 1,
      "opacity": 100,
      "groupIds": [],
      "fontSize": 12,
      "fontFamily": 1,
      "text": "page fault on first write",
      "textAlign": "left",
      "verticalAlign": "middle"
    },
    {
      "type": "arrow",
      "version": 1,
      "id": "arrow-page-cgrp",
      "x": 450,
      "y": 354,
      "width": 0,
      "height": 20,
      "angle": 0,
      "strokeColor": "#2d2d2d",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 1.4,
      "strokeStyle": "solid",
      "roughness": 1,
      "opacity": 100,
      "groupIds": [],
      "points": [ [0, 0], [0, 20] ],
      "endArrowhead": "arrow"
    },
    {
      "type": "arrow",
      "version": 1,
      "id": "arrow-high-max",
      "x": 450,
      "y": 414,
      "width": 0,
      "height": 20,
      "angle": 0,
      "strokeColor": "#2d2d2d",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 1.4,
      "strokeStyle": "solid",
      "roughness": 1,
      "opacity": 100,
      "groupIds": [],
      "points": [ [0, 0], [0, 20] ],
      "endArrowhead": "arrow"
    },
    {
      "type": "arrow",
      "version": 1,
      "id": "arrow-max-host",
      "x": 450,
      "y": 474,
      "width": 0,
      "height": 20,
      "angle": 0,
      "strokeColor": "#2d2d2d",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 1.4,
      "strokeStyle": "solid",
      "roughness": 1,
      "opacity": 100,
      "groupIds": [],
      "points": [ [0, 0], [0, 20] ],
      "endArrowhead": "arrow"
    },
    {
      "type": "text",
      "version": 1,
      "id": "footnote",
      "x": 100,
      "y": 540,
      "width": 700,
      "height": 18,
      "angle": 0,
      "strokeColor": "#555",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "strokeStyle": "solid",
      "roughness": 1,
      "opacity": 100,
      "groupIds": [],
      "fontSize": 11,
      "fontFamily": 1,
      "text": "'Allocation cost isn't malloc(). It's the page fault that follows the first write to a page glibc just handed out.'",
      "textAlign": "center",
      "verticalAlign": "middle"
    }
  ],
  "appState": {
    "viewBackgroundColor": "#fdfbf7",
    "gridSize": null
  },
  "files": {}
}
