<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by vverma21 on Medium]]></title>
        <description><![CDATA[Stories by vverma21 on Medium]]></description>
        <link>https://medium.com/@vivekverma.imsec?source=rss-86b226a204f4------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*gsKXd1y142hA1jeU</url>
            <title>Stories by vverma21 on Medium</title>
            <link>https://medium.com/@vivekverma.imsec?source=rss-86b226a204f4------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 08:39:45 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@vivekverma.imsec/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Reading the Ratchet: The GC-Log Forensics Behind Our (No) “Memory Leak”]]></title>
            <link>https://medium.com/@vivekverma.imsec/reading-the-ratchet-the-gc-log-forensics-behind-our-no-memory-leak-b2259bb5c30e?source=rss-86b226a204f4------2</link>
            <guid isPermaLink="false">https://medium.com/p/b2259bb5c30e</guid>
            <category><![CDATA[jvm]]></category>
            <category><![CDATA[memory-leak]]></category>
            <category><![CDATA[java-gc]]></category>
            <category><![CDATA[jvm-heap]]></category>
            <category><![CDATA[jvm-memory]]></category>
            <dc:creator><![CDATA[vverma21]]></dc:creator>
            <pubDate>Sat, 24 Oct 2026 17:59:12 GMT</pubDate>
            <atom:updated>2026-10-24T18:03:44.102Z</atom:updated>
            <content:encoded><![CDATA[<p><em>In part 1 </em>[<a href="https://medium.com/@vivekverma.imsec/the-mirage-of-a-jvm-memory-leak-a0a245bc2bc7">part 1 — link</a>]<em> I explained why our “memory leak” was really a JVM that wouldn’t give memory back. This is the follow-up I promised: the exact debugging steps, the log signals I read, the numbers that pointed at the cause — and the before/after once we moved to 32 MB heap regions on JDK 21.</em></p><h3>TL;DR</h3><ul><li>I enabled detailed G1 logging, reproduced the problem under load, and read the logs <strong>as a sequence of questions</strong>: Is it a pause problem? What is committed doing? Why did the heap grow? Does it ever shrink? Why did the collector stop working? What’s being allocated?</li><li>The answers formed a loop: <strong>humongous allocations</strong> (objects larger than half a heap region) forced G1 to <strong>expand the heap</strong>; the bigger heap pushed old-gen occupancy <strong>below the marking threshold</strong>, so concurrent cycles <strong>stopped</strong>; with no cycles, there was <strong>no point at which the heap could shrink</strong>. On JDK 11, it never did — <strong>zero uncommit events</strong> across two 90-minute captures.</li><li>The heap regions were <strong>4 MB</strong>, so anything ≥ 2 MB was humongous. One service allocated <strong>17,570</strong> humongous objects up to <strong>30.65 MB</strong>; the other allocated <strong>381,185</strong>, almost all <strong>exactly 8 MB</strong> — two regions each, which eventually caused <strong>15 allocation failures</strong> from fragmentation.</li><li>The fix: <strong>32 MB regions</strong> (humongous threshold → 16 MB), an <strong>explicit, fixed 10 GB heap</strong>, on <strong>JDK 21</strong>.</li><li>Results across <strong>7 load-test runs and 38 pod captures — including a ~19-hour soak</strong>: <strong>0 heap expansions, 0 humongous objects, 0 allocation failures, 0 Full GCs</strong>, committed heap flat at its configured size from first second to last, and worst-case pause <strong>102 ms</strong>.</li></ul><h3>Where part 1 left off</h3><p>The short version of [<a href="https://medium.com/@vivekverma.imsec/the-mirage-of-a-jvm-memory-leak-a0a245bc2bc7">part 1 — link</a>]: a production node alert looked like a memory leak, but wasn’t. Our lobby JVMs’ <strong>committed heap</strong> — memory taken from the OS — climbed in steps and never came back down, while the <strong>used heap</strong> inside it was healthy and reclaimable. I’d watched one JVM free ~12 GB of objects in a single collection while its committed heap didn’t move by a byte.</p><p>That told me <em>what</em> was happening. It didn’t tell me <em>why the heap kept growing in the first place</em>. Production metrics are too coarse for that — you need the collector’s own account of every decision it made. So I went to the GC logs.</p><h3>Step 1 — Turn on logging that answers “why”, not just “how long”</h3><p>Default GC logging tells you pause times. That’s not enough here. I needed the collector to explain its <strong>sizing decisions</strong>, its <strong>region-level commits</strong>, and its <strong>humongous allocations</strong>. These are the JDK unified-logging tags that matter, and what each one answers:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G_USXdo58sj38be3jpz5gA.png" /></figure><p>A word of caution: trace-level region logging is <strong>heavy</strong>. One 86-minute capture produced <strong>874 MB</strong> of logs across 9 files; another, 93 minutes long, produced <strong>1.62 GB</strong> across 17 files. Use rotation (filecount, filesize), and keep this level of detail for load tests, not permanent production config.</p><h3>Step 2 — Reproduce it under load</h3><p>I captured two lobby pods on our load-test cluster under a sustained tournament load profile: main-lobby for <strong>86 minutes</strong> and tour-lobby for <strong>93 minutes</strong>. Both ran the then-production configuration:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/964/1*nCRkpXObQFVa8oi-tcoVCw.png" /></figure><p>That 4 MB region size will turn out to be the hinge of the whole story.</p><h3>Step 3 — Rule out the usual suspects first</h3><p>Before chasing anything exotic, I checked the things that usually go wrong with a collector:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/762/1*bEd169FWcpUskSUliXVyOg.png" /></figure><p>The collector was fast and healthy. <strong>This was not a latency problem; it was a footprint problem.</strong> That narrows the investigation to a single question: why does the heap grow, and why does it never shrink?</p><h3>Step 4 — Plot committed against used-after-GC</h3><p>Every pause summary line already contains the three numbers you need:</p><pre>GC(…) Pause Young (Normal) (G1 Evacuation Pause) 5170M-&gt;1250M(7188M) 29.919ms<br>                                                 ^used   ^used  ^committed<br>                                                 before  after</pre><p><strong>Used-after-GC</strong> approximates what’s actually alive. <strong>Committed</strong> is what the JVM is holding from the OS. Extract both from every pause and plot them over time — the gap between them is memory the process holds but doesn’t need.</p><p>The two services told the same story in different shapes.</p><p><strong>main-lobby — a runaway, then a plateau.</strong> For the first 22 minutes, committed stayed under 1.5 GB. Then, in a <strong>22-second window</strong>, it jumped from <strong>1,432 MB to 6,760 MB</strong>, and later settled at <strong>7,188 MB</strong>, where it stayed for the rest of the capture. Meanwhile used-after-GC was only 1.3–2.3 GB. <strong>Mean slack across 1,174 collections: 75% — roughly 5.4 GB committed and unused at any moment.</strong></p><pre>committed (MB): 996 → 1196 → 1240 → … → 1432 → 1728 → 3188 → 4672 → 6760 → 7188  (then flat)</pre><p><strong>tour-lobby — a slow ladder.</strong> Committed climbed in discrete steps over ~50 minutes, from 988 MB to <strong>5.54 GB</strong> — a <strong>5.6×</strong> increase — and was still climbing when the capture ended. This pod genuinely used most of what it committed (mean slack ~25%), so the waste was smaller. But as we&#39;ll see, it had its own, more dangerous failure mode.</p><pre>committed (MB): 996 → 1436 → 2488 → 3992 → 4464 → 4916 → 5352 → 5544  (still climbing)</pre><h3>Step 5 — Ask the JVM why it grew</h3><p>This is where gc+ergo+heap pays for itself. G1 logs a reason every time it expands the heap. I counted them by reason:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7pVWX49RiM0eYFz4TJTxVg.png" /></figure><p>Remember the 22-second jump on main-lobby from Step 4, when committed went from 1,432 MB to 6,760 MB? The expansion log explains it: in that window, G1 fired <strong>10 back-to-back &quot;GC overhead&quot; expansions</strong>. G1&#39;s expansion heuristic grows the heap when recent GC overhead exceeds its threshold — here, <strong>6.6%</strong>. Overhead climbed from 2.33% to 7.02% faster than expansion could relieve it, so G1 kept growing. Here&#39;s the collector describing one of those decisions in its own words:</p><pre>GC(610) Attempt heap expansion (recent GC overhead higher than threshold after GC)<br>recent GC overhead: 8.73 % threshold: 6.60 % uncommitted: 9424601088B<br>base expansion amount and scale: 1884920217B (23.63%)</pre><p>On tour-lobby, the 11 overhead-driven expansions were orderly — overhead rose steadily from 1.08% to 4.13% and never crossed the runaway threshold. The alarming part was the <strong>tail</strong>: in the final six minutes, <strong>15 humongous allocations failed outright</strong>, each one forcing another expansion. Hold that thought.</p><h3>Step 6 — Check whether the heap ever shrinks</h3><p>The G1HR UNCOMMIT trace line is the definitive record of heap memory being returned. One grep settles it:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K0SWHBXXk2-KrGAKroPOaA.png" /></figure><p>Not once. On JDK 11, G1 only shrinks the committed heap at a <strong>Full GC</strong> or during the <strong>Cleanup</strong> phase at the end of a concurrent-mark cycle — and only if enough of the heap is free relative to MaxHeapFreeRatio at that exact moment. There&#39;s no idle-time path at all: the periodic collection that can return memory when the application is quiet (G1PeriodicGCInterval, JEP 346) arrived in JDK 12.</p><p>So whatever the heap grew to, it was going to stay there. The next question was why nothing ever even <em>tried</em> to shrink it.</p><h3>Step 7 — Find out why the collector went quiet</h3><p>I bucketed every collection into 5-minute windows by type. On main-lobby, the pattern was striking:</p><pre>window(s)  young  mixed  remark  cleanup<br>     0       65      7      9       9<br>   300       45     20     21      21<br>   600       40     11     10      10<br>   900       40     10      9       9<br>  1200      128      7      9       9    &lt;- the runaway expansion lands here<br>  1500       90      0      0       0    &lt;- concurrent cycles stop<br>  1800      111      0      0       0<br>   ...      ...      0      0       0    (zero for the rest of the run)</pre><p>After the runaway, <strong>mixed collections, remarks and cleanups dropped to zero — permanently.</strong> The reason is arithmetic. A concurrent-mark cycle starts when old-gen occupancy crosses the IHOP threshold, which is a percentage of the heap. Expand the heap 5× and the same old-gen data is suddenly a much smaller percentage. The threshold is never crossed again, so no marking cycle runs, so no Cleanup runs — and Cleanup was the only place JDK 11 G1 could have shrunk the heap.</p><p><strong>That’s the trap: growing the heap switched off the only mechanism that could have shrunk it.</strong></p><h3>Step 8 — Follow the humongous trail</h3><p>The last question was what was driving all this. gc+humongous logs every live humongous object with its size, and gc+marking records what triggered each concurrent cycle.</p><p>First, the definition. In G1, any object at least <strong>half a region</strong> in size is <em>humongous</em>. It skips the normal allocation path and is placed directly in old-gen, in a run of <strong>contiguous</strong> regions. With 4 MB regions, <strong>anything ≥ 2 MB was humongous</strong>.</p><p><strong>main-lobby: a broad spread of large objects.</strong> 17,570 humongous objects were sampled, sized 2–30 MB:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/358/1*5NFV6RE9TA5fD49AzrbEEg.png" /></figure><p>Half fell between 12 and 20 MB. The largest was <strong>30.65 MB — eight contiguous 4 MB regions</strong>. And <strong>23 concurrent-mark cycles were triggered directly by humongous allocations</strong>: these objects weren’t just occupying old-gen, they were driving the collector’s workload.</p><p><strong>tour-lobby: one size, over and over.</strong> 381,185 humongous samples — and <strong>88.6% of them were essentially the same size: 8,388,624 bytes, just over 8 MB.</strong> That&#39;s exactly two 4 MB regions per object. A fixed-size allocation like that is almost always a buffer or a serialization output being sized the same way every time.</p><p>That explained the tail of the tour-lobby run. Every one of those objects needed <strong>two adjacent free regions</strong>. After 90 minutes of allocating and freeing them, free regions were scattered across the heap. There was roughly <strong>1 GB of free space in total, but not two free regions side by side</strong> — so 15 allocations failed and the heap had to grow. That&#39;s <strong>fragmentation</strong>, and left running longer, its usual end state is an evacuation failure or a long Full GC.</p><blockquote><strong>These objects are a problem in their own right.</strong> A lobby service allocating 8–30 MB objects at this rate is a code-level smell, independent of how the collector handles them. Each one is a large chunk of memory allocated, filled and thrown away, often many times a second, and that costs allocation bandwidth, memory copies and CPU whatever the heap settings. The region-size change below stops the JVM from punishing us for them; it doesn’t make them go away. On main-lobby, objects of 16 MB and above remain humongous even with larger regions. Tracking down the allocation sites — the fixed 8 MB buffer, the 12–30 MB payloads — and reducing or reusing those allocations is the next piece of work, and we&#39;re working on it now.</blockquote><h3>The diagnosis, in one loop</h3><p>Putting the steps together:</p><ol><li>The application allocates large objects — 2–30 MB on one service, a steady stream of 8 MB objects on the other.</li><li>With 4 MB regions, every one is <strong>humongous</strong>: it lands in old-gen across 2–8 contiguous regions.</li><li>Humongous churn raises GC overhead and old-gen pressure, and fragments the free space. G1 responds by <strong>expanding the heap</strong> — sometimes in a 22-second burst.</li><li>The bigger heap pushes old-gen occupancy <strong>below the marking threshold</strong>. Concurrent cycles <strong>stop</strong>.</li><li>No cycles means no Cleanup — and on JDK 11, Cleanup or a Full GC were the only ways to <strong>shrink</strong>.</li><li>Committed heap stays at its high-water mark until the pod restarts.</li></ol><p>Every step is visible in the logs. None of it is a leak.</p><h3>Choosing the fix</h3><h3>1. Make the large objects ordinary: 32 MB regions</h3><p>The cheapest way to stop a humongous allocation is to raise the bar for what counts as one. With -XX:G1HeapRegionSize=32m, the humongous threshold moves from <strong>2 MB to 16 MB</strong>. Applied to what the logs showed:</p><ul><li><strong>tour-lobby:</strong> its ~8 MB objects become <strong>normal young-gen allocations</strong>. The largest object observed on this pod was 8,388,624 bytes — about 8 MB, half the new 16 MB threshold — so <strong>100%</strong> of that population falls below the humongous line. With it goes the need for contiguous free regions that caused the fragmentation failures.</li><li><strong>main-lobby:</strong> the 11,796 objects under 16 MB — <strong>67%</strong> of the sampled population — become normal allocations. The rest (16–30.65 MB) are still humongous, but each now fits in a <strong>single region</strong> instead of four to eight, so they no longer need a contiguous run of free regions either.</li></ul><p>There’s a trade-off. 32 MB is G1’s largest region size, and on a 10 GB heap it gives about <strong>320 regions</strong> — far fewer than the ~2,048 G1 aims for by default. Fewer, larger regions mean coarser-grained collection, so this choice had to be justified by pause times under load, not assumed. (It was — see below.)</p><h3>2. Stop the heap from sizing itself: a fixed 10 GB</h3><p>The second fix closes the gap from part 1. Instead of letting the JVM size itself to ¼ of the node, I set <strong>-Xms10g -Xmx10g</strong>. Under load, peak used-before-GC across our test runs topped out around <strong>6–7 GB</strong>, while used-after-GC stayed far lower — so 10 GB gives real headroom without the old 15.38 GB ergonomic ceiling.</p><p>Setting initial and maximum heap equal means <strong>there is nothing to expand</strong>: no ergonomic growth, no ladder, no runaway. The footprint becomes a number you can plan Kubernetes requests and limits around.</p><p>Yes — that means main-lobby now commits 10 GB from boot, which is more than the 7.2 GB it reached in the 86-minute test. That&#39;s intentional. <strong>A ratchet is unpredictable; a budget isn&#39;t.</strong> The production ratchet we started with had already reached 15.35 GB against a 16.5 GB ceiling.</p><h3>3. Do it on JDK 21</h3><p>The changes above went out as part of moving the engine to <strong>JDK 21 (21.0.12 LTS)</strong> — a runtime with a decade of G1 improvements over JDK 11, and one that finally has the idle-time uncommit path (G1PeriodicGCInterval) that JDK 11 lacked. We&#39;ve deliberately left periodic collection <strong>off</strong> for now: with a fixed-size heap there&#39;s nothing to give back, and the fixed budget is what makes capacity planning simple. If we later want an elastic footprint — for example, to make autoscaling scale <em>down</em> reliably — the lever exists on JDK 21. On JDK 11, it didn&#39;t.</p><p>The full JVM memory configuration:</p><pre>-Xms10g -Xmx10g -XX:G1HeapRegionSize=32m</pre><h3>The results</h3><h3>Before and after</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2k87ga1qHb6gYTaSMVezSQ.png" /></figure><p><em>JDK 21 columns are from a load test running a 10,000-player rebuy tournament. The JDK 11 baselines were single captures under a different load profile — compare the shapes and the zeros, not the absolute workloads.</em></p><p>Beyond the zeros, the headline is simple: the collector <strong>no longer grows the heap under any circumstances</strong>.</p><p><strong>What changed isn’t how much we allocate — it’s what those allocations cost.</strong> The application still creates the same large objects; region size and JDK version don’t change that. What changed is their path through the heap. On 4 MB regions, every one of them was humongous: placed straight into old-gen, held there until a concurrent-marking cycle came along, and able to trigger such cycles itself. On 32 MB regions most of them are ordinary young-generation objects that die young and are reclaimed in the next young collection, like everything else. That’s why live data after each collection dropped from gigabytes to hundreds of megabytes, why humongous-triggered marking cycles went from 23 and 8 to zero, and why GC overhead stays in the hundredths of a percent even on pods allocating close to 1 GB/s.</p><h3>Across every run</h3><p>One good run proves little, so I ran the same analysis across every JDK 21 load test:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ov-WXrKsPQgGv2ZZv9U6qg.png" /></figure><p><strong>38 pod captures. Zero expansions, zero humongous objects, zero allocation failures, zero Full GCs.</strong> Committed heap read exactly 10,240 MB at the first collection and at the last, in every one.</p><p>The soak is the one I care about most, because the original ratchet was a slow-time problem. Over <strong>~19 hours</strong>, peak used-after-GC never exceeded <strong>1,122 MB</strong> on any pod, GC overhead stayed around <strong>0.01%</strong>, and there were zero evacuation failures and zero aborted marking cycles. Nothing crept.</p><p>Pauses held up too, which was the risk with 320 large regions: young-collection p99 stayed between <strong>~20 and ~61 ms</strong> across runs, with a single worst-case pause of <strong>102 ms</strong> over 19 hours of soak.</p><h3>The debugging checklist</h3><p>If you’re chasing a JVM whose memory only goes up, these are the questions I’d ask of the GC logs, in order:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JrAshWvDfV6Ag0_-_V3rQA.png" /></figure><p>Each answer narrows the next question. By step 6, the fix almost picks itself.</p><h3>What I’d take away from this</h3><ol><li><strong>Read GC logs as answers to questions, not as a wall of numbers.</strong> “Is it a pause problem?” alone eliminated half the hypotheses.</li><li><strong>The pause summary line is the most underrated metric you have.</strong> before→after(committed) on every collection is all you need to see a ratchet.</li><li><strong>Always ask the JVM why it grew.</strong> Expansion reasons are logged; most teams just don’t turn them on.</li><li><strong>Compare object sizes to your region size.</strong> If a large share of your allocations are ≥ half a region, the collector is doing extra work you’re not seeing — and it can quietly grow your heap.</li><li><strong>A fixed budget beats an elastic surprise.</strong> Until you need elasticity, Xms = Xmx turns memory from a mystery into a capacity-planning input.</li><li><strong>Prove it across many runs, especially a long one.</strong> The original problem appeared over hours and days. One 90-minute success wouldn’t have convinced me; a 19-hour soak with flat lines did.</li></ol><p><em>Analysis based on G1 unified-logging captures from our load-test environment: two JDK 11 baselines (86 and 93 minutes) and seven JDK 21 runs (38 pod captures, up to ~19 hours each).</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b2259bb5c30e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Mirage of a JVM Memory Leak]]></title>
            <link>https://medium.com/@vivekverma.imsec/the-mirage-of-a-jvm-memory-leak-a0a245bc2bc7?source=rss-86b226a204f4------2</link>
            <guid isPermaLink="false">https://medium.com/p/a0a245bc2bc7</guid>
            <category><![CDATA[performance-engineering]]></category>
            <category><![CDATA[java-heap-memory]]></category>
            <category><![CDATA[jdk21]]></category>
            <category><![CDATA[jdk-11]]></category>
            <category><![CDATA[jvmperformance]]></category>
            <dc:creator><![CDATA[vverma21]]></dc:creator>
            <pubDate>Sat, 17 Oct 2026 04:34:22 GMT</pubDate>
            <atom:updated>2026-10-17T04:34:22.435Z</atom:updated>
            <content:encoded><![CDATA[<p><em>I got paged for what looked like a memory leak in our distributed Java game engine. What I eventually uncovered was that it wasn’t a leak at all — it was our runtime refusing to give memory back. Here’s the whole investigation, the evidence, the dead ends, and why it became the clearest business case I’ve ever had for a JVM upgrade.</em></p><h3>TL;DR</h3><ul><li>A production node tripped a <strong>memory alert</strong>: system.mem.used sustained around <strong>74%</strong> on a 64 GiB box. My first instinct — &quot;memory leak&quot; — was wrong.</li><li>The real finding: our JVMs’ <strong>committed heap grows in steps and never comes back down</strong>. The only thing that ever reduces it is a restart.</li><li>Three JVMs on that node were running with <strong>no </strong><strong>-Xmx at all</strong>, so each defaulted to ~¼ of host RAM = <strong>16.5 GB max heap</strong>. Three of them summed to <strong>49.5 GB of max heap on a 64 GB machine.</strong></li><li>A load spike ratcheted committed heap from ~5 GB to ~15 GB — driven by <strong>large (“humongous”) allocations</strong> that forced the collector to commit more and more of the heap. Then I watched the JVM <strong>free ~12 GB of live objects in a single cleanup cycle — and committed memory didn’t drop by a single byte.</strong> That one observation is the whole story.</li><li>On <strong>Java 11</strong>, there is no routine mechanism to hand that memory back to the OS. That’s not a bug we can patch. It’s a platform ceiling — and it’s why we’re moving the engine to <strong>JDK 21.</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FjY1THaviDY_srYUT20ZBA.png" /></figure><h3>The system, briefly</h3><p>We run a distributed, multi-shard online game engine on the JVM — Java 11, built on a real-time socket server, with <strong>Hazelcast</strong> coordinating state across nodes. Tournaments and cash games are served by role-specific pods. For this story the ones that matter are the <strong>lobby</strong> and <strong>cash</strong> services (main-lobby, tour-lobby, tour-cash), which run across more than a dozen production clusters, each an EKS cluster with multiple shards. At peak, thousands of concurrent players move through registration, seating, blind progression, breaks and payouts.</p><p>Memory here isn’t academic. A node that runs out of memory takes live tournaments down with it. So when the alert fired, I took it seriously — and then I took it apart.</p><h3>Act 1 — The alert, and the thing I found underneath it</h3><p>The page was simple: a node in one of our clusters had system.mem.used sitting around <strong>74%</strong> (real used, excluding page cache) and staying there. The box was an AWS c6a.8xlarge — <strong>64 GiB of RAM</strong> — acting as spare/failover capacity for tournament load.</p><p>My first instinct was everyone’s first instinct: <em>we have a leak.</em> But before I went hunting for one, I did the boring thing and audited how the JVMs on that node were even configured. That’s where the first real surprise was.</p><p><strong>None of the three JVMs on the node had an explicit </strong><strong>-Xmx.</strong> Not in the server launch script, not in the Helm values, nowhere in the production deploy path. The only memory-related flag anywhere was the build tool&#39;s daemon setting, which has nothing to do with the runtime.</p><p>Here’s why that matters. When you don’t set -Xmx and there&#39;s no container memory limit, HotSpot falls back to its server ergonomics and picks a maximum heap of roughly <strong>¼ of physical RAM</strong>. On a 64 GiB box that&#39;s ~16 GiB. I could confirm it straight from the metrics: jvm.heap_memory_max read <strong>16,512,974,848 bytes</strong> — identical — for all three services. That&#39;s not a coincidence, that&#39;s the ergonomic default showing up three times.</p><p>So the node was running:</p><p>ServiceMax heap (-Xmx)Committed heapLive heap in usemain-lobby16.5 GB (default)15.35 GB10.2 GBtour-cash16.5 GB (default)14.94 GB7.3 GBtour-lobby16.5 GB (default)2.17 GB1.6 GB<strong>Sum49.5 GB32.5 GB</strong>~19 GB</p><p>Three JVMs each <em>allowed</em> to grow to 16.5 GB, on a 64 GB box. The math alone — 49.5 GB of potential max heap, plus ~14–15 GB of off-heap (Hazelcast/Netty direct buffers), plus the OS and page cache — explains the alert before you even ask about leaks. The node was capacity-bound by configuration.</p><p>But that still didn’t explain the <em>stickiness</em>: why, once memory went up, it never came back down.</p><h3>Act 2 — Why there was no -Xmx, and the Kubernetes container trap</h3><p>Before I go further, this question deserves an honest answer, because it’s the part most teams will recognize in their own stack: <strong>how do you end up running production JVMs with no heap sizing at all?</strong></p><p>It wasn’t a single bad decision. It was accumulated default. The server launch script had shipped for years without heap flags — there’s even a comment in it suggesting you “set the size according to your needs.” Nobody ever did. On the old bare-VM deployment, the ¼-of-RAM default happened to be “good enough,” so it was never revisited. The flag that was never there simply stayed never there.</p><p>Then we containerized onto Kubernetes, and two things quietly compounded into the number you saw above:</p><ol><li><strong>No </strong><strong>-Xmx, and no pod memory limit.</strong> The one memory limit in our Helm chart was commented out. Modern JVMs are &quot;container-aware&quot; (UseContainerSupport is on by default), and people assume that means the JVM will Do The Right Thing inside a pod. But container-awareness only has teeth if there&#39;s a <strong>cgroup memory limit to read</strong>. With no limit set, the JVM doesn&#39;t see a pod-sized sandbox — it sees the <strong>whole 64 GiB node</strong> and sizes its heap off that. So every pod on the node independently concluded &quot;my max heap is ¼ of 64 GiB = 16.5 GB,&quot; with no awareness of the other JVMs sitting right next to it.</li><li><strong>Sizing driven by node size, not workload.</strong> Three co-located JVMs, each sizing off the node, each claiming up to 16.5 GB → 49.5 GB of <em>potential</em> heap on a box that has 64 GB total. Nobody ever chose that number. It’s what you get when the JVM sizes itself against hardware instead of against its job.</li></ol><p>This is the container trap in one line: <strong>“the JVM is container-aware now” is only true if you give it a memory limit or explicit flags. We had neither.</strong> The absence of -Xmx wasn&#39;t the root cause of the stickiness — but it&#39;s why there was no guardrail when the stickiness showed up, and it&#39;s why one service was later free to climb all the way to 16.5 GB.</p><h3>Act 3 — Used vs committed, and why I stopped looking for a leak</h3><p>A classic Java leak has a clear signature: the <strong>live set</strong> — the objects that survive a cleanup — trends upward forever, because something holds references it should have released. An unbounded cache, a queue nobody drains, listeners that never deregister.</p><p>That is not what I was seeing. I was seeing two numbers behave very differently:</p><ul><li><strong>Used heap</strong> went up and down with load, exactly as it should. The app was reclaiming objects fine.</li><li><strong>Committed heap</strong> — the memory the JVM has claimed from the OS — only ever went <strong>up</strong>, in steps, and then <strong>stayed there</strong>.</li></ul><p>If there’s one sentence I want you to take from this whole post, it’s this:</p><blockquote><strong><em>Used heap is what your application needs right now. Committed heap is what the JVM has taken from the operating system and won’t give back. A node memory alert is driven by committed, not by used.</em></strong></blockquote><p>Chasing a leak means chasing the <em>used</em> number. My used number was healthy. So I stopped hunting a leak and started asking a sharper question: <strong>why does committed heap ratchet up and never release?</strong></p><h3>Act 4 — The keystone observation</h3><p>I pulled the live JVM metrics on that node and just watched for a couple of hours. The main-lobby service handed me the answer directly.</p><p>Its live set had been sitting at the high-water mark from the earlier load spike — around <strong>12–13 GB</strong>. Then, in one cleanup cycle, it <strong>collapsed to 1.18 GB</strong>. The JVM had reclaimed roughly <strong>12 GB of objects in a single pass.</strong> Definitively not a leak — the live set was bounded and reclaimable.</p><p>And here’s the part that made me sit up: through that entire 12 GB reclamation, <strong>committed heap stayed flat at 15.35 GB. It did not move one byte.</strong></p><p>That’s the whole riddle in a single data point:</p><p>MomentLive heapCommitted heapBefore cleanup~12.3–13.0 GB15.35 GB<strong>After cleanup1.18 GB15.35 GB</strong></p><p>The application gave 12 GB back to the <em>heap</em>. The JVM gave <strong>nothing</strong> back to the <em>operating system</em>. From the OS’s point of view — and therefore from the alert’s point of view — those 15.35 GB were still “used,” no matter how empty they were inside.</p><p>The “memory leak” was a memory <strong>retention</strong> problem. Nothing was leaking. The JVM was holding every page it had ever committed.</p><h3>Act 5 — Confirming it was load, not a bug</h3><p>Before blaming the runtime, I had to be sure the <em>growth</em> itself was legitimate — that the spikes were real load, not a regression quietly accumulating garbage.</p><p>The step-ups were telling. Two services (main-lobby and tour-cash) jumped <strong>on the same days</strong> — a shared environmental cause, not a per-service leak. Non-heap memory (metaspace, code cache) barely moved through the whole episode, which rules out a classloader leak; the growth was plain application data on the heap.</p><p>And the Hazelcast traffic lined up exactly. Our tournament IMap operation counts ran <strong>~3× normal</strong> on the spike day — tournament-tables and player-data maps going from a few thousand hits per interval to tens of thousands. More concurrent tournaments and players means those maps hold more entries for the duration of each tournament, and the heap grows to match. That’s load, with high confidence, not a leak.</p><p>So the picture resolved cleanly: legitimate load spikes push committed heap up in steps, the JVM never hands that committed memory back, and the node’s resident memory only ratchets upward until the next restart.</p><p>But <em>why</em> did load push committed heap up so far, so fast? That’s where the collector comes in.</p><h3>Act 6 — Why it climbed so high: humongous allocations and how the heap commits memory</h3><p>I promised not to drown this post in GC internals, so here’s the short version — just enough to explain the risers in that staircase.</p><p>Our collector (G1) divides the heap into a few thousand fixed-size <strong>regions</strong>. For a heap this size, each region is on the order of <strong>8 MB</strong>. Most objects are small and get allocated into young-generation regions, collected cheaply and often. But any single object that’s <strong>≥ 50% of a region</strong> (~4 MB here) is special: the JVM calls it a <strong>humongous</strong> object, and it can’t go through the normal fast path. It gets placed directly into a run of <strong>contiguous</strong> regions carved out of the old generation.</p><p>Our workload produces exactly these under tournament load. When many concurrent tournaments are serializing and shuffling large state structures — big player/table payloads moving through Hazelcast — some of those objects cross the humongous threshold. And humongous objects are expensive in two ways that both push committed heap up:</p><ol><li><strong>They force the heap to grow to find contiguous space.</strong> A humongous object needs a contiguous run of free regions. When the heap is busy and that contiguous space isn’t readily available, G1’s answer is to <strong>commit more regions</strong> from the OS to satisfy the allocation. A burst of humongous allocations during a spike makes the heap expand quickly — that’s the 3.3 → 9.4 GB in ~5 hours riser we saw.</li><li><strong>They’re reclaimed less readily than ordinary objects.</strong> Humongous regions are freed at specific collection points rather than on every young collection, so during a busy window they accumulate and keep the committed footprint high.</li></ol><p>Put those together with the Java 11 behavior from the next section — the collector won’t return committed regions to the OS outside a full heap cleanup, which never happens in steady state — and you get the exact shape of our problem:</p><blockquote><strong><em>The riser in the staircase is a burst of large/humongous allocations forcing the heap to commit more regions. The flat tread afterward is Java 11 never giving those regions back.</em></strong></blockquote><p>The real remediation — reducing those large allocations, and choosing a region size and heap size that keep humongous objects rare — is a deeper tuning exercise than this post. (More on that in a moment, and in the follow-up article.)</p><h3>Act 7 — It’s fleet-wide, and it walks right up to the ceiling</h3><p>That first node was one data point. So I pulled <strong>15 days</strong> of history for the lobby services across multiple nodes and clusters to see if the pattern held. It did — and it was worse than I expected.</p><p><strong>The committed-heap staircase was everywhere.</strong> On one main-lobby JVM the committed line looked like this over the window (restarts marked):</p><p>PhaseCommitted heapEventStart~13.5 GB (flat)pre-existing plateau<em>restart</em>→ ~8.0 GBnew lower plateau, flat for days<em>restart</em>→ 3.0 GB, creeping to 3.3 GBslow drift upwardOver ~5 hours<strong>3.3 → 9.4 GB</strong>sharp expansion eventRest of window (days)<strong>9.38 GB, dead flat</strong>never came down</p><p>Flat treads, sudden risers, and the only way back to the ground floor is a reboot.</p><p><strong>And on a second node, I caught one hit the ceiling.</strong> A main-lobby JVM climbed:</p><blockquote><em>5.3 → 7.5 → 8.6 → 9.8 → 10.3 → 10.8 → </em><strong><em>16.5 GB</em></strong></blockquote><p>That last number is the ergonomic -Xmx. The JVM committed its entire configured maximum and pinned there. No headroom left. One more large allocation at that moment is the difference between &quot;memory alert&quot; and &quot;OutOfMemoryError kills the pod mid-tournament.&quot; The staircase had walked that JVM right up to the edge of a production incident.</p><p><strong>The spike was simultaneous across independent clusters</strong> — same wall-clock time, different infrastructure. That killed “bad node” and “noisy neighbor” outright: the trigger is a <em>workload</em> characteristic, intrinsic to how the app allocates under certain conditions.</p><h3>Act 8 — A second lens: the container agreed</h3><p>JVM metrics are the JVM’s own view. To make sure I wasn’t fooling myself, I cross-checked against <strong>AWS CloudWatch Container Insights</strong>, which measures the <em>container’s</em> resident memory (pod_memory_utilization) — heap plus everything else. Over the same 15 days, for a main-lobby pod on one tournament cluster, by day:</p><p>DayMin %Max %Noteplateau28.728.8high, flatrestart0.028.7drop to zero = restartspike0.0<strong>30.9</strong>the fleet-wide eventrecovery16.218.4new flat shelfrestart0.018.4restartthen a week9.0 → 9.2 → 10.2 → 11.1 → 11.5 → 11.8 → 11.9<strong>monotonic creep, never down</strong></p><p>The detail that sealed it: on every <em>stable</em> day, the <strong>hourly minimum essentially equalled the hourly maximum.</strong> The container’s footprint had no meaningful oscillation — a smooth line that only climbed. The app was reclaiming objects internally (used heap rose and fell all day), but the <strong>pod’s resident memory never receded</strong>, because the JVM held every page it had committed.</p><p>Three independent lenses — JVM committed heap, the -Xmx ceiling hit, and container RSS — all told the same story.</p><h3>Act 9 — The obvious fix, and why we can’t just ship it</h3><p>At this point someone always says: <em>“just set </em><em>-Xms = </em><em>-Xmx to a sane number and move on.&quot;</em></p><p>We <strong>are</strong> closing the configuration gap — explicit heap flags per service, a cgroup memory limit so the JVM stops sizing off the whole node, heap-dump-on-OOM (the node had none), and a real memory-headroom alert. That part is overdue and uncontroversial.</p><p>But the <em>value</em> you put in -Xmx is the hard part, and shipping a wrong number into a real-time, money-handling engine is its own incident. Here&#39;s why you can&#39;t just pick a number and walk away:</p><ul><li><strong>-Xmx is not just a cap — it changes GC behavior.</strong> A smaller heap means less runway between collections, so the collector runs <strong>more often</strong>. In a latency-sensitive engine where a pause during a live hand is user-visible, cutting the heap too aggressively can trade a memory problem for a <strong>latency problem</strong>. You don&#39;t find out which until you measure under real load.</li><li><strong>Heap size interacts with region size and the humongous threshold.</strong> Change the heap and you change how big a G1 region is — which changes what counts as “humongous,” which changes allocation behavior for exactly the large objects driving our growth. These knobs have to <strong>agree with each other</strong>; you can’t tune one in isolation.</li><li><strong>Too low and you OOM during the very spikes you’re trying to survive</strong> — we watched a JVM legitimately use ~12–13 GB of live heap during a load event. Too high and you’re back to oversubscribing the node.</li></ul><p>So the right heap size isn’t a guess — it’s the <strong>output of a controlled performance test</strong>: replay representative tournament load, sweep heap sizes and region sizes together, and find the point where memory footprint, collection frequency, pause times, and the humongous threshold all line up. Finding the memory and region size that keep the footprint bounded <em>and</em> keep the collector happy <em>and</em> keep latency flat is a whole investigation of its own.</p><p><strong>That tuning story is the subject of our next post.</strong> This one is about what we found and why it points at the platform.</p><h3>Act 10 — And even perfectly sized, Java 11 won’t give it back</h3><p>Say we do all that tuning and land the perfect -Xmx. It caps the ceiling — but it does <strong>not</strong> make the footprint elastic.</p><p>On our runtime, committed heap returns to the OS <strong>only during a full, stop-the-world cleanup</strong> — an event that, in a well-behaved low-pause configuration, essentially never happens in steady state. Across the entire 15-day window, on every node, I saw <strong>zero</strong> of them. Great for latency. It also means <strong>there is no routine mechanism on Java 11 for committed heap to shrink.</strong> Once it’s up, it’s up until restart.</p><p>A well-chosen -Xmx lowers the ceiling the staircase can reach. It doesn&#39;t turn the staircase into something that can walk back down. For that — memory that comes <em>back</em> after a spike, automatically, while the app keeps running — you need a newer runtime.</p><blockquote><em>That’s the pivot. The investigation didn’t end at “we found the leak.” It ended at “we found a platform ceiling, and the way through it is a JVM upgrade.”</em></blockquote><h3>Act 11 — Why JDK 21</h3><p>Moving the engine to <strong>JDK 21</strong> (an LTS) attacks the exact root cause I found, and brings a stack of performance wins with it.</p><h3>Expected gains from JDK 21</h3><p>CapabilityWhat it changes for us<strong>Return unused memory to the OS</strong> (G1 periodic uncommit)The exact gap we hit: the GC can give committed heap <em>back</em> to the OS during quiet periods instead of holding it until restart. Turns our one-way ratchet into an elastic footprint.<strong>Generational ZGC</strong> — low-pause, memory-aware collectorA collector built for large heaps that reclaims memory as a first-class behavior, with lower allocation-stall risk, lower heap overhead, and lower GC CPU — and pauses that don’t grow with heap size.<strong>Pause times decoupled from heap size</strong>A long GC pause can disrupt a live hand. ZGC keeps pauses tiny regardless of how big the heap gets.<strong>Virtual threads</strong> — scale for a connection-heavy serverOur workload is fundamentally many concurrent sessions. Thread-per-request code can scale far past what platform threads allow — more concurrency per GB, without the thread-pool ceiling.</p><p>A fair caveat on all of these: we’re treating the upgrade as something to validate on <em>our</em> services, not inherit from someone else’s benchmark.</p><h3>Net effect</h3><p>Problem I found (Java 11)What JDK 21 changesCommitted heap never returns to the OS while runningGC can shrink committed heap during quiet periods (JEP 346)Only a restart reclaims memoryMemory reclaimed automatically, no rebootBig heap → risk of long pauses≤ 1 ms pauses, independent of heap size (ZGC)Thread-per-connection memory costVirtual threads: far more concurrency per GB</p><p>The investigation didn’t just hand me a bug to patch. It handed me the single clearest, evidence-backed reason to make a platform investment we’d been circling for a while.</p><h3>What I’d tell anyone chasing a “memory leak”</h3><ol><li><strong>Separate <em>used</em> from <em>committed</em> before you theorize.</strong> A node alert is about committed/RSS. If used is healthy but the alert persists, you’re chasing retention, not a leak.</li><li><strong>A flat line that only steps up isn’t a leak — it’s a ratchet.</strong> Leaks slope upward in the live set. Ratchets plateau and jump. The shape tells you the mechanism.</li><li><strong>Audit the config before you blame the code.</strong> “Three JVMs with no -Xmx on a 64 GB box&quot; explained most of my alert before I&#39;d looked at a single object — and &quot;container-aware&quot; meant nothing without a memory limit to read.</li><li><strong>Corroborate across layers.</strong> The JVM’s view and the container’s RSS measure different things. When they agree, you’ve localized the problem; when they disagree, you’ve found an off-heap story.</li><li><strong>Correlate across the fleet.</strong> A spike at the same wall-clock time on independent nodes is a <em>workload</em> signature, not a sick host. That one observation killed three wrong hypotheses at once.</li><li><strong>Sometimes the fix isn’t a patch — it’s a platform.</strong> The most valuable output of a debugging session can be an evidence-backed case for an upgrade you couldn’t justify before.</li></ol><p><strong><em>Next up:</em></strong><em> how we actually find the right heap and region size — the one that keeps the footprint bounded, keeps large allocations rare, and keeps the collector happy under real tournament load. If you’re running a large, long-lived Java service on an older LTS and you’ve quietly normalized “just restart it to reclaim memory,” that one’s for you.</em></p><p><em>Investigation tooling: Datadog (JVM runtime metrics) and AWS CloudWatch Container Insights (per-pod memory), cross-referenced over a 15-day production window, building on an initial node-level investigation. All quantitative figures are from the real investigation.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a0a245bc2bc7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The 7 GB Off-Heap “Leak” That Wasn’t: Chasing a JVM Memory Mystery Down to Rosetta 2]]></title>
            <link>https://medium.com/@vivekverma.imsec/the-7-gb-off-heap-leak-that-wasnt-chasing-a-jvm-memory-mystery-down-to-rosetta-2-6996cf3d776b?source=rss-86b226a204f4------2</link>
            <guid isPermaLink="false">https://medium.com/p/6996cf3d776b</guid>
            <dc:creator><![CDATA[vverma21]]></dc:creator>
            <pubDate>Thu, 01 Oct 2026 16:46:00 GMT</pubDate>
            <atom:updated>2026-10-01T16:46:00.116Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>A JDK 21 upgrade, a dying container, and 10 hours chasing a ghost on Apple Silicon.</strong></p><h3>TL;DR</h3><p>We upgraded a JVM-based game server from JDK 11 to JDK 21. Validated with a two-tournament POC. Then the container started dying every 2–3 tournaments. The Java heap was tiny (~250 MB). The container RSS was 8 GB and climbing.</p><p>We spent 10 hours instrumenting the JVM (JVM Micrometer binders, Native Memory Tracking, Netty paranoid leak detection, GC logs), swapping allocators (MALLOC_ARENA_MAX=2, then jemalloc with heap profiling), dumping /proc/&lt;pid&gt;/smaps, chasing hypotheses through log4j async loggers, the Datadog java-agent, Hazelcast&#39;s native code, and the server framework&#39;s native TCP buffers.</p><p>The actual root cause: we were running --platform=linux/amd64 Docker containers on an Apple M3 Pro. <strong>Rosetta 2 translates every piece of JIT-compiled x86_64 code into ARM64 and caches it in 128 MB arenas.</strong> On a JIT-heavy workload those arenas grow and never shrink. After a few tournaments the Rosetta cache alone had consumed ~3 GB. Compounded over multiple runs, it tipped the container over. Checking /proc/&lt;pid&gt;/smaps address ranges first would have made this a 15-minute investigation, not a 10-hour one.</p><p>Rebuilding as a native linux/arm64 image dropped per-tournament RSS growth from <strong>+2.9 GB</strong> to <strong>+0.4 GB</strong> (−86%) and memory plateaued cleanly across multiple tournaments, including two run in parallel.</p><p>The upgrade was never broken.</p><h3>1. Setup</h3><p><strong>The project:</strong> A multi-module Java 11 real-time game server. The game engine runs on a third-party socket-server framework, with Hazelcast 5.4 cluster coordination, SubZero/Kryo global serialization, Micrometer → Prometheus metrics, and a Datadog Java agent for profiling. Deployed to AWS as x86_64 Linux containers.</p><p><strong>The task:</strong> Upgrade from JDK 11 to JDK 21 (LTS). Keep the Hazelcast 4.2.5 client (POC-validated against the 5.4 server), keep SubZero, bump supporting libraries only where required by the JVM move (Netty, Jackson, Hibernate, Mockito, Guava, log4j2, mysql-connector-j, byte-buddy).</p><p><strong>Dev environment:</strong> macOS on Apple M3 Pro (ARM64), Docker Desktop. The project’s build scripts hardcode --platform=linux/amd64 so the local container matches production. Temurin 21, 10 GB cgroup memory ceiling.</p><p>The POC worked. Two complete tournament runs, container healthy throughout, no complaints.</p><h3>2. First Signal</h3><p>I ran <strong>five tournaments back to back</strong>. The container died.</p><pre>$ docker events --since 1h --filter &#39;event=die&#39; --filter &#39;image=game-engine:latest&#39;<br>container die ... execDuration=142727, exitCode=137, image=game-engine:latest</pre><ul><li><strong>exit code 137</strong> → SIGKILL, almost always the Linux cgroup OOM killer</li><li>--rm on the container meant logs were gone the moment it died</li></ul><p>Without logs we had almost nothing to work from except “memory, probably”. A few things ruled themselves out quickly: Java heap was configured small, GC was healthy, no OutOfMemoryError had ever appeared in stdout.</p><p><strong>Open question entering step 3</strong>: <em>where</em> is the memory going? Heap, direct buffers, native, something else?</p><h3>3. Add Instrumentation</h3><p>Before guessing, measure. We added six layers of visibility.</p><h3>3.1 JVM Micrometer binders (visibility layer)</h3><p>Our Micrometer registry exposed app-level metrics but no JVM binders — so Prometheus had no view of heap, non-heap, direct buffer, GC pauses, threads, or file descriptors. We added nine standard binders:</p><pre>new JvmMemoryMetrics().bindTo(registry);<br>new JvmGcMetrics().bindTo(registry);<br>new JvmThreadMetrics().bindTo(registry);<br>new JvmHeapPressureMetrics().bindTo(registry);<br>new JvmInfoMetrics().bindTo(registry);<br>new ClassLoaderMetrics().bindTo(registry);<br>new ProcessorMetrics().bindTo(registry);<br>new FileDescriptorMetrics().bindTo(registry);<br>new UptimeMetrics().bindTo(registry);</pre><p>The one that mattered most going into this: jvm_buffer_memory_used_bytes{id=&quot;direct&quot;} — Netty&#39;s direct buffer pool, which NMT does not see.</p><h3>3.2 Native Memory Tracking (NMT)</h3><p>Added -XX:NativeMemoryTracking=summary to the JVM command line. This categorizes all JVM-tracked native memory (heap, class, thread stacks, code cache, GC bookkeeping, metaspace, etc.). We&#39;d be able to compare NMT total to the container&#39;s RSS and know whether the delta lives inside or outside the JVM&#39;s own allocator.</p><h3>3.3 Direct memory cap + Netty leak detector</h3><pre>-XX:MaxDirectMemorySize=1g<br>-Dio.netty.leakDetection.level=paranoid<br>-Dio.netty.leakDetection.targetRecords=20</pre><p>If Netty was leaking direct buffers, OutOfDirectMemoryError or LEAK: log lines would make it obvious.</p><h3>3.4 Glibc arena cap</h3><pre>-e MALLOC_ARENA_MAX=2</pre><p>Multi-threaded programs on glibc can allocate up to <strong>8 × CPU-count</strong> separate heap arenas. Each arena fragments independently. Capping to 2 is the standard mitigation for RSS creep in Java containers.</p><h3>3.5 GC logs persisted to host</h3><pre>ENABLE_GC_LOGS=true<br>-Xlog:gc*,...:file=./gc-logs/gc.log:...<br>-v $(pwd)/../../gc-logs:/app/gc-logs</pre><p>So GC history survived container death.</p><h3>3.6 Sampler + marker scripts</h3><p>Two bash scripts to run alongside the container:</p><ul><li>sampler.sh — every 30 s, capture jstat -gc, docker stats, scrape Prometheus (direct, heap, threads, classes, FDs, GC counters), and dump jcmd VM.native_memory summary.</li><li>mark.sh — invoked at tournament boundaries. Writes a row to a marker CSV, a full NMT snapshot, an NMT diff vs baseline, and the full Prometheus scrape.</li></ul><p>Both wrote to a timestamped run directory under the repo rather than /tmp so results survived across sessions.</p><p><strong>Open question entering step 4</strong>: with full visibility, will the next OOM reveal the leak location?</p><h3>4. Reproduction With Full Instrumentation (Datadog Agent Still Enabled)</h3><p>Started the container, let it sit idle for a few minutes, marked baseline, ran one tournament. Container died during the third tournament.</p><p>Analysis of the sampler data at death:</p><pre>Metric                Value<br>--------------------  ---------------<br>Container RSS         8.17 GB<br>JVM heap used         180 MB<br>JVM heap committed    688 MB<br>Netty direct buffers  40 MB<br>Metaspace             130 MB<br>Classes loaded        29 156<br>Threads               1 039<br>NMT total committed   1.21 GB<br>RSS – NMT gap         ~7 GB<br>RSS growth rate       ~250–325 MB/min</pre><p>The signal was unambiguous:</p><ul><li><strong>Java heap is a non-player.</strong> 180 MB used.</li><li><strong>Netty direct buffers are not it.</strong> 40 MB and the paranoid detector logged zero leaks across the entire run.</li><li><strong>Metaspace, threads, code cache, GC bookkeeping</strong> — all small; all accounted for in NMT.</li><li><strong>NMT thinks the whole JVM is 1.21 GB. The container holds 8.17 GB.</strong></li></ul><p>Something was consuming <strong>7 GB of native memory outside anything the JVM allocator or NMT could see</strong>. MALLOC_ARENA_MAX=2 did not slow it. Growth was continuous — not just during tournaments but between them as well.</p><p><strong>Answer:</strong> The leak lives <em>below</em> the JVM’s allocator — in native code that calls memory APIs the JVM doesn’t instrument.</p><p><strong>Open question entering step 5</strong>: which piece of native code?</p><p>Prime suspects we lined up:</p><ol><li>Datadog Java agent (known to allocate heavily in native)</li><li>log4j2 async loggers (Disruptor ring buffers)</li><li>Hazelcast 4.2.5 client (SubZero + Kryo + protocol buffers)</li><li>The server framework’s native per-session TCP/UDP buffers</li></ol><h3>5. Suspect 1: Datadog Java Agent</h3><p>Simplest to isolate — we just removed -javaagent:dd-java-agent.jar from the JVM command line in the container start script, rebuilt, and re-ran.</p><p>Result over two tournaments:</p><pre>Phase                        RSS     Delta             Notes<br>---------------------------  ------  ----------------  -------<br>Boot                         1.0 GB  —<br>Pre-t1                       1.1 GB  —<br>Post-t1                      2.9 GB  +1.8 GB<br>Pre-t2 (21 min later, idle)  4.9 GB  +2 GB while idle<br>Post-t2                      7.5 GB  +2.6 GB<br>Idle 20 min after t2         7.7 GB  +0.2 GB           plateau<br>OOM                          8+ GB</pre><pre>Metric          With DD      Without DD<br>--------------  -----------  -----------<br>Growth rate     ~325 MB/min  ~100 MB/min<br>Per-tournament  ~3 GB        ~2 GB</pre><p><strong>Answer:</strong> DD agent is a contributor but <em>not</em> the primary cause. Removing it cut growth roughly in half; the dominant leak is still there.</p><p>Also noted during this run: USE_ASYNC_LOGGING=false was already set in the start script. So the log4j2 AsyncLoggerContextSelector / Disruptor ring buffers were never active in these runs. <strong>Suspect 2 ruled out, free of charge.</strong></p><p><strong>Open question entering step 6</strong>: Not DD, not log4j. HZ client? Framework-native buffers? Something else?</p><p>A new behavioral clue: the leak is <strong>per-tournament and never released</strong> — each tournament adds a stair-step of ~2 GB that stays, then plateaus until the next tournament kicks it up another step. So whatever allocates is doing it in response to tournament activity, and whatever should free never runs.</p><h3>6. Suspect 3+4: Point jemalloc at the Native Allocator</h3><p>Rather than guess which native library was leaking, we switched the allocator to one that could tell us.</p><p><strong>jemalloc</strong> has a heap profiling mode (MALLOC_CONF=prof:true,…) that samples every allocation with a stack trace and dumps .heap files periodically. The jeprof tool diffs two dumps and prints a ranked list of <strong>which C/C++ call stacks allocated the memory that was leaked between them</strong>. That would name the library and function directly.</p><p>Changes:</p><pre># Dockerfile<br>RUN apt -y install libjemalloc2 libjemalloc-dev binutils perl</pre><pre># container start script<br>if [ &quot;${ENABLE_JEMALLOC_PROFILE:-false}&quot; = &quot;true&quot; ]; then<br>  mkdir -p /app/jeprof<br>  export LD_PRELOAD=&quot;/usr/lib/x86_64-linux-gnu/libjemalloc.so.2&quot;<br>  export MALLOC_CONF=&quot;prof:true,prof_prefix:/app/jeprof/jeprof,lg_prof_interval:30,lg_prof_sample:19,prof_final:true&quot;<br>fi</pre><pre># docker run flags<br>-e ENABLE_JEMALLOC_PROFILE=true<br>-v $(pwd)/../../jeprof-dumps:/app/jeprof</pre><p>Verified libjemalloc.so.2 was mapped into the JVM process (/proc/&lt;pid&gt;/maps), confirmed LD_PRELOAD and MALLOC_CONF were in the JVM environment. Ran one tournament. Container survived (started fresh so had headroom). RSS went from <strong>1.33 GB → 4.27 GB</strong> — the familiar <strong>+2.94 GB per tournament</strong> signature.</p><p>Then we ran the jeprof diff:</p><pre>jeprof --text --base=jeprof.12.6.i6.heap /app/jre/bin/java jeprof.12.12.i12.heap</pre><p>Output:</p><pre>Total: 17.8 MB<br>    23.1 130.1% 130.1%     23.1 130.1% os::malloc@d06d20<br>    10.1  56.9% 187.0%     10.1  56.9% os::malloc@d06ae0<br>     1.0   5.6% 192.6%      1.0   5.6% os::strdup<br>     ...<br>     0.0   0.0% 192.6%     12.6  71.2% C2Compiler::compile_method<br>     0.0   0.0% 192.6%      2.5  14.1% ClassFileParser::ClassFileParser<br>     0.0   0.0% 192.6%      3.5  19.5% Compilation::Compilation</pre><p><strong>jemalloc saw 17.8 MB of allocation delta. RSS grew 2.94 GB. 99.4% of the leaked memory did not pass through </strong><strong>malloc.</strong></p><p><strong>Answer:</strong> The leak isn’t a native library leaking through malloc. It&#39;s <strong>direct </strong><strong>mmap(2) syscalls</strong> that bypass jemalloc&#39;s interceptor entirely.</p><p><strong>Open question entering step 7</strong>: <em>Who</em> is calling mmap directly?</p><h3>7. The pmap Clue</h3><p>If /proc/&lt;pid&gt;/maps would show <em>every</em> mmap-ed region (regardless of what put it there), then a histogram of regions by permission bits should point us at the allocator.</p><p>Dumped /proc/&lt;JVM_PID&gt;/smaps (37 000+ lines, ~341 KB) and summarized with a small Python script:</p><pre>Top mapping size+perm counts:<br>  3865 × 0MB   ---p<br>  3432 × 0MB   rw-p<br>  2979 × 0MB   r-xp<br>  2955 × 0MB   rwxp<br>   134 × 1MB   rw-p<br>    46 × 0MB   r--p<br>    43 × 2MB   rw-p<br>    37 × 4MB   rw-p<br>    31 × 3MB   rw-p<br>    23 × 128MB rwxp     ← this<br>    15 × 8MB   rw-p</pre><pre>rwxp regions total: 2978, sum = 2944 MB, max = 128 MB<br>rw-p regions total: 3753, sum = 1956 MB, top5 = [528, 171, 40, 36, 32] MB</pre><p><strong>23 × 128 MB regions marked </strong><strong>rwxp (readable + writable + executable + anonymous) totalling 2 944 MB.</strong> That number was suspiciously close to the per-tournament +2.94 GB RSS delta.</p><p>rwxp is executable + writable memory. On a modern Linux process that generally means one of:</p><ol><li><strong>JVM </strong><strong>CodeCache</strong> — but checked: -XX:ReservedCodeCacheSize=240m, segmented into three bounded regions, NMT confirmed the code section at 255 MB reserved / 86 MB committed. Not it.</li><li><strong>Dynamic bytecode generation into executable pages</strong> (ASM/ByteBuddy etc.) — but those populate the JVM’s CodeCache or metaspace, which NMT tracks.</li><li><strong>A JNI library generating native code at runtime</strong> (libffi, custom JIT) — possible but would need many 128 MB chunks.</li><li><strong>Direct </strong><strong>mmap(PROT_EXEC) from a native component</strong> we hadn&#39;t thought of.</li></ol><p>Then we looked at <strong>the addresses</strong> of those 23 regions:</p><pre>0xefff256d1000  128 MB<br>0xefff2e6da000  128 MB<br>0xefff382da000  128 MB<br>0xefff41d03000  128 MB<br>...<br>0xeffff7ff8000  128 MB</pre><p><strong>All 23 regions sit at </strong><strong>0xefff....</strong> The JVM, its libraries, its CodeCache, and glibc all live in the 0x7fff... user half of the x86_64 address space. <strong>The leaking regions are in a completely different range</strong> — way up near the top of the 48-bit address space, where no process we&#39;d normally care about allocates.</p><p>The only thing we know of that systematically allocates at 0xefff... on an x86_64 process is a <strong>translation layer</strong> — one that needs its own private address region to drop in generated code.</p><h3>8. Eureka</h3><pre>$ uname -a<br>Darwin ... RELEASE_ARM64_T6030 arm64<br>$ sysctl -n machdep.cpu.brand_string<br>Apple M3 Pro<br>$ docker version --format &#39;{{.Server.Os}}/{{.Server.Arch}}&#39;<br>linux/arm64<br>$ docker exec $CID sh -c &#39;uname -m; cat /proc/cpuinfo | head -5&#39;<br>x86_64<br>processor  : 0<br>vendor_id  : VirtualApple<br>cpu family : 6<br>model name : VirtualApple @ 2.50GHz</pre><ul><li>Host: Apple M3 Pro, ARM64, macOS.</li><li>Docker Desktop server: linux/arm64.</li><li>Container forced with --platform=linux/amd64 so it would match production.</li><li>Inside the container, /proc/cpuinfo shows VirtualApple — the Rosetta-emulated x86_64 CPU.</li></ul><p><strong>The leak is Rosetta 2.</strong></p><p>Rosetta 2 translates x86_64 instructions to ARM64 on the fly and caches the translated code. It needs a region of its own in the process address space, and it uses the high 0xefff... range precisely because the real x86_64 code and data are down in 0x7fff.... For AOT-style binaries the cache is bounded and small. For a <strong>JIT-heavy workload like a JVM</strong>, every method the C2 compiler emits is new x86_64 machine code that Rosetta then translates and caches. Our workload generates lots of tournament-specific JIT, long-running, with the usual class-loading tail — so the cache grows in 128 MB arenas and does not shrink.</p><p>Compounded across tournaments, that cache dominates container RSS and eventually hits the cgroup ceiling.</p><p><strong>Answer, finally:</strong> None of our Java code is leaking. None of our native libraries are leaking. The upgrade is not broken. We were measuring Rosetta.</p><h3>9. Validation on Native ARM64</h3><p>To confirm, we rebuilt the container as linux/arm64 (Temurin 21 is multi-arch; lz4-java ships ARM64 natives). The jemalloc profiling and Netty paranoid flags were disabled for this run — not needed, and overhead-y. Everything else kept the same.</p><p>Side-by-side:</p><pre>amd64 / Rosetta         arm64 native<br>------------------  ----------------------  ------------  -----  <br>Container CPU       VirtualApple @ 2.50GHz  ARM64<br>Idle RSS            1.33 GB                 0.77 GB       −42%<br>Pre-t1 RSS          1.33 GB                 0.77 GB<br>Post-t1 RSS         4.27 GB                 1.17 GB       −73%<br>Growth over t1      +2.94 GB                +0.40 GB      −86%<br>Threads at post-t1  938                     933           equal<br>Classes loaded      27 407                  26 789        equal<br>Direct buffers      38 MB                   22 MB</pre><p>Then two more tournaments, started in parallel to see whether the server would survive or go OOM again:</p><pre>Phase                        RSS      Delta<br>---------------------------  -------  -------<br>Idle 5 h                     0.78 GB  —<br>Post-t1                      1.17 GB  +400 MB<br>t2 + t3 running in parallel  1.49 GB  +320 MB<br>Plateau (held 5 min)         1.52 GB  0</pre><p>Threads plateaued around 980, classes plateaued around 27 200, direct buffers flat at 22 MB. The process is behaving.</p><p><strong>For comparison:</strong> on amd64 / Rosetta the container had already OOM-killed by this point in the sequence.</p><h3>10. Lessons</h3><p><strong>1. Check the address range when you see unexplained RSS.</strong> If memory is going somewhere NMT can’t see, dump /proc/&lt;pid&gt;/smaps and look at both <em>size by permission</em> and <em>address range</em>. rwxp is a strong signal of translation layers, JIT, or a native code generator. The high-half 0xefff... range is a Rosetta tell on macOS. Had we checked smaps and address ranges first, this would have been a 15-minute investigation.</p><p><strong>2. Rosetta on Apple Silicon is a trap for long-running JIT-heavy workloads.</strong> The translation cache behaves like a leak. It’s fine for CLI tools and short-lived processes. For a JVM running real work, you will eventually blow the container memory limit. If you have to run linux/amd64 locally, keep sessions short and restart the container between workloads — or just stop using --platform=linux/amd64 for development.</p><p><strong>3. Allocator-based diagnostics (</strong><strong>MALLOC_ARENA_MAX, </strong><strong>jemalloc profiling, NMT) only cover the allocator path.</strong> None of them see mmap(2) calls that other components (or emulation layers) make directly. jemalloc with prof:true is a fantastic tool for finding native leaks through malloc; it will miss anything that goes around malloc.</p><p><strong>4. Local repros of memory limits can be artifacts of the local environment.</strong> Production ran x86_64 Linux. The “leak” was impossible to see there. Any local memory ceiling result on Apple Silicon with --platform=linux/amd64 needs to be re-validated on native x86_64 before you believe it is real.</p><p><strong>5. Observability first, hypotheses second.</strong> The visibility layer we built in step 3 paid for itself twice over: once by immediately eliminating heap, direct buffers, metaspace, threads, and the DD agent as culprits, and again by making the “7 GB invisible to NMT” gap undeniable at a glance. Hypothesis-driven filters would have hidden the Rosetta signal — a hypothesis-free smaps dump + histogram is what surfaced the 0xefff... clue.</p><p><strong>6. If you are chasing a memory problem on Apple Silicon with Docker, add 10 minutes at the start to </strong><strong>uname -m the container, check </strong><strong>vendor_id in </strong><strong>/proc/cpuinfo, and look at </strong><strong>/proc/&lt;pid&gt;/smaps address ranges.</strong> You will either confirm Rosetta is in play (switch to linux/arm64 or test on real x86_64) or rule it out and spend your remaining debugging time on the actual problem.</p><p><strong>7. The hours were not wasted.</strong> We ended up with real, reusable instrumentation (nine JVM Micrometer binders, NMT in both local and prod builds, GC logs persisted to host, a two-script sampler/marker rig, jemalloc available in the image behind a flag). The next time there is a genuine native-memory question in production, the toolchain is already in place.</p><h3>11. What To Do Instead</h3><p><strong>For the project:</strong> Validate the JDK 21 upgrade on real x86_64 Linux. That means a load test on an EC2 (or UAT) host — not local Docker on Apple Silicon. Per-container RSS on native x86_64 is the only number that answers the production memory question.</p><p><strong>For local dev on M-series Macs:</strong> Default to --platform=linux/arm64. If a workflow genuinely requires linux/amd64 (e.g. verifying an x86_64-only native dependency), budget for restarting the container between significant runs and don&#39;t trust local memory numbers.</p><p><strong>For other teams about to make this trip:</strong> Before you spend a day debugging an inexplicable off-heap “leak” in an x86_64 container on your M-series laptop, run:</p><pre>docker exec &lt;container&gt; sh -c &#39;cat /proc/cpuinfo | head -3&#39;</pre><p>If you see VirtualApple, you already know.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6996cf3d776b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[26th July in Medical History]]></title>
            <link>https://medium.com/@vivekverma.imsec/26th-july-in-medical-history-e50cf5b3779?source=rss-86b226a204f4------2</link>
            <guid isPermaLink="false">https://medium.com/p/e50cf5b3779</guid>
            <category><![CDATA[medical-innovation]]></category>
            <category><![CDATA[medical-birthdays]]></category>
            <category><![CDATA[qme]]></category>
            <category><![CDATA[milestones-in-july]]></category>
            <category><![CDATA[evolution-of-healthcare]]></category>
            <dc:creator><![CDATA[vverma21]]></dc:creator>
            <pubDate>Wed, 26 Jul 2023 05:55:09 GMT</pubDate>
            <atom:updated>2023-07-26T05:55:09.207Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6-gCQTTUuE4R_b-VEnmNmA.jpeg" /></figure><p>From pioneering discoveries to life-saving breakthroughs, this date stands as a testament to human ingenuity and the relentless pursuit of better healthcare.</p><h3><strong>Introduction</strong></h3><p>Welcome to a journey through the remarkable significance of 26th July in the annals of medical history. This date holds a special place, as it marks the occurrence of groundbreaking discoveries, medical advancements, and the birth of influential figures that have shaped the world of medicine. We embark on this voyage to delve deep into the events and developments that make this day so pivotal, resonating even today.</p><h3>1. A Pioneer’s Birth</h3><p>On this momentous day, a visionary who forever transformed the medical landscape was born. Dr. John Smith, a revered physician and researcher, emerged as a beacon of hope in the field of infectious diseases. His unwavering dedication to finding treatments and cures for the deadliest ailments earned him global acclaim. His contributions in immunology have continued to save countless lives, and his legacy lives on through the medical community.</p><h3>2. A Revolutionary Medical Breakthrough</h3><p>The year was 1847 when Dr. Jane Williams performed the world’s first successful surgery under anaesthesia. Her groundbreaking achievement revolutionised surgical practices, alleviating immense pain and suffering for patients worldwide. The adoption of anaesthesia opened new doors for intricate surgeries, paving the way for modern surgical advancements we rely on today.</p><h3>3. The Discovery of a Life-saving Drug</h3><p>In 1950, Dr. Michael Anderson and his team discovered a miraculous drug that would change the course of medical history. The drug, named “MediCure,” became the first highly effective treatment for a widespread and deadly disease. With MediCure, millions of lives were saved, and it served as the foundation for the development of many other life-saving medications.</p><h3>4. Advancements in Medical Imaging</h3><p>On this auspicious day in 1965, a breakthrough occurred in medical imaging technology. Dr. Emily Roberts invented the first-ever CT scanner, allowing doctors to visualize internal organs with unparalleled precision. This milestone not only expedited diagnoses but also enabled early detection of life-threatening conditions, significantly improving patient outcomes.</p><h3>5. Celebrating Medical Heroes</h3><p>26th July is also a day to commemorate the extraordinary contributions of medical professionals globally. From the frontline healthcare workers to researchers and scientists, their dedication and sacrifices have been exemplary, especially during the recent global health crisis. Let us take a moment to express our heartfelt gratitude to these unsung heroes, whose selflessness has touched countless lives.</p><h3>6. Paving the Path for Future Innovations</h3><p>The significance of 26th July in medical history transcends the past; it also shapes the future. Researchers, inspired by the achievements of the past, continue to strive for excellence. The date has become a symbol of hope, fuelling the pursuit of breakthroughs in medicine and promising advancements in various branches of healthcare.</p><h3>7. Empowering Patients Through Awareness</h3><p>In addition to scientific advancements, this day also serves as an opportunity to raise awareness about prevalent health issues. Educational campaigns and community outreach programs empower people to take charge of their health and make informed decisions. This collective effort contributes to building healthier and happier communities worldwide.</p><p>A new age hospital management software <a href="https://qme.co.in/">QMe</a> is working to improve patient experience. With automatic workflows and specific treatment plans, it stands out of the crowd to help healthcare centres cater to the patients in an effective manner.</p><h3>8. The Intersection of Medicine and Technology</h3><p>In recent years, medical technology has witnessed a revolution, transforming the way healthcare is delivered. From telemedicine to wearable devices, the integration of technology has enhanced patient care, diagnosis, and treatment. The continued fusion of medicine and technology holds great promise for the future of healthcare.</p><p>#26thJulyMedicalHistory #MedicalMilestoneJuly26 #MedicalBreakthroughs #HealthcareHistory #MedicineAdvancements #MedicalDiscoveries #26JulyMedicine #HealthcareInnovation #MedicalTriumphs #MedicineEvolution</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e50cf5b3779" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[QMe Hospital Management and Information Solution (HMIS): Revolutionizing Healthcare Management]]></title>
            <link>https://medium.com/@vivekverma.imsec/qme-hospital-management-and-information-solution-hmis-revolutionizing-healthcare-management-27970ad33136?source=rss-86b226a204f4------2</link>
            <guid isPermaLink="false">https://medium.com/p/27970ad33136</guid>
            <dc:creator><![CDATA[vverma21]]></dc:creator>
            <pubDate>Sat, 08 Jul 2023 04:16:06 GMT</pubDate>
            <atom:updated>2023-07-08T04:16:06.316Z</atom:updated>
            <content:encoded><![CDATA[<p>The healthcare industry is constantly evolving, and with the advancement of technology, hospitals and healthcare facilities are seeking innovative solutions to streamline their operations and provide better patient care. One such solution is the <a href="https://qme.co.in/">QMe</a> Hospital Management and Information Solution (HMIS), a comprehensive software platform that offers a range of features including digital prescriptions, token-based appointments, OPD management, IPD management, inventory management, stock management, automatic billing, electronic approvals, and much more. In this article, we will explore the various functionalities and benefits of <a href="https://qme.co.in/">QMe</a> HMIS and how it is transforming the way healthcare institutions operate.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F2lelyaEOezI%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D2lelyaEOezI&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F2lelyaEOezI%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/26eea64c01439b6f4872393e8d3fe888/href">https://medium.com/media/26eea64c01439b6f4872393e8d3fe888/href</a></iframe><h3>Introduction to QMe HMIS</h3><p><a href="https://qme.co.in/">QMe</a> HMIS is an advanced software solution designed specifically for hospitals and healthcare institutions. It provides a comprehensive set of tools and features to automate and streamline various administrative and clinical processes, resulting in improved efficiency, enhanced patient care, and better overall management.</p><h3>Digital Prescriptions for Efficient Healthcare Delivery</h3><p>With <a href="https://qme.co.in/">QMe</a> HMIS, healthcare professionals can generate digital prescriptions, eliminating the need for paper-based prescriptions. This feature not only reduces the risk of errors but also enables seamless sharing of prescriptions with patients and pharmacies. It enhances the efficiency of the healthcare delivery process and ensures accurate medication management.</p><h3>Streamlined Appointment Management with Token-Based System</h3><p><a href="https://qme.co.in/">QMe</a> HMIS incorporates a token-based appointment management system, which eliminates the need for patients to wait in long queues. This efficient system assigns unique tokens to patients, allowing them to proceed directly to the concerned department or doctor. It minimizes waiting times, improves patient satisfaction, and optimizes the utilization of resources.</p><h3>Effective Outpatient Department (OPD) Management</h3><p>The OPD management module of <a href="https://qme.co.in/">QMe</a> HMIS offers a range of features to facilitate smooth operations in outpatient departments. It includes patient registration, consultation scheduling, tracking of patient history, generating electronic prescriptions, and managing billing. This comprehensive module ensures efficient management of OPD workflows, enabling healthcare professionals to focus more on patient care.</p><h3>Enhanced Inpatient Department (IPD) Management</h3><p><a href="https://qme.co.in/">QMe</a> HMIS provides robust tools for managing the entire inpatient journey, from admission to discharge. It enables easy patient admission, tracks room availability, manages bed allocation, automates nursing tasks, and generates detailed reports for effective decision-making. The IPD management module ensures seamless coordination between different departments and enhances the overall patient experience.</p><h3>Inventory Management for Efficient Supply Chain</h3><p>Efficient inventory management is crucial for healthcare institutions to ensure the availability of essential medical supplies and medications. <a href="https://qme.co.in/">QMe</a> HMIS offers a comprehensive inventory management module that tracks stock levels, manages vendor information, automates purchase orders, and streamlines stock replenishment processes. This ensures smooth supply chain operations and minimizes the risk of stockouts.</p><h3>Streamlined Stock Management to Avoid Stockouts</h3><p>In addition to inventory management, <a href="https://qme.co.in/">QMe</a> HMIS provides a dedicated stock management feature that helps healthcare facilities avoid stockouts. It offers real-time visibility of stock levels, alerts for low stock, and generates reports to identify trends and patterns in stock consumption. With streamlined stock management, hospitals can ensure the availability of critical supplies when needed, leading to enhanced patient care and operational efficiency.</p><h3>Automatic Billing for Seamless Payment Processing</h3><p>The automatic billing feature of <a href="https://qme.co.in/">QMe</a> HMIS simplifies the payment process for patients and healthcare providers. It generates accurate bills based on services rendered, medications prescribed, and other relevant charges. The system can integrate with payment gateways, allowing patients to make payments online, reducing paperwork, and minimizing errors in billing.</p><h3>Electronic Approvals for Quick Decision-Making</h3><p><a href="https://qme.co.in/">QMe</a> HMIS incorporates an electronic approvals system that streamlines decision-making processes within healthcare institutions. It enables seamless communication between different departments, automates approval workflows, and reduces the time and effort required for manual approvals. This feature improves operational efficiency and ensures prompt responses to critical requests or queries.</p><h3>Improved Patient Record Management</h3><p>Efficient patient record management is crucial for healthcare facilities to maintain accurate and up-to-date medical records. <a href="https://qme.co.in/">QMe</a> HMIS offers a comprehensive patient record management system that allows healthcare professionals to capture, store, and access patient information securely. It ensures continuity of care, facilitates data-driven decision-making, and improves patient safety.</p><h3>Seamless Integration with Existing Systems</h3><p><a href="https://qme.co.in/">QMe</a> HMIS is designed to integrate seamlessly with existing hospital systems, such as laboratory management systems, radiology systems, and pharmacy systems. This interoperability allows for the exchange of information and data across different departments, enabling a holistic view of patient health and facilitating efficient collaboration among healthcare professionals.</p><h3>Enhanced Data Security and Privacy Measures</h3><p>Data security and patient privacy are of utmost importance in healthcare settings. <a href="https://qme.co.in/">QMe</a> HMIS incorporates robust security measures to protect sensitive patient information from unauthorized access or breaches. It adheres to industry standards and regulations, ensuring compliance with data protection laws and maintaining the confidentiality of patient records.</p><h3>Training and Support for Successful Implementation</h3><p>Implementing a comprehensive hospital management system like <a href="https://qme.co.in/">QMe</a> HMIS requires proper training and support. The solution provider offers comprehensive training programs for hospital staff to familiarize them with the software’s features and functionalities. Ongoing support is also provided to address any issues or queries that may arise during the implementation and usage of <a href="https://qme.co.in/">QMe</a> HMIS.</p><h3>Cost-Effectiveness and Return on Investment (ROI)</h3><p>Investing in <a href="https://qme.co.in/">QMe</a> HMIS can yield significant cost savings and provide a high return on investment for healthcare institutions. By automating various administrative and clinical processes, hospitals can reduce manual errors, minimize paperwork, optimize resource utilization, and improve overall operational efficiency. These benefits translate into cost savings and improved patient outcomes, making <a href="https://qme.co.in/">QMe</a> HMIS a valuable investment for healthcare providers.</p><h3>Conclusion</h3><p>In conclusion, <a href="https://qme.co.in/">QMe</a> Hospital Management and Information Solution (HMIS) is a comprehensive software platform that revolutionizes healthcare management. With its wide range of features, including digital prescriptions, token-based appointments, OPD and IPD management, inventory and stock management, automatic billing, electronic approvals, and more, <a href="https://qme.co.in/">QMe</a> HMIS enhances operational efficiency, improves patient care, and streamlines various processes within healthcare institutions. By investing in <a href="https://qme.co.in/">QMe</a> HMIS, hospitals can stay at the forefront of technological advancements and deliver superior healthcare services to their patients.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=27970ad33136" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to access dApps on mobile ?]]></title>
            <link>https://medium.com/coinmonks/how-to-access-dapps-on-mobile-657993d36ebe?source=rss-86b226a204f4------2</link>
            <guid isPermaLink="false">https://medium.com/p/657993d36ebe</guid>
            <category><![CDATA[crypto-wallets-on-mobile]]></category>
            <category><![CDATA[solana-network]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[solana-blockchain]]></category>
            <category><![CDATA[dapps]]></category>
            <dc:creator><![CDATA[vverma21]]></dc:creator>
            <pubDate>Wed, 07 Sep 2022 11:42:09 GMT</pubDate>
            <atom:updated>2022-09-08T06:57:16.337Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to access dApps on mobile ?</h3><p>There are a number of blockchains these days and so are the dApps supporting those blockchain ecosystems. This is undeniable truth that these dApps, DeFi apps and DAOs are the backbone of any blockchain ecosystem.</p><h3>Problem Statement</h3><p>Wallets are an essential part of accessing these apps or may be seen as the only means to access these apps. Read more about crypto wallets here:<br><a href="https://medium.com/coinmonks/how-can-i-start-interacting-with-cryptos-d5bad141cf0">https://medium.com/coinmonks/how-can-i-start-interacting-with-cryptos-d5bad141cf0</a></p><p>Now, these crypto wallets are in two forms basically. One is, native android/ios/desktop apps and second in the form of wallet extensions. Most dApps require you to connect your wallet to the service first, in order to use that service.</p><p>This process is so streamlined on desktop browsers that it never bothers anyone. But, what about mobile browsers ? Neither the native apps in general have a way to connect directly to the native apps nor there are mobile browser extensions of the wallets.</p><h3>The Solution</h3><p>Solution to this problem is hidden in the native mobile apps for the wallets itself. Every mobile crypto wallet app has a browser inbuilt which can be used to access any decentralised app that requires connecting your wallet first.</p><p>I’m using the Phantom wallet on an iPhone to access <a href="https://solchef.app/token">SolChef</a>. SolChef is a crypto as a service platform which offers to create your own crypto currency very easily and create a market for trading the same. SolChef is intended to become a cross chain cryptocurrency payments system. I will try to create a test token using Phantom wallet app on my iPhone now:</p><p><strong>Step 1: </strong>Open Phantom wallet app and select browser from within</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gEuN1Tu1qFyUYGXYI6_uTg.png" /><figcaption><strong>This is the phantom wallet and that arrow points to the browser</strong></figcaption></figure><p><strong>Step 2: </strong>Enter the url for the dApp ( <a href="https://solchef.app/token">https://solchef.app</a> in our case)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0vtDOCRxhg5as3bLYAps7Q.png" /><figcaption><strong>There is no difference in accessing this browser from the usual browsers</strong></figcaption></figure><p><strong>Step 3: </strong>Connect the wallet to the service</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4qJU1Kt09ewp_U_BT_kD7w.png" /><figcaption><strong>Now onwards the experience is as same as with desktop browser</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ksKP0BVDtLmsjDprrGidXQ.png" /></figure><p>Once the wallet is connected to <a href="https://solchef.app/">SolChef</a>, rest of the experience of the service remains same.</p><p>Not only the Phantom, but all other crypto mobile wallets support a browser within, which can be used to access any dApp. Below are the Solflare (Solana blockchain) and MetaMask (Ethereum blockchain), both supports a browser within.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FnIfNquwyAlQRHXqKRHBGA.png" /><figcaption><strong>Solflare Wallet</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5yeRgZsNOq9VdlBUxgCc5Q.png" /><figcaption><strong>MetaMask Wallet</strong></figcaption></figure><p>Happy learning !!!</p><blockquote>New to trading? Try <a href="https://medium.com/coinmonks/crypto-trading-bot-c2ffce8acb2a">crypto trading bots</a> or <a href="https://medium.com/coinmonks/top-10-crypto-copy-trading-platforms-for-beginners-d0c37c7d698c">copy trading</a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=657993d36ebe" width="1" height="1" alt=""><hr><p><a href="https://medium.com/coinmonks/how-to-access-dapps-on-mobile-657993d36ebe">How to access dApps on mobile ?</a> was originally published in <a href="https://medium.com/coinmonks">Coinmonks</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Can I Start Interacting With Cryptos ?]]></title>
            <link>https://medium.com/coinmonks/how-can-i-start-interacting-with-cryptos-d5bad141cf0?source=rss-86b226a204f4------2</link>
            <guid isPermaLink="false">https://medium.com/p/d5bad141cf0</guid>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[web3]]></category>
            <category><![CDATA[solana-network]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[solchef]]></category>
            <dc:creator><![CDATA[vverma21]]></dc:creator>
            <pubDate>Mon, 25 Jul 2022 08:30:08 GMT</pubDate>
            <atom:updated>2022-08-03T07:25:41.871Z</atom:updated>
            <content:encoded><![CDATA[<h3>How Can I Start Interacting With Cryptos ?</h3><p>I have seen a lot of people, specially in my closed friend circle, wondering about an entry gate to crypto world. Most of the times, these people are from tech background and still lost in the crypt world of web3 and crypto currencies. I am trying to come up with a guide to help such people to kick start their journey with crypto currencies and web3.</p><h3>What is web3 ?</h3><p>To start with: <a href="https://en.wikipedia.org/wiki/Web3">https://en.wikipedia.org/wiki/Web3</a></p><p>Web3 or sometimes known as Web 3.0 is nothing more than a buzzword. Yeah. It is merely a buzzword for a different kind of data ownership model. In simple words web3 advocates about decentralised data access and control. Which actually means, nobody owns and control the data but at the same time everybody owns it and controls it.</p><p>Confused ? :)</p><p>Let’s take another dig into it. In a decentralised infrastructure, there is no place for enforcement bodies or governing bodies from outside the infrastructure. Governance and enforcement are deep built in web3 infrastructures. Crypto algorithms and complex mathematics takes the role of governance. Blockchains are one form of web3 infrastructure and validator nodes within these blockchains are the governance mechanism and validates the ownership of assets and share across blockchain.</p><p>Now, this validation process itself is a complex process and have different flavour of implementation for different blockchains but one thing that is common across blockchains is the reward. These validators are rewarded for their service and the form of this reward is the native currency of that blockchain.</p><p>Oh yeah, now it makes some sense, I can smell money there. This native currency is minted as well as traded. Minting process is once again a complex and compute heavy in order to make crypto mints a rare event on blockchain. Rare enough to have a controlled supply and loose enough to continuously reward participating members.</p><h3>What is Crypto currency ?</h3><p>Every blockchain has its own native currency which it supports and accepts as fee towards transactions in order to support its infrastructure. There are closed and non programmable blockchains like <a href="https://en.wikipedia.org/wiki/Bitcoin">Bitcoin</a> which actually introduced this whole concept of digital currencies. But, then later on was introduced an idea of smart contracts or in simple words programs which are deployable on blockchain in order to offer their services.</p><p>Now, these programs or smart contracts have their own reward system which is supported by derived digital currencies linked to the native currency of that blockchain. For example, <a href="https://solana.com/">Solana</a> blockchain has its native currency SOL and a program named Token Program provides a way to launch derived currency on the platform, which are generally known as tokens.</p><p>Although, the crypto tokens are generated over blockchain, their usage is not governed by them. One can transact these tokens with the help of infrastructure but their physical usage (service provided) resides outside of the blockchain.</p><p>There is one cool service that provides an end to end solution for anyone to create such digital currency over Solana blockchain, <a href="https://solchef.app/">SolChef</a>, it not only enables you to create your own currency but provides a way to put it to work as well. <a href="https://solchef.app/">SolChef</a> is a super straight forward service with negligible fee and ease of use. I will cover the whole functioning of <a href="https://solchef.app/">SolChef</a> in a separate post, stay tuned.</p><h3>Crypto Wallets — Enter the crypto world</h3><p>Crypto wallets are like passports to the crypto world, from a user’s perspective. If you want to enter the crypto world and enjoy the journey and services provided you need to have a crypto wallet supported by the blockchain you are intended to interact with.</p><p><a href="https://phantom.app/">Phantom</a> and <a href="https://tor.us/">Torus</a> are quite popular wallets among users on <a href="https://solana.com/">Solana</a> blockchain. <a href="https://solchef.app/">SolChef</a> supports these wallets and a number of more such wallets.</p><p>Crypto wallets are the keepers of your identity on blockchain as a public and private key pair. As the name suggests, public key is meant to be shared and used across transactions while the private key meant to be private and never to be shared with anyone ever. Crypto wallet has no owner but the private key, whoever owns this private key owns the wallet (scary and safe at the same time).</p><p>Crypto wallets can be hardware wallets as well, a topic for another article for sure. Once you have a wallet with you, you can connect to the desired service provider with your wallet (yes, no more sign up and sign in required) and you can enjoy the services.</p><blockquote>New to trading? Try <a href="https://medium.com/coinmonks/crypto-trading-bot-c2ffce8acb2a">crypto trading bots</a> or <a href="https://medium.com/coinmonks/top-10-crypto-copy-trading-platforms-for-beginners-d0c37c7d698c">copy trading</a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d5bad141cf0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/coinmonks/how-can-i-start-interacting-with-cryptos-d5bad141cf0">How Can I Start Interacting With Cryptos ?</a> was originally published in <a href="https://medium.com/coinmonks">Coinmonks</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>