db4o Developer Community

db4o open source object database, native to Java and .NET
Welcome to db4o Developer Community Sign in | Join
in Search
More Search Options

java.lang.OutOfMemoryError: Java heap space

Last post 07-18-2008, 03:55 PM by liangyufei. 0 replies.
Sort Posts: Previous Next
  •  07-18-2008, 03:55 PM 50214

    java.lang.OutOfMemoryError: Java heap space

    大家好,为什么我执行以下代码时,会出现内存耗尽的问题?
    Query Query = db.query();
    Query.constrain(test.class);
    Query.descend("cdate").orderDescending();
    Query.descend("type").constrain("3").or( Query.descend("type").constrain("4"));
    ObjectSet result = IQuery.execute();
    this.total = result.size();
    而且test.class只有500条数据,但是整个文件就达到900多M?而且TOMCAT的执行参数也加上了JAVA_OPTS 的-Xmx512m,真的搞不懂,type,cdate都已经做了索引:
    c.objectClass(test.class).objectField("type").indexed(true);
    c.objectClass(test.class).objectField("cdate").indexed(true);
            
       

View as RSS news feed in XML