You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cayenne.apache.org by Erlend Birkenes <eb...@dataloy.com> on 2012/02/03 23:55:02 UTC

Memory usage of the shared cache

Hi

Is there a simple way to monitor or find out the memory usage of the shared
cache at runtime?


-Erlend

Re: Memory usage of the shared cache

Posted by Erlend Birkenes <eb...@dataloy.com>.
Thanks Andrus, those are helpful tips.

-Erlend


2012/2/7 Andrus Adamchik <an...@objectstyle.org>

> The best way is to use a profile like YourKit that can give you the exact
> number.
>
>
> Without a profiler, you'd have to experiment. My guess is that you are
> less interested in absolute numbers (how big is my cache right now?), but
> rather in a correlation of max cache size vs. the amount of heap space your
> app requires (-Xmx).
>
> There are 2 shared caches in Cayenne - object cache and query cache.
> Object cache size can be configured in the Modeler for a given DataDomain.
> Query cache size configuration depends on implementation (MapQueryCache,
> OSQueryCache, etc.)
>
> So you have these 2 numbers to play with. You fill the caches to the
> maximum by doing some work in the app, and then check how much memory the
> entire app is using after repeated garbage collection cycles (e.g. via
> JConsole or VisualVM).
>
> Andrus
>
>
> On Feb 4, 2012, at 1:55 AM, Erlend Birkenes wrote:
> > Hi
> >
> > Is there a simple way to monitor or find out the memory usage of the
> shared
> > cache at runtime?
> >
> >
> > -Erlend
>
>

Re: Memory usage of the shared cache

Posted by Andrus Adamchik <an...@objectstyle.org>.
The best way is to use a profile like YourKit that can give you the exact number. 


Without a profiler, you'd have to experiment. My guess is that you are less interested in absolute numbers (how big is my cache right now?), but rather in a correlation of max cache size vs. the amount of heap space your app requires (-Xmx).

There are 2 shared caches in Cayenne - object cache and query cache. Object cache size can be configured in the Modeler for a given DataDomain. Query cache size configuration depends on implementation (MapQueryCache, OSQueryCache, etc.)

So you have these 2 numbers to play with. You fill the caches to the maximum by doing some work in the app, and then check how much memory the entire app is using after repeated garbage collection cycles (e.g. via JConsole or VisualVM).

Andrus


On Feb 4, 2012, at 1:55 AM, Erlend Birkenes wrote:
> Hi
> 
> Is there a simple way to monitor or find out the memory usage of the shared
> cache at runtime?
> 
> 
> -Erlend