Mantis - Resin
Viewing Issue Advanced Details
3226 minor sometimes 01-07-09 02:27 01-29-09 14:55
lookis  
ferg  
normal  
closed 3.0.21  
fixed  
none    
none 4.0.0  
0003226: There are two "synchronized lock"s in the frequence operation,this cause slow
HttpServletRequest request;

i post a data to an action,in my action code,when I first running request.getParameter("");it will initial the "_filledForm" in the AbstractHttpRequest.java with "private HashMapImpl<String,String[]> parseQuery()"

and i found when i running here "_formParser.parsePostData(_form, getInputStream(), javaEncoding);"

finally the code will be here

  public static String getMimeName(String encoding)
  {
    if (encoding == null)
      return null;

    String value = _mimeName.get(encoding);
    if (value != null)
      return value;

    String upper = normalize(encoding);

    String lookup = _mimeName.get(upper);

    value = lookup == null ? upper : lookup;

    _mimeName.put(encoding, value);

    return value;
  }


i saw the _mimeName is a HashTable,here is a lock

and here is the 2nd lock

  public static Reader getReadEncoding(InputStream is, String encoding)
    throws UnsupportedEncodingException
  {
    EncodingReader factory = null;
    
    synchronized (_readEncodingFactories) {
      factory = _readEncodingFactories.get(encoding);

      if (factory == null) {
        try {
          String javaEncoding = Encoding.getJavaName(encoding);

......

the _readEncodingFactories is locked

===============================

when the server receive too many post requests,this cause slow

i wanna know how to deal with this problem.

There are no notes attached to this issue.