Tag

intern

0 views collected around this technical thread.

IT Services Circle
IT Services Circle
May 3, 2024 · Fundamentals

Deep Dive into Java String: Memory Layout, Immutability, and Optimization Techniques

This article explores Java String internals across JDK versions, explaining its memory representation, immutability, substring behavior, and how techniques like StringBuilder, intern(), and shared objects can dramatically reduce memory usage from gigabytes to megabytes in high‑scale applications.

JavaMemory OptimizationPerformance
0 likes · 13 min read
Deep Dive into Java String: Memory Layout, Immutability, and Optimization Techniques
Selected Java Interview Questions
Selected Java Interview Questions
Mar 27, 2021 · Fundamentals

Understanding Java String.intern() Behavior and Memory Address Comparisons

This article explains why the results of comparing strings with the == operator differ when using String.intern() in Java, illustrating the behavior with code examples, bytecode analysis, and JVM constant pool details to clarify true versus false outcomes.

JVMJavabytecode
0 likes · 13 min read
Understanding Java String.intern() Behavior and Memory Address Comparisons
Full-Stack Internet Architecture
Full-Stack Internet Architecture
May 2, 2020 · Fundamentals

Optimizing Java String Usage: Avoid +=, Use StringBuilder, and Leverage intern()

This article analyzes the immutable nature of Java's String class, explains why direct concatenation with "+=" is inefficient, and demonstrates three optimization techniques—using StringBuilder, applying String.intern(), and careful use of Split—to dramatically improve performance and reduce memory consumption.

JavaOptimizationPerformance
0 likes · 14 min read
Optimizing Java String Usage: Avoid +=, Use StringBuilder, and Leverage intern()
Full-Stack Internet Architecture
Full-Stack Internet Architecture
Oct 16, 2019 · Fundamentals

Understanding Java String Pool, intern() Method, and Comparison Techniques

This article explains how Java's String class encapsulates character arrays, the role of the string pool, the effects of the new operator, the intern() method, and the proper use of == versus equals() for reliable string comparison and memory optimization.

JavaMemory ManagementObject Comparison
0 likes · 8 min read
Understanding Java String Pool, intern() Method, and Comparison Techniques