You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by bl...@apache.org on 2020/12/17 17:02:21 UTC

[cassandra] branch trunk updated: Remove use of String.intern()

This is an automated email from the ASF dual-hosted git repository.

blerer pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 0d56f70  Remove use of String.intern()
0d56f70 is described below

commit 0d56f70ae7def5b8ff9e3aef14cfa7dff01a71ac
Author: Benjamin Lerer <b....@gmail.com>
AuthorDate: Thu Dec 17 11:24:46 2020 +0100

    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 e8f89c4..93d9d4e 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 c52e192..46967f4 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 3dc4c57..7c54559 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<VersionedValue>
     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;
     }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org