<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Shota M. | Air-Gapped HPC Arch</title>
    <description>The latest articles on DEV Community by Shota M. | Air-Gapped HPC Arch (@shotamatsubara).</description>
    <link>https://dev.to/shotamatsubara</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4134041%2F53afaabb-1efa-449c-be09-97293a0ebea8.jpg</url>
      <title>DEV Community: Shota M. | Air-Gapped HPC Arch</title>
      <link>https://dev.to/shotamatsubara</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/shotamatsubara"/>
    <language>en</language>
    <item>
      <title>Eliminating Exit 137 OOM Crashes in 10M Batch Workloads: 9 Docker Flags, libjemalloc2 Injection, and O(1) Polars Streaming</title>
      <dc:creator>Shota M. | Air-Gapped HPC Arch</dc:creator>
      <pubDate>Tue, 03 Nov 2026 16:11:08 +0000</pubDate>
      <link>https://dev.to/shotamatsubara/eliminating-exit-137-oom-crashes-in-10m-batch-workloads-9-docker-flags-libjemalloc2-injection-1clp</link>
      <guid>https://dev.to/shotamatsubara/eliminating-exit-137-oom-crashes-in-10m-batch-workloads-9-docker-flags-libjemalloc2-injection-1clp</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4mmdenba660jx17r0cub.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4mmdenba660jx17r0cub.png" alt=" " width="800" height="479"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvybu9s519hrrqug70ex1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvybu9s519hrrqug70ex1.png" alt=" " width="631" height="1053"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Executing 10,000,000 asynchronous LLM batch inferences or parsing 100GB+ binary files (ASPRS LAS, PCAPNG, ASAM MDF4, SEG-Y, BAM) on standard Linux containers routinely terminates with an &lt;code&gt;Exit 137&lt;/code&gt; (SIGKILL) Out-Of-Memory crash. Even on cloud instances provisioned with 128GB to 512GB of RAM, memory consumption climbs monotonically until the Linux kernel OOM killer terminates the process.&lt;/p&gt;

&lt;p&gt;Across two consecutive full production runs on a single bare-metal workstation (HP Z4 G4, Intel Xeon W-2155, 128GB DDR4-2666 ECC RDIMM, NVIDIA RTX 5060 Ti 16GB clamped at 160W, 2TB PCIe Gen4 NVMe raw partition &lt;code&gt;/mnt/data&lt;/code&gt;), we executed &lt;strong&gt;10,000,000 batch inference records in 10.9 hours (39,240 seconds)&lt;/strong&gt; at an average throughput of &lt;strong&gt;254.9 req/s&lt;/strong&gt; with a &lt;strong&gt;0.00% error rate (10,000,000 / 10,000,000 succeeded)&lt;/strong&gt; and &lt;strong&gt;$0.00 cloud compute cost&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Throughout the entire 10.9-hour execution window, host RAM remained strictly bounded between &lt;strong&gt;6.7GiB and 9.4GiB (O(1) constant space)&lt;/strong&gt; with &lt;strong&gt;0 bytes of swap usage&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/IMAGE_1_9_DOCKER_PARAMS_HERE" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/IMAGE_1_9_DOCKER_PARAMS_HERE" alt="9 Docker Run Parameters" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  1. Root Cause of the OOM Cliff: Glibc Arena Retention and In-Memory Accumulation
&lt;/h2&gt;

&lt;p&gt;Two architectural flaws cause memory exhaustion in high-throughput Python/C++ data pipelines:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Glibc &lt;code&gt;ptmalloc&lt;/code&gt; Heap Fragmentation:&lt;/strong&gt; Standard Linux containers use &lt;code&gt;glibc&lt;/code&gt; as the default allocator. Under multi-threaded asynchronous workloads (&lt;code&gt;asyncio&lt;/code&gt;, &lt;code&gt;vLLM&lt;/code&gt;, &lt;code&gt;PyTorch&lt;/code&gt;, &lt;code&gt;Polars&lt;/code&gt;), &lt;code&gt;glibc&lt;/code&gt; creates per-thread memory arenas to reduce lock contention. When small objects remain allocated near the top of a heap chunk, &lt;code&gt;free()&lt;/code&gt; does not return the underlying physical pages to the OS kernel via &lt;code&gt;brk&lt;/code&gt; or &lt;code&gt;madvise&lt;/code&gt;. Resident Set Size (RSS) ratchets upward indefinitely.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Unbounded In-Memory Frame Accumulation:&lt;/strong&gt; Calling &lt;code&gt;.append()&lt;/code&gt; on Python lists or materializing full DataFrames prior to disk write creates an O(N) memory spike that exceeds physical RAM capacity.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;
  
  
  2. The 9 Deterministic Docker Run Parameters
&lt;/h2&gt;

&lt;p&gt;To enforce an O(1) memory boundary and eliminate socket exhaustion (&lt;code&gt;ZMQError&lt;/code&gt; / &lt;code&gt;HTTP 500&lt;/code&gt;), the container runtime must be locked at startup:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker run &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="nt"&gt;--name&lt;/span&gt; airgapped-hpc-engine &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--gpus&lt;/span&gt; all &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--memory&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"90g"&lt;/span&gt; &lt;span class="nt"&gt;--memory-swap&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"90g"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--ipc&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;host &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--ulimit&lt;/span&gt; &lt;span class="nv"&gt;nofile&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;1048576:1048576 &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--tmpfs&lt;/span&gt; /tmp:rw,exec,nosuid,size&lt;span class="o"&gt;=&lt;/span&gt;20g &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-v&lt;/span&gt; /usr/lib/wsl/lib:/usr/lib/wsl/lib:ro &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-v&lt;/span&gt; /mnt/data:/mnt/data:rw &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-e&lt;/span&gt; &lt;span class="nv"&gt;LD_PRELOAD&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"/usr/lib/x86_64-linux-gnu/libjemalloc.so.2:/usr/lib/wsl/lib/libcuda.so.1"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-e&lt;/span&gt; &lt;span class="nv"&gt;MALLOC_CONF&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"background_thread:true,dirty_decay_ms:2000,muzzy_decay_ms:2000"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-e&lt;/span&gt; &lt;span class="nv"&gt;ZMQ_MAX_SOCKETS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;65535 &lt;span class="nt"&gt;-e&lt;/span&gt; &lt;span class="nv"&gt;MAX_ZMQ_SOCKETS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;65535 &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-e&lt;/span&gt; &lt;span class="nv"&gt;HF_HOME&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/tmp/hf_cache &lt;span class="nt"&gt;-e&lt;/span&gt; &lt;span class="nv"&gt;OUTLINES_CACHE_DIR&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/tmp/outlines &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-e&lt;/span&gt; &lt;span class="nv"&gt;XDG_CACHE_HOME&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/tmp/cache &lt;span class="nt"&gt;-e&lt;/span&gt; &lt;span class="nv"&gt;XDG_CONFIG_HOME&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/tmp/config &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--network&lt;/span&gt; none &lt;span class="se"&gt;\&lt;/span&gt;
  hpc-baseline:production-jemalloc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Critical Flag Breakdown:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;LD_PRELOAD&lt;/code&gt; &amp;amp; &lt;code&gt;MALLOC_CONF&lt;/code&gt;:&lt;/strong&gt; Overrides &lt;code&gt;glibc&lt;/code&gt; with &lt;code&gt;libjemalloc2&lt;/code&gt;. Setting &lt;code&gt;background_thread:true,dirty_decay_ms:2000,muzzy_decay_ms:2000&lt;/code&gt; forces dedicated background threads to issue &lt;code&gt;MADV_DONTNEED&lt;/code&gt; syscalls every 2,000ms, immediately returning unused dirty pages to the Linux kernel.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;--memory="90g" --memory-swap="90g"&lt;/code&gt;:&lt;/strong&gt; Enforces a hard cgroup ceiling with zero swap tolerance, preventing disk thrashing.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;--tmpfs /tmp:rw,exec,nosuid,size=20g&lt;/code&gt;:&lt;/strong&gt; Isolates ephemeral caches in RAM, protecting physical NVMe endurance.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;--network none&lt;/code&gt;:&lt;/strong&gt; Physically severs all external network interfaces at the kernel namespace level, guaranteeing zero data egress and zero cloud API billing.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  3. Out-of-Core Streaming and Two-Phase Atomic Persistence
&lt;/h2&gt;

&lt;p&gt;To maintain a flat 6.7GiB-9.4GiB memory footprint while writing multi-gigabyte outputs, all transformations stream directly to a raw ext4 NVMe partition (/mnt/data) bypassing virtual disk abstraction layers:&lt;/p&gt;

&lt;p&gt;Polars Out-of-Core Sink: Data streams through collect(engine="streaming") and sink_parquet() with row_group_size=100_000. Output writes first to a staging file (.parquet.tmp) and promotes via atomic os.replace() only after verification.&lt;/p&gt;

&lt;p&gt;SQLite WAL Kill-9 Immunity: State tracking uses SQLite in WAL mode (PRAGMA journal_mode=WAL; PRAGMA synchronous=NORMAL;) with BEGIN IMMEDIATE batch commits every 50,000 to 100,000 records and a background coroutine executing PRAGMA wal_checkpoint(TRUNCATE); every 10 minutes. Across unannounced kill -9 (SIGKILL) tests on our 3.4GB state database, recovery completed with zero data loss (PRAGMA integrity_check: ok).&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Production Air-Gapped Container Engines &amp;amp; Free 1-File PoV
&lt;/h2&gt;

&lt;p&gt;We do not host or process client production data on third-party clouds. We deliver reproducible, air-gapped Docker IaC containers directly to your on-premises or private VPC boundary.&lt;/p&gt;

&lt;p&gt;Direct Commercial Downloads (Polar.sh Instant Checkout):&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Air-Gapped HPC Base IaC Bundle ($1,200.00 USD)&lt;br&gt;
SHA-256: 1CB70C60C14C83CDD0AE799567D5CAFCF0E103B36CA7A3C29C775837689BB2FB&lt;br&gt;
Checkout: &lt;a href="https://buy.polar.sh/polar_cl_VUZ9enyIdPvLsFRr3wSMIfDFkIGVNwTo0ZskH3fRZfv" rel="noopener noreferrer"&gt;https://buy.polar.sh/polar_cl_VUZ9enyIdPvLsFRr3wSMIfDFkIGVNwTo0ZskH3fRZfv&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;GeoStream-Parquet Engine v1.0.0 - ASPRS LAS/LAZ ($1,800.00 USD)&lt;br&gt;
SHA-256: 281e07482d51dd4a195726c845deb6584f247e77e045c5bee11d187ae4ee0c0d&lt;br&gt;
Checkout: &lt;a href="https://buy.polar.sh/polar_cl_Xzj1yyC6t5Xh6iDy1cf7odEVmOBPxClhSnrvI1Z68Bj" rel="noopener noreferrer"&gt;https://buy.polar.sh/polar_cl_Xzj1yyC6t5Xh6iDy1cf7odEVmOBPxClhSnrvI1Z68Bj&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;NetForensic-Core v1.0.0 - PCAP/PCAPNG ($1,800.00 USD)&lt;br&gt;
SHA-256: 5203e2885b9d87e8dbd68cbcc01425c6351d8ff03caee9beeb77ae7657b3ab54&lt;br&gt;
Checkout: &lt;a href="https://buy.polar.sh/polar_cl_PDU5vVPDdyrQuXBwGdLm6mM2XfB10TTxvA7ze3aMeS3" rel="noopener noreferrer"&gt;https://buy.polar.sh/polar_cl_PDU5vVPDdyrQuXBwGdLm6mM2XfB10TTxvA7ze3aMeS3&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;MDF4-Parquet Engine v1.0.0 - Automotive ASAM MDF4 ($2,500.00 USD)&lt;br&gt;
SHA-256: cb1b15827908a94d2bc06fcde823e8c8feb4be2b3cac4d891d3dc8aa969b551a&lt;br&gt;
Checkout: &lt;a href="https://buy.polar.sh/polar_cl_Pp43kjfUkophrVuuXx8jaS0IFh1RBWgbtlFXq0Eei7D" rel="noopener noreferrer"&gt;https://buy.polar.sh/polar_cl_Pp43kjfUkophrVuuXx8jaS0IFh1RBWgbtlFXq0Eei7D&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;SeisParquet-Core v1.0.0 - Geophysical SEG-Y ($2,800.00 USD)&lt;br&gt;
SHA-256: 0441bb4ff617b76ee55992e5bf0d6dc816bff8fbc2337e52b3968487c03d1f48&lt;br&gt;
Checkout: &lt;a href="https://buy.polar.sh/polar_cl_H0B1ZerOs1jAcivd2vOBlfXmQMqnITRZEftAV21BxIK" rel="noopener noreferrer"&gt;https://buy.polar.sh/polar_cl_H0B1ZerOs1jAcivd2vOBlfXmQMqnITRZEftAV21BxIK&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;BioBAM-Streamer v1.0.0 - Genomic BAM/CRAM ($3,000.00 USD)&lt;br&gt;
SHA-256: ef7a29f12ec6cad14c9824a1526c80e93d46542841390a4f375f74bed68b547c&lt;br&gt;
Checkout: &lt;a href="https://buy.polar.sh/polar_cl_kjbvee0H5zG4ahd3MlgTvRStIDMkHQU52GpEy0BIEdF" rel="noopener noreferrer"&gt;https://buy.polar.sh/polar_cl_kjbvee0H5zG4ahd3MlgTvRStIDMkHQU52GpEy0BIEdF&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Request a Free 1-File Test Conversion (Proof-of-Value):&lt;br&gt;
Unsure if your 10GB-100GB+ binary dataset will trigger OOM crashes? Send 1 non-PHI sample file to &lt;a href="mailto:shota@shotamatsubara.com"&gt;shota@shotamatsubara.com&lt;/a&gt; for a zero-cost 10-minute test run under --network none. You will receive complete memory profile logs proving 0.00% error rate and locked RAM ceilings prior to purchase. Sample files are shredded immediately after verification.&lt;/p&gt;

&lt;p&gt;Official Architecture LP &amp;amp; Video Vault: &lt;a href="https://shotamatsubara.com" rel="noopener noreferrer"&gt;https://shotamatsubara.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;GitHub Benchmark Hub: &lt;a href="https://github.com/Matsubara-CEO" rel="noopener noreferrer"&gt;https://github.com/Matsubara-CEO&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Upwork Fixed-Price Contracts ($1,000-$5,000 USD): &lt;a href="https://www.upwork.com/freelancers/shotamatsubara" rel="noopener noreferrer"&gt;https://www.upwork.com/freelancers/shotamatsubara&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Terms: All software and IaC deliverables are provided strictly "AS IS" without warranty of any kind under UCC Section 2-316. Total liability is strictly capped at the purchase price paid.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Eradicating AWS OOM Kills: 10M LLM Inferences on a $0 Cloud-Cost O(1) Memory Clamped Architecture</title>
      <dc:creator>Shota M. | Air-Gapped HPC Arch</dc:creator>
      <pubDate>Tue, 20 Oct 2026 14:11:15 +0000</pubDate>
      <link>https://dev.to/shotamatsubara/eradicating-aws-oom-kills-10m-llm-inferences-on-a-0-cloud-cost-o1-memory-clamped-architecture-1fb6</link>
      <guid>https://dev.to/shotamatsubara/eradicating-aws-oom-kills-10m-llm-inferences-on-a-0-cloud-cost-o1-memory-clamped-architecture-1fb6</guid>
      <description>&lt;p&gt;High cloud API costs and Out-Of-Memory (OOM) failures in large-scale data pipelines are architectural defects, not hardware constraints. Standard cloud approaches force teams to continually scale up high-memory instances (e.g., AWS r6i/r7i) to survive memory leaks and heap fragmentation.&lt;/p&gt;

&lt;p&gt;This report documents the performance and execution of a 10,000,000-record batch LLM inference pipeline executed locally on an HP Z4 G4 workstation (Intel Xeon W-2155, 128GB ECC DDR4 RAM, NVIDIA RTX 5060 Ti 16GB VRAM, NVMe PCIe Gen4 SSD).&lt;/p&gt;

&lt;p&gt;Verified Benchmark Telemetry&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Total Executed Workload: 10,000,000 (10M) Async LLM / Batch Requests&lt;/li&gt;
&lt;li&gt;Success Rate: 100.00% (0.00% error rate, 0 dropped requests)&lt;/li&gt;
&lt;li&gt;Total Runtime: 10.9 hours continuous execution&lt;/li&gt;
&lt;li&gt;Average Throughput: ~254.9 req/s&lt;/li&gt;
&lt;li&gt;Memory Bounds: Clamped flatline between 6.72GiB and 9.4GB RAM (O(1) constant space)&lt;/li&gt;
&lt;li&gt;Database Integrity: 3.4GB SQLite WAL (PRAGMA integrity_check: ok)&lt;/li&gt;
&lt;li&gt;Cloud Compute Cost: $0.00&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Technical Architecture &amp;amp; Memory Enforcement&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Memory Allocator Substitution (libjemalloc2)
Standard glibc malloc exhibits severe heap fragmentation under sustained Python allocation and deallocation cycles, causing process RSS growth and eventual OOM terminations. Injecting libjemalloc2 via LD_PRELOAD bypasses glibc allocation delays.&lt;/li&gt;
&lt;/ol&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
bash
LD_PRELOAD="/usr/lib/x86_64-linux-gnu/libjemalloc.so.2" MALLOC_CONF="background_thread:true,dirty_decay_ms:2000,muzzy_decay_ms:2000"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>dataengineering</category>
      <category>devops</category>
      <category>machinelearning</category>
      <category>python</category>
    </item>
    <item>
      <title>10M Batch LLM Inference at $0 Cloud Cost: O(1) Memory Clamped Architecture</title>
      <dc:creator>Shota M. | Air-Gapped HPC Arch</dc:creator>
      <pubDate>Thu, 08 Oct 2026 14:13:31 +0000</pubDate>
      <link>https://dev.to/shotamatsubara/10m-batch-llm-inference-at-0-cloud-cost-o1-memory-clamped-architecture-1g62</link>
      <guid>https://dev.to/shotamatsubara/10m-batch-llm-inference-at-0-cloud-cost-o1-memory-clamped-architecture-1g62</guid>
      <description>&lt;p&gt;High cloud API costs and Out-Of-Memory (OOM) failures in large-scale data pipelines are architectural defects, not hardware constraints.&lt;/p&gt;

&lt;p&gt;This report documents the performance of a 10,000,000-record batch LLM inference workload executed locally on an HP Z4 G4 workstation (Intel Xeon W-2155, 128GB ECC DDR4 RAM, NVIDIA RTX 5060 Ti 16GB VRAM, NVMe PCIe Gen4 SSD).&lt;/p&gt;

&lt;h2&gt;
  
  
  Verified Metrics
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Success Rate&lt;/strong&gt;: 100.00% (10,000,000 / 10,000,000 records, 0.00% error rate)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Average Throughput&lt;/strong&gt;: ~254.9 req/s&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Total Runtime&lt;/strong&gt;: 10.9 hours&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Memory Bounds&lt;/strong&gt;: Clamped between 6.72GiB and 9.4GB RAM (O(1) constant space)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Database State&lt;/strong&gt;: 3.4GB SQLite WAL (&lt;code&gt;PRAGMA integrity_check: ok&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Compute Cost&lt;/strong&gt;: $0.00&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Technical Implementation
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Memory Allocator Substitution (jemalloc)
&lt;/h3&gt;

&lt;p&gt;glibc malloc exhibits heap fragmentation under sustained allocation and deallocation cycles. Injecting &lt;code&gt;libjemalloc2&lt;/code&gt; via &lt;code&gt;LD_PRELOAD&lt;/code&gt; with active background thread decay (&lt;code&gt;MALLOC_CONF="background_thread:true,dirty_decay_ms:2000,muzzy_decay_ms:2000"&lt;/code&gt;) prevents process RSS growth and maintains a predictable host RAM footprint.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Disk-Backed Parquet Streaming (Polars)
&lt;/h3&gt;

&lt;p&gt;In-memory array construction introduces O(N) spatial memory complexity. Streaming chunked outputs directly to disk using Polars (&lt;code&gt;collect(engine="streaming")&lt;/code&gt; and &lt;code&gt;sink_parquet&lt;/code&gt;) ensures memory usage remains independent of row count.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Atomic 2-Phase Transaction Logging (aiosqlite + WAL)
&lt;/h3&gt;

&lt;p&gt;State recovery and record tracking are managed via an &lt;code&gt;aiosqlite&lt;/code&gt; pipeline using Write-Ahead Logging (&lt;code&gt;PRAGMA journal_mode=WAL; PRAGMA synchronous=NORMAL;&lt;/code&gt;). Explicit &lt;code&gt;BEGIN IMMEDIATE&lt;/code&gt; transaction blocks are executed every 50,000 items, with periodic WAL truncation to guarantee system crash consistency and database integrity.&lt;/p&gt;

&lt;h2&gt;
  
  
  Zero Telemetry &amp;amp; Regulatory Compliance
&lt;/h2&gt;

&lt;p&gt;Transmitting unmasked enterprise datasets to external APIs introduces regulatory compliance risks under HIPAA and GDPR. Executing high-throughput LLM workloads on local, air-gapped infrastructure (&lt;code&gt;--network none&lt;/code&gt;) prevents telemetry transmission and external data exposure.&lt;/p&gt;

&lt;p&gt;Reproducible Code &amp;amp; Repository:&lt;br&gt;
&lt;a href="https://github.com/Matsubara-CEO" rel="noopener noreferrer"&gt;https://github.com/Matsubara-CEO&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Defeating AWS OOM and Cloud Costs: A Zero-Cloud-Cost Architecture using 128GB Bare-Metal, Polars, and jemalloc</title>
      <dc:creator>Shota M. | Air-Gapped HPC Arch</dc:creator>
      <pubDate>Sun, 20 Sep 2026 11:56:40 +0000</pubDate>
      <link>https://dev.to/shotamatsubara/defeating-aws-oom-and-cloud-costs-a-zero-cloud-cost-architecture-using-128gb-bare-metal-polars-1a3a</link>
      <guid>https://dev.to/shotamatsubara/defeating-aws-oom-and-cloud-costs-a-zero-cloud-cost-architecture-using-128gb-bare-metal-polars-1a3a</guid>
      <description>&lt;p&gt;Enterprises continuously burn thousands of dollars on AWS high-memory instances (e.g., r5.4xlarge) to avoid Out-Of-Memory (OOM) crashes when processing massive datasets or running local LLM inferences. Scaling vertically in the cloud is a costly workaround for inefficient memory architecture.&lt;/p&gt;

&lt;p&gt;We engineered a Zero-Cloud-Cost, fully Air-Gapped data infrastructure that fundamentally eradicates OOM errors by locking the memory footprint to a constant O(1) space.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Hardware &amp;amp; Tech Stack
&lt;/h2&gt;

&lt;p&gt;The baseline is a bare-metal HPC fortress: an HP Z4 G4 Workstation equipped with an Intel Xeon W-2155 (10C/20T), 128GB ECC RAM, and an RTX 5060 Ti 16GB.&lt;/p&gt;

&lt;p&gt;Rather than relying on pandas (which loads entire datasets into RAM and causes alignment cliffs), we utilized Polars LazyFrames and out-of-core streaming. State management was completely migrated from in-memory accumulation to an SQLite WAL (Write-Ahead Logging) database, utilizing atomic 2-phase commits per 50,000-row chunk.&lt;/p&gt;

&lt;h2&gt;
  
  
  Eradicating the OOM Killer with jemalloc
&lt;/h2&gt;

&lt;p&gt;Python and glibc's memory allocator notoriously delay memory returns, leading to severe fragmentation and inevitable SIGKILL terminations in containerized environments. We bypassed this entirely by hard-injecting &lt;code&gt;libjemalloc2&lt;/code&gt; into the Docker container.&lt;/p&gt;

&lt;p&gt;By injecting &lt;code&gt;LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.2&lt;/code&gt; and aggressively tuning &lt;code&gt;_RJEM_MALLOC_CONF="background_thread:true,dirty_decay_ms:0,muzzy_decay_ms:0"&lt;/code&gt;, we forced immediate background memory reclamation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Deterministic Evidence
&lt;/h2&gt;

&lt;p&gt;The results are deterministic and reproducible:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Throughput &amp;amp; Memory Footprint&lt;/strong&gt;: Processed 10M+ rows while the host RAM remained strictly locked between 7GB and 9GB maximum (O(1) constant space) despite processing massive continuous datasets.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cloud Costs &amp;amp; Egress&lt;/strong&gt;: $0.00.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Security&lt;/strong&gt;: 100% offline (launched with &lt;code&gt;--network none&lt;/code&gt;), mathematically guaranteeing zero PHI/PII data leakage for absolute HIPAA/GDPR compliance.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Cloud scalability is not a panacea for poor data engineering. On-premise, air-gapped HPC provides deterministic performance, absolute data privacy, and zero recurring compute costs.&lt;/p&gt;

&lt;p&gt;Need a HIPAA/GDPR-compliant, Zero-Cloud-Cost infrastructure deployed directly to your bare-metal environment? &lt;br&gt;
I do not ask for your sensitive data; I deliver the air-gapped architecture so you can process it securely yourself.&lt;/p&gt;

&lt;p&gt;👉 &lt;strong&gt;Hire me on Upwork for Fixed-Price enterprise consulting&lt;/strong&gt;: &lt;br&gt;
&lt;a href="https://www.upwork.com/freelancers/shotamatsubara" rel="noopener noreferrer"&gt;https://www.upwork.com/freelancers/shotamatsubara&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;👉 &lt;strong&gt;Connect with me on LinkedIn&lt;/strong&gt;: &lt;br&gt;
&lt;a href="https://www.linkedin.com/in/shota-matsubara-hpc/" rel="noopener noreferrer"&gt;https://www.linkedin.com/in/shota-matsubara-hpc/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>dataengineering</category>
      <category>aws</category>
      <category>python</category>
      <category>devops</category>
    </item>
  </channel>
</rss>
