title: OutOfMemoryError: Java heap space GoogleAppEngine
body: <p>Got an application running on AppEngine. Has been running fine for 2 years. Checked in on it today and I discoverd it was failing. I have not touch the code for a long time.</p>
  
  <p>The error I get is this:</p>
  
  <pre><code>java.lang.OutOfMemoryError: Java heap space
  at com.google.storage.onestore.v3.OnestoreEntity$Property.&lt;init&gt;(OnestoreEntity.java:2849)
  at com.google.storage.onestore.v3.OnestoreEntity$EntityProto.addProperty(OnestoreEntity.java:5755)
  at com.google.storage.onestore.v3.OnestoreEntity$EntityProto.merge(OnestoreEntity.java:6232)
  at com.google.apphosting.api.DatastorePb$QueryResult.merge(DatastorePb.java:13045)
  at com.google.appengine.repackaged.com.google.io.protocol.ProtocolMessage.mergeFrom(ProtocolMessage.java:405)
  at com.google.appengine.repackaged.com.google.io.protocol.ProtocolMessage.mergeFrom(ProtocolMessage.java:422)
  at com.google.appengine.repackaged.com.google.io.protocol.ProtocolMessage.parseFrom(ProtocolMessage.java:534)
  at com.google.appengine.api.datastore.DatastoreApiHelper$1.wrap(DatastoreApiHelper.java:90)
  at com.google.appengine.api.datastore.DatastoreApiHelper$1.wrap(DatastoreApiHelper.java:83)
  at com.google.appengine.api.utils.FutureWrapper.wrapAndCache(FutureWrapper.java:51)
  at com.google.appengine.api.utils.FutureWrapper.get(FutureWrapper.java:67)
  at com.google.appengine.api.datastore.FutureHelper.getInternal(FutureHelper.java:71)
  at com.google.appengine.api.datastore.FutureHelper.quietGet(FutureHelper.java:32)
  at com.google.appengine.api.datastore.QueryResultsSourceImpl.loadMoreEntities(QueryResultsSourceImpl.java:69)
  at com.google.appengine.api.datastore.QueryResultsSourceImpl.loadMoreEntities(QueryResultsSourceImpl.java:56)
  at com.google.appengine.api.datastore.QueryResultIteratorImpl.ensureLoaded(QueryResultIteratorImpl.java:156)
  at com.google.appengine.api.datastore.QueryResultIteratorImpl.hasNext(QueryResultIteratorImpl.java:65)
  at org.datanucleus.store.appengine.query.RuntimeExceptionWrappingIterator$1.get(RuntimeExceptionWrappingIterator.java:50)
  at org.datanucleus.store.appengine.query.RuntimeExceptionWrappingIterator$1.get(RuntimeExceptionWrappingIterator.java:47)
  at org.datanucleus.store.appengine.query.QueryExceptionWrappers$1.get(QueryExceptionWrappers.java:51)
  at org.datanucleus.store.appengine.query.QueryExceptionWrappers$2.get(QueryExceptionWrappers.java:86)
  at org.datanucleus.store.appengine.query.RuntimeExceptionWrappingIterator.hasNext(RuntimeExceptionWrappingIterator.java:105)
  at org.datanucleus.store.appengine.query.LazyResult.resolveAll(LazyResult.java:115)
  at org.datanucleus.store.appengine.query.LazyResult.size(LazyResult.java:110)
  at org.datanucleus.store.appengine.query.StreamingQueryResult.size(StreamingQueryResult.java:130)
  at guestbook.ProxyServlet.processRequest(ProxyServlet.java:132)
  at guestbook.ProxyServlet.doGet(ProxyServlet.java:288)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
  at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
  at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
  at com.google.apphosting.utils.servlet.ParseBlobUploadFilter.doFilter(ParseBlobUploadFilter.java:97)
  </code></pre>
  
  <p>The code at line 132 in my proxy servlet access a list of entities I retrived from the database. It's this line "System.out.println("from db "+allEventsLst.size());"</p>
  
  <p>My application works when I run a local server. Any ideas???</p>
  
  <pre><code>    String fromDateStr = shortDf.format(fromDate);
  
  
  
      Query query = pm.newQuery(Event.class, "date &gt;= fromDate");
        query.declareImports("import java.lang.String");
        query.declareParameters("String fromDate");    
  
      List&lt;Event&gt; allEventsLst = (List&lt;Event&gt;)query.execute(fromDateStr);
  
      System.out.println("from db "+allEventsLst.size());
  
      Map&lt;String, Event&gt; eventMap = new HashMap&lt;String, Event&gt;();
  
      for (Event e : allEventsLst) {
  </code></pre>
  
  <p>Thanks</p>