Hi everyone,
I'm constatly running out of memory when fetching more than 20,000
rows.
I haven't been able to find a memory profiler so I'm just trying with
trial and error with a unit test and an increasing number of rows.
One thing I'm trying is queries with pagination.
I think there's a mistake in the example here:
https://github.com/mandubian/siena/blob/master/source/documentation/manuals/first_model.textile
Iterate<Person> iter = query.iterPerPage(10);
while(iter.iterator().hasNext()){
System.out.println(iter.next());
}
If I call iterator() every time, a new iterator is created which is
very slow, instead doing this is very fast:
Iterator<Person> iter = q.iterPerPage(10).iterator();
while(iter.hasNext()){
System.out.println(iter.next());
}
I hope that would also reduce my memory requirements (by not having to
map all the entities at once). At least my test is no longer running
out of memory.
E.
PS I've noticed this warning about chunk sizes (I paginate 1000
entities). Does anyone know anything about it?
WARNING: This query does not have a chunk size set in FetchOptions and
has returned over 1000 results. If result sets of this size are
common for this query, consider setting a chunk size to improve
performance.
To disable this warning set the following system property in
appengine-web.xml (the value of the property doesn't matter):
'appengine.datastore.disableChunkSizeWarning'
--
You received this message because you are subscribed to the Google Groups "Siena" group.
To post to this group, send email to siena-...@googlegroups.com.
To unsubscribe from this group, send email to siena-discus...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/siena-discuss?hl=en.
Stateful allows cursor forward pagination which is the only way gae allows but it also allows backward as it stores cursors! This is something provided by siena but not by gae:)
Stateless pagination doesn't use cursors but offsets which is less efficient than cursors afaik!
Pascal
On Apr 24, 8:50 am, Pascal Voitot Dev <pascal.voitot....@gmail.com>
wrote:
> This is so great :DPas de problem! when we were in Wellington we used to go to a Belgian
> 80%!!!! huge!
> If I come to NZ on day, you'll pay me a beer ;););)
pub, I love their Loeve. Plus you could eat 2kg of mussles for the
price of 1 :-)
More results, iterating over 9200 entities
stateful, page size = 5000: 115 RPCs
stateful, page size = 9200: 115 RPCs
stateful, page size = 1000: 121 RPCs
stateful, page size = 500: 121 RPCs
stateless, page size = 1000: 833 RPCs
stateless, page size = 9200: 560 RPCs
I wish appstats could track the memory usage, that's important in
order to be able to use cheaper instances.
When I load too many entities at once I run out of memory, the
instance gets killed and the task restarts (forever! until I clear the
task queue).
I've noticed with stateful() the memory usage has increased but I
can't see heap errors in the logs. With stateless the memory usage was
constant so I don't think there's a leak, at least for that case.
> With cursors, I think GAE keep the resources alive as they do in SQL DB
> cursors and when you ask the nextPage, it simply begins from last cursor
> without creating any new resources.
> My cursors implementation in Siena is quite brutal: I keep all cursors in
> memory and that's why you can do backward/forward whereas in GAE, you can
> only do forward.