ARCHOS 525 BLUEPRINT · /d/dgm_py-memory-gc-and-profiling
Python memory, GC and profiling
7 COMPONENTS · 6 FLOWS · UPDATED 2026-11-23
GITHUB README / PR PREVIEW CARD
[](https://archos.sageideas.dev/d/dgm_py-memory-gc-and-profiling) *Interactive architecture diagram powered by [ArchOS Studio](https://archos.sageideas.dev/d/dgm_py-memory-gc-and-profiling)*
NOTION / DOCS / CONFLUENCE EMBED
<iframe src="https://archos.sageideas.dev/embed/dgm_py-memory-gc-and-profiling" width="100%" height="580" style="border:1px solid rgba(240,236,225,0.14);border-radius:6px;" loading="lazy" title="Python memory, GC and profiling — Interactive in ArchOS"></iframe>
PORTABLE MERMAID SPEC (GITHUB / NOTION / RFC)
flowchart LR
client_0[("Client application")]
stream_1["Container runtime"]
gc_2["Container runtime"]
batch_3["Fanout workers"]
store_4[("PostgreSQL")]
prof_5[("Continuous profiling")]
sink_6[("Client application")]
client_0 -->|"1. Streams file · HTTPS"| stream_1
stream_1 -->|"2. O(1) RAM iter · TCP"| gc_2
gc_2 -->|"3. Batches 5k · TCP"| batch_3
batch_3 -->|"4. Streams COPY · SQL"| store_4
store_4 -->|"5. O(1) peak RSS · HTTPS"| sink_6
gc_2 -->|"Flamegraphs · HTTP"| prof_5COMPONENT STACK (7)
- Client applicationSTATEFUL10M-row payload
- Container runtimeSTATELESSyield lazy generator
- Container runtimeSTATELESSRefcount + Gen0-2 GC
- Fanout workersSTATELESSBounded 5k chunks
- PostgreSQLSTATEFULCOPY FROM STDIN
- Continuous profilingSTATEFULtracemalloc & py-spy
- Client applicationSTATEFULFlat RSS (0 OOM)
REQUEST & DATA FLOW (6)
- Client application → Container runtime (Streams file)[HTTPS]
- Container runtime → Container runtime (O(1) RAM iter)[TCP]
- Container runtime → Fanout workers (Batches 5k)[TCP]
- Fanout workers → PostgreSQL (Streams COPY)[SQL]
- PostgreSQL → Client application (O(1) peak RSS)[HTTPS]
- Container runtime → Continuous profiling (Flamegraphs)[HTTP]