[原创]weblogic中发布Axis客户端导致内存溢出的分析处理_Tomcat, WebLogic及J2EE讨论区_Weblogic技术|Tuxedo技术|中间件技术|Oracle论坛|JAVA论坛|Linux/Unix技术|hadoop论坛_联动北方技术论坛  
网站首页 | 关于我们 | 服务中心 | 经验交流 | 公司荣誉 | 成功案例 | 合作伙伴 | 联系我们 |
联动北方-国内领先的云技术服务提供商
»  游客             当前位置:  论坛首页 »  自由讨论区 »  Tomcat, WebLogic及J2EE讨论区 »
总帖数
1
每页帖数
101/1页1
返回列表
0
发起投票  发起投票 发新帖子
查看: 3857 | 回复: 0   主题: [原创]weblogic中发布Axis客户端导致内存溢出的分析处理        下一篇 
FDY1
注册用户
等级:网站编辑
经验:436455203
发帖:23
精华:2
注册:2013-3-6
状态:离线
发送短消息息给FDY1 加好友    发送短消息息给FDY1 发消息
发表于: IP:您无权察看 2013-3-12 15:14:45 | [全部帖] [楼主帖] 楼主

近日,发现公司的应用经常停止响应,通过监控weblogic 8.16 上的内存使用情况,发现Axis组件的ConfigurationException占据很大的内存分配空间,如下图:
北京联动北方科技有限公司
此weblogic上发布了一个使用Axis客户端调用webservice的应用,联系该webservice客户端开发人员无果后,想自己看如何解决这个问题

先下载了axis 1.4的源代码,根据上图监控AxisEngine后标注的行数,找到以下代码

[java]view plaincopyprint?

  1. // fixme: could someone who knows double-check I've got the semantics of 
  2. // this right? 
  3. /**
  4.  * Get the <code>SOAPService</code> for a particular local name.
  5.  *
  6.  * @param name the local name of the request type
  7.  * @return the <code>SOAPService</code> for this request type
  8.  * @throws AxisFault
  9.  */
  10. public SOAPService getService(String name) throws AxisFault 
  11.       try { 
  12.             return config.getService(new QName(null, name)); 
  13.        } catch (ConfigurationException e) { 
  14.             try { 
  15.                   return config.getServiceByNamespaceURI(name); 
  16.              } catch (ConfigurationException e1) { 
  17.                   thrownew AxisFault(e); 
  18.              } 
  19.        } 


// fixme: could someone who knows double-check I've got the semantics of
// this right?
/**
* Get the <code>SOAPService</code> for a particular local name.
*
* @param name the local name of the request type
* @return the <code>SOAPService</code> for this request type
* @throws AxisFault
*/
public SOAPService getService(String name) throws AxisFault
{
       try {
             return config.getService(new QName(null, name));
       } catch (ConfigurationException e) {
       try {
             return config.getServiceByNamespaceURI(name);
       } catch (ConfigurationException e1) {
       throw new AxisFault(e);
}
}
}

这个代码表面上看起来没什么问题,首先调用getService,如果报错,再调getServiceByNamespaceURI

但是在jrockit环境下却一直占用大量内存分配,直到溢出。检查过日志级别,也处于Info。

将此处代码顺序getServiceByNamespaceURI调至前面,先解决,后续再查看原因。
最近继续阅读Axis源代码,发现初始化AxisServlet已经对server-config.wsdd配置进行实例化至WSDDDeployment中,并由FileProvider引用。FileProvider实际上将getService任务交给deployment完成,deployment在AxisEngine初始化时已经持有server-config.wsdd中各种配置信息,如:transport、handler、globalConfiguration、service,并将各类配置存储至HashMap缓存中。
本例实际上是由于server-config.wsdd中某些接口没有或者配置错误,导致先调用getService不断失败后去尝试getServiceByNamespaceURI大量抛出ConfigurationException

,但是此错为何会堆积在内存中不断增长呢?有空还需要继续检查,大家有深入研究过源码的也可以发表一下高见,非常欢迎。




赞(0)    操作        顶端 
总帖数
1
每页帖数
101/1页1
返回列表
发新帖子
请输入验证码: 点击刷新验证码
您需要登录后才可以回帖 登录 | 注册
技术讨论