美文网首页
2019-10-10 商品详情cpu飚高问题

2019-10-10 商品详情cpu飚高问题

作者: hvne666 | 来源:发表于2019-10-10 21:31 被阅读0次

    依赖的api加了个类,商品详情找不到这个类

    会一直反射这个找不到的类,qps高的情况下会对性能造成影响,现象是,ygc频繁且每次ygc时间有几百ms

    public Deserializer getDeserializer(String type)
                throws HessianProtocolException {
            if (type == null || type.equals(""))
                return null;
    
            Deserializer deserializer;
    
            if (_cachedTypeDeserializerMap != null) {
                deserializer = (Deserializer) _cachedTypeDeserializerMap.get(type);
    
                if (deserializer != null)
                    return deserializer;
            }
    
    
            deserializer = (Deserializer) _staticTypeMap.get(type);
            if (deserializer != null)
                return deserializer;
    
            if (type.startsWith("[")) {
                Deserializer subDeserializer = getDeserializer(type.substring(1));
    
                if (subDeserializer != null)
                    deserializer = new ArrayDeserializer(subDeserializer.getType());
                else
                    deserializer = new ArrayDeserializer(Object.class);
            } else {
                try {
                    Class cl = Class.forName(type, false, _loader);
                    deserializer = getDeserializer(cl);
                } catch (Exception e) {
                    log.warning("Hessian/Burlap: '" + type + "' is an unknown class in " + _loader + ":\n" + e);
    
                    log.log(Level.FINER, e.toString(), e);
                }
            }
    
            if (deserializer != null) {
                if (_cachedTypeDeserializerMap == null)
                    _cachedTypeDeserializerMap = new ConcurrentHashMap(8);
    
                _cachedTypeDeserializerMap.put(type, deserializer);
            }
    
            return deserializer;
        }
    

    相关文章

      网友评论

          本文标题:2019-10-10 商品详情cpu飚高问题

          本文链接:https://www.haomeiwen.com/subject/zhqzpctx.html