Anonymous | Login | Signup for a new account | 09-07-2024 16:17 PDT |
Main | My View | View Issues | Change Log | Docs |
Viewing Issue Simple Details [ Jump to Notes ] | [ View Advanced ] [ Issue History ] [ Print ] | ||||||||
ID | Category | Severity | Reproducibility | Date Submitted | Last Update | ||||
0001588 | [Resin] | minor | sometimes | 01-26-07 04:15 | 04-06-07 15:16 | ||||
Reporter | bjornm | View Status | public | ||||||
Assigned To | ferg | ||||||||
Priority | normal | Resolution | fixed | ||||||
Status | closed | Product Version | 3.0.20 | ||||||
Summary | 0001588: Hessian SerializerFactory HashMaps involved in 100% CPU infinite loop? | ||||||||
Description |
During load tests to HessianServlets, we've sometimes experienced that the jvm would hang with 100% cpu. Thread dumps showed many threads were busy in HashMap.get: "http-0.0.0.0-8080-8" daemon prio=1 tid=0x465bfbd8 nid=0x64e2 runnable [0x3f371000..0x3f3721b0] at java.util.HashMap.get(HashMap.java:346) at com.caucho.hessian.io.SerializerFactory.getSerializer(SerializerFactory.java) at com.caucho.hessian.io.HessianOutput.writeObject(HessianOutput.java:315) at com.caucho.hessian.io.JavaSerializer$FieldSerializer.serialize(JavaSerializer.java:242) at com.caucho.hessian.io.JavaSerializer.writeObject10(JavaSerializer.java:175) at com.caucho.hessian.io.JavaSerializer.writeObject(JavaSerializer.java:157) at com.caucho.hessian.io.HessianOutput.writeObject(HessianOutput.java:317) at com.caucho.hessian.server.HessianSkeleton.invoke(HessianSkeleton.java:172) at com.caucho.hessian.server.HessianServlet.service(HessianServlet.java:365) A look at SerializerFactory shows it uses a set of hashmaps which are not synchronized: private HashMap _cachedSerializerMap; private HashMap _cachedDeserializerMap; private HashMap _cachedTypeDeserializerMap; My guess is that if a HessianServlet receives many simultaneous calls during startup (when the maps are empty), concurrent read and write to the _cachedSerializerMap could cause this behavior. If this is the case, I suggest wrapping them in synchronizers: _cachedDeserializerMap = Collections.synchronizedMap(new HashMap(8)); I have however been unable to reproduce this in some simple tests. Maybe someone who is more familiar with the code could advise. |
||||||||
Additional Information |
About infinite loops in unsynchronized HashMaps: http://blogs.opensymphony.com/plightbo/2005/07/hashmapget_can_cause_an_infini.html [^] |
||||||||
Attached Files | |||||||||
|
There are no notes attached to this issue. |
Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
27 total queries executed. 25 unique queries executed. |