{ "type": "excalidraw", "version": 2, "source": "https://excalidraw.com", "elements": [ {"type": "text", "id": "title", "x": 100, "y": 15, "width": 900, "height": 45, "text": "Container-Aware JVM Memory: Before and After", "fontSize": 26, "fontFamily": 2, "textAlign": "center", "strokeColor": "#1971c2", "backgroundColor": "transparent", "roughness": 0, "opacity": 100, "angle": 0}, {"type": "text", "id": "before-title", "x": 60, "y": 75, "width": 400, "height": 30, "text": "❌ Default JVM (no container flags)", "fontSize": 17, "fontFamily": 2, "textAlign": "center", "strokeColor": "#c92a2a", "backgroundColor": "transparent", "roughness": 0, "opacity": 100, "angle": 0}, {"type": "text", "id": "after-title", "x": 600, "y": 75, "width": 400, "height": 30, "text": "✅ Java 21 + Container Flags", "fontSize": 17, "fontFamily": 2, "textAlign": "center", "strokeColor": "#2f9e44", "backgroundColor": "transparent", "roughness": 0, "opacity": 100, "angle": 0}, {"type": "rectangle", "id": "node-before", "x": 60, "y": 120, "width": 400, "height": 380, "strokeColor": "#adb5bd", "backgroundColor": "#f8f9fa", "fillStyle": "solid", "roughness": 1, "opacity": 100, "angle": 0, "strokeWidth": 2}, {"type": "text", "id": "node-before-lbl", "x": 70, "y": 128, "width": 380, "height": 22, "text": "64 GB Node RAM (what /proc/meminfo reports)", "fontSize": 12, "fontFamily": 2, "textAlign": "center", "strokeColor": "#495057", "backgroundColor": "transparent", "roughness": 0, "opacity": 100, "angle": 0}, {"type": "rectangle", "id": "jvm-before", "x": 100, "y": 158, "width": 310, "height": 300, "strokeColor": "#c92a2a", "backgroundColor": "#fff5f5", "fillStyle": "solid", "roughness": 1, "opacity": 100, "angle": 0, "strokeWidth": 2}, {"type": "text", "id": "jvm-before-lbl", "x": 110, "y": 165, "width": 290, "height": 22, "text": "JVM Process", "fontSize": 13, "fontFamily": 2, "textAlign": "center", "strokeColor": "#c92a2a", "backgroundColor": "transparent", "roughness": 0, "opacity": 100, "angle": 0}, {"type": "rectangle", "id": "heap-before", "x": 120, "y": 195, "width": 270, "height": 200, "strokeColor": "#c92a2a", "backgroundColor": "#ffc9c9", "fillStyle": "solid", "roughness": 1, "opacity": 100, "angle": 0, "strokeWidth": 2}, {"type": "text", "id": "heap-before-lbl", "x": 130, "y": 270, "width": 250, "height": 60, "text": "HEAP\n16 GB\n(25% of 64 GB host RAM!)", "fontSize": 14, "fontFamily": 2, "textAlign": "center", "strokeColor": "#c92a2a", "backgroundColor": "transparent", "roughness": 0, "opacity": 100, "angle": 0}, {"type": "rectangle", "id": "container-limit-before", "x": 80, "y": 340, "width": 350, "height": 40, "strokeColor": "#c92a2a", "backgroundColor": "#c92a2a", "fillStyle": "solid", "roughness": 0, "opacity": 100, "angle": 0, "strokeWidth": 1}, {"type": "text", "id": "container-limit-before-lbl", "x": 85, "y": 350, "width": 340, "height": 22, "text": "← Container limit: 512 MB (ignored!)", "fontSize": 12, "fontFamily": 2, "textAlign": "center", "strokeColor": "#ffffff", "backgroundColor": "transparent", "roughness": 0, "opacity": 100, "angle": 0}, {"type": "text", "id": "reads-host", "x": 60, "y": 400, "width": 400, "height": 60, "text": "JVM reads /proc/meminfo → sees 64 GB node RAM\nClaims 16 GB heap inside a 512 MB container\nResult: OOMKill (exit code 137)", "fontSize": 12, "fontFamily": 1, "textAlign": "center", "strokeColor": "#c92a2a", "backgroundColor": "transparent", "roughness": 0, "opacity": 100, "angle": 0}, {"type": "text", "id": "flags-before", "x": 60, "y": 460, "width": 400, "height": 30, "text": "# Old approach — fragile, breaks with VPA:\njava -Xms512m -Xmx1024m -jar app.jar", "fontSize": 11, "fontFamily": 3, "textAlign": "left", "strokeColor": "#c92a2a", "backgroundColor": "transparent", "roughness": 0, "opacity": 100, "angle": 0}, {"type": "rectangle", "id": "node-after", "x": 580, "y": 120, "width": 400, "height": 380, "strokeColor": "#adb5bd", "backgroundColor": "#f8f9fa", "fillStyle": "solid", "roughness": 1, "opacity": 100, "angle": 0, "strokeWidth": 2}, {"type": "text", "id": "node-after-lbl", "x": 590, "y": 128, "width": 380, "height": 22, "text": "64 GB Node RAM", "fontSize": 12, "fontFamily": 2, "textAlign": "center", "strokeColor": "#495057", "backgroundColor": "transparent", "roughness": 0, "opacity": 100, "angle": 0}, {"type": "rectangle", "id": "container-box", "x": 620, "y": 158, "width": 320, "height": 290, "strokeColor": "#1971c2", "backgroundColor": "#e7f5ff", "fillStyle": "solid", "roughness": 1, "opacity": 100, "angle": 0, "strokeWidth": 3}, {"type": "text", "id": "container-box-lbl", "x": 630, "y": 165, "width": 300, "height": 22, "text": "Container limit: 512 MB (enforced)", "fontSize": 12, "fontFamily": 2, "textAlign": "center", "strokeColor": "#1971c2", "backgroundColor": "transparent", "roughness": 0, "opacity": 100, "angle": 0}, {"type": "rectangle", "id": "jvm-after", "x": 640, "y": 192, "width": 280, "height": 245, "strokeColor": "#2f9e44", "backgroundColor": "#f4fdf6", "fillStyle": "solid", "roughness": 1, "opacity": 100, "angle": 0, "strokeWidth": 2}, {"type": "text", "id": "jvm-after-lbl", "x": 650, "y": 199, "width": 260, "height": 20, "text": "JVM Process", "fontSize": 13, "fontFamily": 2, "textAlign": "center", "strokeColor": "#2f9e44", "backgroundColor": "transparent", "roughness": 0, "opacity": 100, "angle": 0}, {"type": "rectangle", "id": "heap-after", "x": 655, "y": 225, "width": 250, "height": 100, "strokeColor": "#2f9e44", "backgroundColor": "#d3f9d8", "fillStyle": "solid", "roughness": 1, "opacity": 100, "angle": 0, "strokeWidth": 2}, {"type": "text", "id": "heap-after-lbl", "x": 665, "y": 255, "width": 230, "height": 40, "text": "HEAP: 384 MB (75% of 512 MB)", "fontSize": 13, "fontFamily": 2, "textAlign": "center", "strokeColor": "#2f9e44", "backgroundColor": "transparent", "roughness": 0, "opacity": 100, "angle": 0}, {"type": "rectangle", "id": "offheap-after", "x": 655, "y": 333, "width": 250, "height": 80, "strokeColor": "#e8590c", "backgroundColor": "#fff4e6", "fillStyle": "solid", "roughness": 1, "opacity": 100, "angle": 0, "strokeWidth": 1}, {"type": "text", "id": "offheap-after-lbl", "x": 665, "y": 350, "width": 230, "height": 40, "text": "Off-heap: 128 MB\n(Metaspace + Threads + JIT)", "fontSize": 11, "fontFamily": 1, "textAlign": "center", "strokeColor": "#e8590c", "backgroundColor": "transparent", "roughness": 0, "opacity": 100, "angle": 0}, {"type": "text", "id": "reads-cgroup", "x": 580, "y": 400, "width": 400, "height": 60, "text": "JVM reads /sys/fs/cgroup/memory.max → sees 512 MB\nHeap = 75% of 512 MB = 384 MB\nResult: correct sizing, no OOMKill", "fontSize": 12, "fontFamily": 1, "textAlign": "center", "strokeColor": "#2f9e44", "backgroundColor": "transparent", "roughness": 0, "opacity": 100, "angle": 0}, {"type": "text", "id": "flags-after", "x": 580, "y": 462, "width": 400, "height": 30, "text": "# Java 21: UseContainerSupport is ON by default\njava -XX:MaxRAMPercentage=75.0 -jar quarkus-run.jar", "fontSize": 11, "fontFamily": 3, "textAlign": "left", "strokeColor": "#2f9e44", "backgroundColor": "transparent", "roughness": 0, "opacity": 100, "angle": 0}, {"type": "text", "id": "divider", "x": 487, "y": 120, "width": 80, "height": 380, "text": "VS", "fontSize": 40, "fontFamily": 2, "textAlign": "center", "strokeColor": "#868e96", "backgroundColor": "transparent", "roughness": 0, "opacity": 100, "angle": 0}, {"type": "text", "id": "cgroup-note", "x": 100, "y": 510, "width": 880, "height": 35, "text": "cgroup v1: /sys/fs/cgroup/memory/memory.limit_in_bytes | cgroup v2 (RHEL 9 / OCP 4.14+): /sys/fs/cgroup/memory.max | Both handled automatically by Java 15+", "fontSize": 11, "fontFamily": 1, "textAlign": "center", "strokeColor": "#868e96", "backgroundColor": "transparent", "roughness": 0, "opacity": 100, "angle": 0} ], "appState": { "gridSize": null, "viewBackgroundColor": "#ffffff" } }