Package hudson.util
Class HeapSpaceStringConverter
- java.lang.Object
-
- com.thoughtworks.xstream.converters.basic.AbstractSingleValueConverter
-
- hudson.util.HeapSpaceStringConverter
-
- All Implemented Interfaces:
com.thoughtworks.xstream.converters.ConverterMatcher
,com.thoughtworks.xstream.converters.SingleValueConverter
public class HeapSpaceStringConverter extends com.thoughtworks.xstream.converters.basic.AbstractSingleValueConverter
Up to XStream 1.3 the defaultStringConverter
in XStream usedString.intern()
, which stressed the (rather limited) PermGen space with a large XML file. Since XStream 1.3 it use a WeakHashMap cache to always use the same String instances, but this has also major problems with a single long living XStream instance (as we have in Jenkins) See XSTR-604.Use this to avoid that (instead those strings will now be allocated to the heap space.)
- Author:
- Kohsuke Kawaguchi
-
-
Constructor Summary
Constructors Constructor Description HeapSpaceStringConverter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canConvert(Class type)
Object
fromString(String str)
-
-
-
Method Detail
-
canConvert
public boolean canConvert(Class type)
- Specified by:
canConvert
in interfacecom.thoughtworks.xstream.converters.ConverterMatcher
- Specified by:
canConvert
in classcom.thoughtworks.xstream.converters.basic.AbstractSingleValueConverter
-
-