is there a way to disable StringInterner?

37 views
Skip to first unread message

Randy Prager

unread,
Apr 21, 2015, 12:17:50 PM4/21/15
to java-ch...@googlegroups.com
For debug logging we are using the toString() method on generated VOInterface objects but running into OOM errors.  Is there a way StringInterner can be surpressed?

java.lang.OutOfMemoryError: Java heap space
        at net.openhft.lang.pool.StringInterner.<init>(StringInterner.java:34)
        at net.openhft.lang.io.AbstractBytes.stringInterner(AbstractBytes.java:434)
        at net.openhft.lang.io.AbstractBytes.readUTFΔ(AbstractBytes.java:560)
        at net.openhft.lang.io.AbstractBytes.readUTFΔ(AbstractBytes.java:572)
        at net.openhft.lang.values.StringValue$$Native.getValue(StringValue$$Native.java:26)
        at net.openhft.lang.values.StringValue$$Native.toString(StringValue$$Native.java:93)
        at java.lang.String.valueOf(String.java:2981)
        at java.lang.StringBuilder.append(StringBuilder.java:131)
        at ...$$Native.toString(MyObjectVOInterface$$Native.java:484)

Peter Lawrey

unread,
Apr 21, 2015, 1:33:06 PM4/21/15
to java-ch...@googlegroups.com
The assumption is there should only be a small number of Bytes objects and thus a small number of StringInterner.  If this is using a lot of memory, I suspect you are doing something else unexpected.  We can change the code so it shouldn't matter as much if you have created a lot of Bytes objects.  We could also add a flag to disable the use of the StringInterner but I would make sure the rest of the code is efficient first.  Each Bytes object has a non-trivial overhead off heap, so you are better off creating a small number of these are reusing them.

--
You received this message because you are subscribed to the Google Groups "Chronicle" group.
To unsubscribe from this group and stop receiving emails from it, send an email to java-chronicl...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages