News for hackers. Stuff that matters.
Re:Dissecting the CPU-Memory Relationship in Garbage Collect... by yunnpp on Wednesday February 25, 2026 @09:22PM (#47161001)
Hey, noob question, but does OpenJDK look at variable scope and avoid allocating on the heap to begin with if a variable is known to not escape the function's stack frame?

Not strictly related to this post, but I figured it'd be helpful to get an authoritative answer from you on this.

Re:Dissecting the CPU-Memory Relationship in Garbage Collect... by pgrulich on Thursday February 26, 2026 @01:16AM (#47162518)
Yes, Hotspot performs Escape Analysis to avoid heap allocation. This is a nice article: https://shipilev.net/jvm/anatomy-quarks/18-scalar-replacemen...