Tag

String.intern

1 views collected around this technical thread.

Selected Java Interview Questions
Selected Java Interview Questions
Jul 2, 2022 · Backend Development

Understanding Java String Constant Pool and the Behavior of String.intern() Across JDK Versions

This article explains the Java constant pool concept, details how the String constant pool works in different JDK versions, demonstrates the effects of String.intern() with code examples, and discusses practical applications and pitfalls of using intern for memory optimization and synchronization.

Constant PoolMemory OptimizationString.intern
0 likes · 16 min read
Understanding Java String Constant Pool and the Behavior of String.intern() Across JDK Versions
Qunar Tech Salon
Qunar Tech Salon
Nov 21, 2016 · Fundamentals

Why YGC Slows Down: The Impact of String.intern and StringTable on Young Generation GC

This article explains how excessive use of String.intern can enlarge the JVM's StringTable, causing the Young Generation Garbage Collection (YGC) to take longer, and provides a demo, code analysis, and practical tips for diagnosing and mitigating the slowdown.

Garbage CollectionString.internYGC
0 likes · 9 min read
Why YGC Slows Down: The Impact of String.intern and StringTable on Young Generation GC
Qunar Tech Salon
Qunar Tech Salon
Jul 21, 2015 · Fundamentals

The Dangers of Using String.intern() in Java: Debunking Common Myths

This article explains why using Java's String.intern() can be hazardous by disproving three popular myths about its performance benefits, memory savings, and lifetime, and offers guidance on when (if ever) the method should be applied.

String.internjavajvm
0 likes · 5 min read
The Dangers of Using String.intern() in Java: Debunking Common Myths