Affects Version/s: 1.3.1
Fix Version/s: 1.4
JDK version and platform:Sun 1.6.0_14 64bit for Linux
com.thoughtworks.xstream.io.xml.XmlFriendlyReplacer makes use of 2 WeakHashmaps to hold string.
Those maps are accessed multi-threaded, but are not synchronized.
This can lead to access on those maps occupying all CPU-resources, which can only get solved by restarting the VM.
This happens under rare heavily multi-threaded circumstances, nevertheless the impact is critical. Testsystem: 8 * Intel(R) Xeon(R) CPU E5345 @ 2.33GHz, 32GB RAM, FS on SAN
See attached stacktrace, with lots of threads bein in
and occupying the CPU.
Also see Scott.Stark's comment in http://www.jboss.org/index.html?module=bb&op=viewtopic&t=85301 for the same problem.
Suggested solution: Use synchronized WeakHashmap, see attached patch. (To check: performance impact? If yes, a non-synchronized, but thread-safe implementation would be suitable like ConcurrentSkipListMap).