Top all-time · #3572
Per Liden
Personal blog · malloc.seprogrammingsystems
Per Liden's personal blog at malloc.se covers programming and systems. Since 2020, 21 different Hacker News readers have linked it 26 times, most often “ZGC – What's new in JDK 16”. The last post was in 2022, but the archive is still widely read.
A blog about OpenJDK, HotSpot and garbage collection.
Most-linked posts?
- ZGC – What's new in JDK 1613 people · 14 mentions · first linked 2021-03-22
- ZGC Using -XX:SoftMaxHeapSize5 people · 5 mentions · first linked 2020-07-03
- ZGC – What's new in JDK 182 people · 2 mentions · first linked 2022-04-29
What Hacker News says?
Hotspot has sub-millisecond GC pause times. "But as long as your system isn’t heavily over-provisioned, you can expect to see average GC pause times of around 0.05ms (50µs) and max pause times of around 0.5ms (500µs)." https://malloc.se/blog/zgc-jdk16
Comment linking /blog/zgc-jdk16
on “Google’s copying of the Java SE API was fair use [pdf]”Submitted ZGC – What's new in JDK 16 as a story · 195 points
HN discussionYou're mixing two things here: memory management and memory layout. This "pointer-heavy programming" is, indeed, a bad fit for modern hardware in terms of processing speed due to cache misses, which is why even Java is now getting user-defined primitive types (aka inline types, aka value types), but in terms of memory management, in recent versions OpenJDK is pretty spectacular, not only in throughput but also laten…
Comment linking /blog/zgc-jdk16
on “Julia 1.6 Highlights”Submitted ZGC – What's new in JDK 16 as a story · 9 points
HN discussionC# has added a lot of control over memory layout. Span [0], structs etc. I am hoping they add more D like features (@nogc) to the language. Java itself has just made strides on reducing GC pause times [1]. Granted, this isn't optional GC, but does D really give you that? Don't you lose the entire ecosystem and stdlib with -asBetterC? Why would I choose that over rust/zig/c++? FWIW, I am a big fan of D. [0] https://d…
Comment linking /blog/zgc-jdk16
on “Driving with D”Submitted ZGC now has 0.5ms of worst case pause time as a story · 5 points
HN discussion> - no global gc pauses, low-latency ZGC has sub-millisecond pauses https://malloc.se/blog/zgc-jdk16 And afaik azul's C4 collector has no global pauses, only per-thread pauses (which are also short)
Comment linking /blog/zgc-jdk16
on “Don’t call it a comeback: Java is still champ”Submitted ZGC – What's new in JDK 15 as a story · 3 points
HN discussionLow pause collectors exist explicitly for this purpose. ZGC and Shenandoah both trade throughput (more concurrent collections) for extremely low pause times: https://malloc.se/blog/zgc-jdk16
Comment linking /blog/zgc-jdk16
on “Don’t call it a comeback: Java is still champ”Submitted ZGC – What's new in JDK 18 as a story · 2 points
HN discussion>I didn't find any other measurements on the internet, please point me to them if you find them. It has been years since I have written thousands sockets servers (used in forex), yet even a couple milliseconds per write would have made the entire operation useless. >another explanation could be false sharing effects that I didn't know well at the time. False sharing sucks, of course, but milliseconds seems way way t…
Comment linking /blog/zgc-jdk16
on “Carp – A statically typed Lisp, without a GC, for real-time applications”Submitted ZGC – What's new in JDK 14 as a story · 2 points
HN discussionThere is a worst case that is much worse then the now mentioned 1ms. Namely really big change in allocation rate in which case the gc cycle does not finish before running out of memory (ZGC uses allocation rate to determine when to start next gc cycle). In that case ZGC stops allocations ("Allocation Stall" in gc logs). But this is basically a failure mode and should not happen during normal operations at all. Thoug…
Comment linking /blog/zgc-softmaxheapsize
on “ZGC – What's new in JDK 16”Submitted ZGC – What's new in JDK 18 as a story · 1 points
HN discussionZGC in its current form trades a bit of throughput performance for better latency. This presentation provides some more details and some performance numbers (a link to the slides is also available there). https://malloc.se/blog/zgc-oracle-developer-live-2020
Comment linking /blog/zgc-oracle-developer-live-2020
on “ZGC – What's new in JDK 16”Submitted ZGC – Using -XX:SoftMaxHeapSize as a story · 1 points
HN discussionTry ZGC, sub 1ms pauses https://malloc.se/blog/zgc-jdk16
Comment linking /blog/zgc-jdk16
on “.NET 6 Preview 5”Submitted ZGC Using -XX:SoftMaxHeapSize as a story · 1 points
HN discussion> How do you find a reasonably small Xmx that doesn't lead to OutOfMemoryError exceptions? That's tough to figure out. In new versions of Java, I think 14+, if you use ZGC collector it will return unused memory to the OS. Memory options vary depending on collector, but new versions of ZGC support "soft max" heap size and uncommit. Together it might be close to what you're looking for https://malloc.se/blog/zgc-softm…
Comment linking /blog/zgc-softmaxheapsize
on “Java Turns 25 – Whats Next? [pdf]”The way RAM is managed in Java and in C is very different; neither is better than the other, but it's different, and you don't seem to understand the Java model. In that model, you give an application a maximum heap, which the program will use regardless of the minimum it needs to improve its performance. You want it to use less RAM? Just tell it to. Having said that, very recently Java has started to return RAM to…
Comment linking /blog/zgc-softmaxheapsize
on “Sub-10 ms Latency in Java: Concurrent GC with Green Threads”Max pause times of 0.5ms is what got me really interested. It feels like a huge trade-off of GCs is almost completely gone. https://malloc.se/blog/zgc-jdk16
Comment linking /blog/zgc-jdk16
on “Go does not need a Java-style GC”Enjoy, https://malloc.se/blog/zgc-jdk16 I guess Oracle, IBM, Azul, PTC, Microsoft can provide the necessary data about their pauseless GC implementantions to any relevant customer.
Comment linking /blog/zgc-jdk16
on “How to write slow Rust code”You're right; Java has ZGC, a best-in-class garbage collector with average pause times of 50 microseconds while still having great throughput. https://malloc.se/blog/zgc-jdk16#:~:text=With%20concurrent%2...
Comment linking /blog/zgc-jdk16
on “Thoughts on C# and .NET”From what I understand Python uses reference counting, which is a type of garbage collection that allows you to have deterministic performance, almost no "pauses" but at the cost of performance. About the consistency, I think that's not a GC problem in general. For example, Java's ZGC has constant pause times: https://malloc.se/blog/zgc-jdk16 .
Comment linking /blog/zgc-jdk16
on “Ask HN: Is Learning Rust a Must?”The HotSpot JVM does return memory to the operating system. https://stackoverflow.com/a/30464183/839689 , https://www.stefankrause.net/wp/?p=14 , https://shipilev.net/jvm/anatomy-quarks/21-heap-uncommit/ , https://openjdk.org/jeps/346 , https://openjdk.org/jeps/351 , https://malloc.se/blog/zgc-jdk15#incremental-uncommit
Comment linking /blog/zgc-jdk15
on “JDK 20 and JDK 21: What We Know So Far”ZGC (JVM) now has guaranteed maximum pause times of 500 microseconds, with average pause times of just 50 microseconds: https://malloc.se/blog/zgc-jdk16 Pause time is not the same as cycle time, but it’s what’s important for reactivity.
Comment linking /blog/zgc-jdk16
on “Blitsort: An ultra-fast in-place stable hybrid merge/quick sort”