You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cayenne.apache.org by Aristedes Maniatis <ar...@maniatis.org> on 2011/01/25 11:55:06 UTC

Re: Cache limits

On 25/01/11 9:42 PM, André Rothe wrote:
> Hello,
>
> currently I try to understand the Cayenne design and implementation. Can you explain, how you limit the number of objects, which are inside the cache? On an application with a huge number of data rows, the most important point is the size of the used memory for the object cache.

If you want more sophisticated caching, you might want to look at oscache or other pluggable options for Cayenne. There is a section about that in the manual.


>  As I have understand, Cayenne tracks the state of the object, so it is only possible to remove transient objects from the cache. Is it possible to remove the data of (e.g. committed) objects and hold only the id to save memory?

Yes, you can fetch data using paged queries. In that case the objects (well, most of them) are hollow, meaning that they hold just the id. This is not only good for memory usage, but also much faster across the network especially for ROP. You can't make an object hollow once you already have it in memory, but you can fetch them as hollow in the first place which is usually what you want to do. It is not uncommon to see an order of magnitude improvement in memory usage and performance with a reasonably large query result.


I have moved this thread to the correct place: on the user list. Please reply there and drop dev@ from the cc list.

Ari


-- 
-------------------------->
Aristedes Maniatis
GPG fingerprint CBFB 84B4 738D 4E87 5E5C  5EFA EF6A 7D2E 3E49 102A