关于内存泄露-深刻的记忆和教训-2012.12.05

来源:互联网 发布:java输出正杨辉三角形 编辑:程序博客网 时间:2024/06/05 07:29

今天关于WAS内存溢出问题,经过两个星期的研究和发现,终于找到 了问题的所在,主要是有数据库返回了结果集

达到了80多万条数据,内存占用率达到2G 左右,主要原因是有一个表AAA数据达到200多万,由于select * from AAA

而发生了数据库溢出的问题。





/**
* 属地 next 账户读取功能

* @return
*/
public String brfindNextAcct() {


// 清理session
ActionContext.getContext().getSession().remove(Constant.ORG_BR);


ActionContext.getContext().getSession().remove(Constant.ACCT_BR);


ActionContext.getContext().getSession().remove(Constant.CUST_NBR_BR);

ActionContext.getContext().getSession().remove(Constant.CUST_ORG_BR);


this.nextAcctbrVO = ccBusAcctworklistService.brfindNextAcct();
String orgTmp = this.nextAcctbrVO.getOrg();
String acctTmp = this.nextAcctbrVO.getAcct();
String custNbrTmp = this.nextAcctbrVO.getCustNbr();


if (this.nextAcctbrVO.getDatPopup() != null) {


String datPopup = this.nextAcctbrVO.getDatPopup();
ActionContext.getContext().getSession().put("datPopup", datPopup);
}
if (this.nextAcctbrVO.getTimPopup() != null) {
String timPopup = this.nextAcctbrVO.getTimPopup();
ActionContext.getContext().getSession().put("timPopup", timPopup);
}


ActionContext.getContext().getSession().put("org_br", orgTmp);
ActionContext.getContext().getSession().put("acct_br", acctTmp);
ActionContext.getContext().getSession().put("custNbr_br", custNbrTmp);


// 如果机构号,客户号为空,说明案件已经处理完毕
if (orgTmp == null && acctTmp == null) {
return "end";
} else {
DelayAcctVO delay = new DelayAcctVO();
delay.setOrg(orgTmp);
delay.setAcct(acctTmp);
this.delayAcctVOList = this.delayAcctService.aaaaaa(delay);
return "brMain";
}
}

}

当账户是催收员最后一个账户的时候,就会出现CUST_NBR 和 ORG 都是空的,这样的话就会导致后面

的查询语句出现SELECT * FROM AAA,DE QINGKONG 

当走if (orgTmp == null && acctTmp == null) {
return "end";

原创粉丝点击