From 0d56f70ae7def5b8ff9e3aef14cfa7dff01a71ac Mon Sep 17 00:00:00 2001 From: Benjamin Lerer Date: Thu, 17 Dec 2020 11:24:46 +0100 Subject: [PATCH] Remove use of String.intern() patch by Benjamin Lerer; reviewed by Brandon Williams for CASSANDRA-15810 --- CHANGES.txt | 1 + conf/jvm-server.options | 3 --- src/java/org/apache/cassandra/gms/VersionedValue.java | 6 +----- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index e8f89c4152..93d9d4ea12 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,5 @@ 4.0-beta4 + * Remove use of String.intern() (CASSANDRA-15810) * Fix the missing bb position in ByteBufferAccessor.getUnsignedShort (CASSANDRA-16249) * Make sure OOM errors are rethrown on truncation failure (CASSANDRA-16254) * Send back client warnings when creating too many tables/keyspaces (CASSANDRA-16309) diff --git a/conf/jvm-server.options b/conf/jvm-server.options index c52e19236d..46967f4ad7 100644 --- a/conf/jvm-server.options +++ b/conf/jvm-server.options @@ -103,9 +103,6 @@ # Per-thread stack size. -Xss256k -# Larger interned string table, for gossip's benefit (CASSANDRA-6410) --XX:StringTableSize=1000003 - # Make sure all memory is faulted and zeroed on startup. # This helps prevent soft faults in containers and makes # transparent hugepage allocation more effective. diff --git a/src/java/org/apache/cassandra/gms/VersionedValue.java b/src/java/org/apache/cassandra/gms/VersionedValue.java index 3dc4c572bb..7c545598bf 100644 --- a/src/java/org/apache/cassandra/gms/VersionedValue.java +++ b/src/java/org/apache/cassandra/gms/VersionedValue.java @@ -87,11 +87,7 @@ public class VersionedValue implements Comparable private VersionedValue(String value, int version) { assert value != null; - // blindly interning everything is somewhat suboptimal -- lots of VersionedValues are unique -- - // but harmless, and interning the non-unique ones saves significant memory. (Unfortunately, - // we don't really have enough information here in VersionedValue to tell the probably-unique - // values apart.) See CASSANDRA-6410. - this.value = value.intern(); + this.value = value; this.version = version; }