proomt

Search

Search posts, papers, and topics

All posts

CodeName OneShai Almog7 min readintermediate

What Go Taught Us About Java Garbage Collection

Summary

ParparVM’s GC was tuned by lowering the allocation‑trigger floor, adding configurable thresholds, parallel marking, mutator assistance, and proper weak/soft reference handling. These changes cut RSS from 98 MB to 38 MB, reduced worst‑case GC pauses from seconds to sub‑second, and improved cache hit rates with a recency‑based eviction policy.

  • Lowering the GC trigger floor (from 24 MiB to as low as needed) dramatically reduces resident memory without hurting throughput.
  • Parallel marking (four markers) cuts long GC pauses from >2 s to <1 s, still far from Go’s ~20 ms but a clear target.
  • Mutator‑assisted marking lets allocating threads help the collector, avoiding idle stalls.
  • Implementing true weak, soft, and strong reference semantics enables a ranked‑retention cache that outperforms bulk‑flush approaches.

For AOT Java runtimes (and any closed‑world VM), GC pause latency and memory footprint directly affect UI responsiveness on mobile devices. ParparVM’s experiments show concrete knobs—trigger floor, parallelism, and reference policies—that can be tuned without changing Java code, offering a path to…

7/10

Related reading

  1. Size-Specialized Memory Allocation

    Go 1.27 adds a set of span‑class‑specific malloc functions for allocations ≤ 80 bytes. By generating a tiny, constant‑size allocator per span class the runtime can inline size‑dependent work (e.g. zero‑clear) and skip span‑class lookup, yielding 20‑30 % faster small allocations and ~1 % overall speed‑up for allocation‑heavy programs. The implementation is generated automatically via an AST inline…

    The Go Bloggo.dev7 minHN315
  2. Faster Maps: Chasing Swiss Speed

    ParparVM’s HashMap suffered catastrophic miss latency due to linear probing on dense integer keys. By adopting CPython‑style perturbed probing (Swiss‑table style) and extending tagged immediate values to more primitives, miss latency dropped from 32 s to ~45 ms, allocation pressure fell dramatically, and overall performance stayed roughly flat despite a modest hit‑time slowdown.

    CodeName Onecodenameone.com8 min
  3. Lies, Damn Lies and Benchmarks

    Codename One engineers dissect why benchmark numbers can be misleading, then share concrete work on GC tuning, proper weak/soft references, and a new probing sequence for their open‑addressed HashMap that cuts miss‑probe counts from >16 k to ~1.5 per lookup.

    CodeName Onecodenameone.com20 min
  4. We Didn't Want to Build Another Java Server

    Codename One introduced an experimental native Java backend that compiles Java controllers to a tiny native executable via ParparVM. Benchmarks show sub‑millisecond startup, 10‑40 MiB memory, and up to 20 % higher request throughput than a Go fasthttp server.

    CodeName Onecodenameone.com15 min
  5. 1 points

    Saving another 100TB of RAM with math (and Rust)

    Cloudflare reduced the memory footprint of its Pingora Backend Router by re‑examining the consistent‑hashing implementation in the pingora‑ketama library. By increasing the number of virtual hash points per server from the default 1 to the standard 160 (and applying weighted hashing based on disk capacity), they cut the per‑node overhead enough to reclaim >100 TB of RAM across the fleet. The post…

    Hacker News front pagecloudflare.com13 minHN478120lobste.rs33