extjs 内存溢出问题 急 急 急 !extjs java高手请进!使用extjs做的页面如图:
现在双击项目年度明细获取项目预算时报内存溢出错误 这个功能用jsp实现的时候就没有这样的错误(后台的处理是一样)请问这个是什么原因?在线等!!急!!关于报错如下:
java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOf(Arrays.java:2882)
at java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:100)
at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:390)
at java.lang.StringBuilder.append(StringBuilder.java:119)
at java.lang.StringBuilder.append(StringBuilder.java:115)
at com.googlecode.jsonplugin.JSONWriter.add(JSONWriter.java:486)
at com.googlecode.jsonplugin.JSONWriter.add(JSONWriter.java:319)
at com.googlecode.jsonplugin.JSONWriter.bean(JSONWriter.java:225)
at com.googlecode.jsonplugin.JSONWriter.process(JSONWriter.java:157)
at com.googlecode.jsonplugin.JSONWriter.value(JSONWriter.java:123)
at com.googlecode.jsonplugin.JSONWriter.array(JSONWriter.java:400)
at com.googlecode.jsonplugin.JSONWriter.process(JSONWriter.java:147)
at com.googlecode.jsonplugin.JSONWriter.value(JSONWriter.java:123)
at com.googlecode.jsonplugin.JSONWriter.add(JSONWriter.java:321)
at com.googlecode.jsonplugin.JSONWriter.bean(JSONWriter.java:225)
at com.googlecode.jsonplugin.JSONWriter.process(JSONWriter.java:157)
at com.googlecode.jsonplugin.JSONWriter.value(JSONWriter.java:123)
at com.googlecode.jsonplugin.JSONWriter.add(JSONWriter.java:321)
at com.googlecode.jsonplugin.JSONWriter.bean(JSONWriter.java:225)
at com.googlecode.jsonplugin.JSONWriter.process(JSONWriter.java:157)
at com.googlecode.jsonplugin.JSONWriter.value(JSONWriter.java:123)
at com.googlecode.jsonplugin.JSONWriter.add(JSONWriter.java:321)
at com.googlecode.jsonplugin.JSONWriter.bean(JSONWriter.java:225)
at com.googlecode.jsonplugin.JSONWriter.process(JSONWriter.java:157)
at com.googlecode.jsonplugin.JSONWriter.value(JSONWriter.java:123)
at com.googlecode.jsonplugin.JSONWriter.array(JSONWriter.java:400)
at com.googlecode.jsonplugin.JSONWriter.process(JSONWriter.java:147)
at com.googlecode.jsonplugin.JSONWriter.value(JSONWriter.java:123)
at com.googlecode.jsonplugin.JSONWriter.add(JSONWriter.java:321)
at com.googlecode.jsonplugin.JSONWriter.bean(JSONWriter.java:225)
at com.googlecode.jsonplugin.JSONWriter.process(JSONWriter.java:157)
at com.googlecode.jsonplugin.JSONWriter.value(JSONWriter.java:123)

解决方案 »

  1.   

    内存不足。。
    这可能是释放内存的问题吧~或者是说你使用extjs增加了后台负担了~
      

  2.   

    是你后台代码写的有问题吧..跟extjs 关系不大吧。。
    后台先输出 接收到的json 看看有没什么异常。。 
    正常来说 就是你json转换java类 那里弄错了。
      

  3.   

    应该是JSON转换的字符串长度太大了了,你有没有分页。分页看看
    或是直接在地址栏输入请求地址看看,有没有什么错误。
    注意你转换json的对象中,可能引用到了其他的对象,而其他的对象又引用了对象
    这样就导致,一下要加载所有和当前对象关联的对象信息。
    如果是这样的,你就需要用setJsonPropertyFilter,过滤掉不需要转换的对象信息
      

  4.   

    我在后台没有显示去转换成json 而是在struts2的配置文件中配置的 形如:
    <result type="json">
      <param name="root">page</param>
      <param name="excludeProperties">conditions,limit,start,success,objCondition</param>
    </result>
    其中page是封装的分页对象 它包括了要查找的list集合和一些分页信息 
      

  5.   

    public String proDisBudgetMoney2(){
    page = new Page();
    try {
    if(projectId!=null && !"".equals(projectId)){
    Page budgetPage = projectBudgetService.queryAllBudgetByPage(page, projectId);
    //项目预算集合
    List<BaseProjectBudget> list2 = budgetPage.getRoot();
    //项目预算集合
    projectBudgetList = new ArrayList<BaseProjectBudget>();
    BaseProjectBudgetYearBudget bpbdt = null;
    for(BaseProjectBudget budget : list2)
    {
    budget.setProjectName(budget.getBaseProject().getProjectName());
    if(ybdtid != null && !"".equals(ybdtid))
    {
    bpbdt = bdtYearBudgetService.queryMoneyByIds(ybdtid, budget.getId());
    }
    if(bpbdt != null)
    {
    budget.setTmoney(bpbdt.getCurrentBudgetFee());
    }
    bpbdt = null;
    projectBudgetList.add(budget);
    }
    list2 = null;
    }
    page.setRoot(projectBudgetList);//返回的信息 其中root是所查询到的信息
    projectBudgetList = null;
    } catch (ServiceException e) {
    e.printStackTrace();
    }
    return SUCCESS;
    }struts配置文件:
    <action name="proDisBudgetMoney2" class="projectYearBudgetAction" method="proDisBudgetMoney2">
    <result type="json">
    <param name="root">page</param>
    <param name="excludeProperties">conditions,limit,start,success,objCondition</param>
    </result>
    </action>