Wicket Pattern to reduce session size

2010-01-28 Thread Gaetan Zoritchak
Hi all, I was debugging my sessions size in order to reduce it and I saw that one of my page spend 20ko because of an dynamic image generated with JFreeChart. JFreeChart was serialized with my DynamicImageRessource. My first optimisation is to make JFreeChart a static field initialized in a

Re: Wicket Pattern to reduce session size

2010-01-28 Thread Pedro Santos
Then this image will to be the same for all sessions. If you don't want that object on your session, make sure at getImageData method implementation that you are always creating your chart object, and not keeping it in any instance variable. On Thu, Jan 28, 2010 at 8:28 AM, Gaetan Zoritchak

Re: Wicket Pattern to reduce session size

2010-01-28 Thread Gaetan Zoritchak
In fact, I just put the reference to JFreeChart as static. All the commons values are initialized in the static bloc (ie, Font, definition on the axis, ...). I keep the image generation done in the getImageData using the pageParameters. So every session or even page request can have its own

Re: Wicket Pattern to reduce session size

2010-01-28 Thread Riyad Kalla
Gaetan, You can mark whatever instance that is causing the session to be so large as 'transient' to avoid it being serialized -- you'd have to recreate it each time it was needed though. So if it's in your model: = private String chartName; private String chartArguments; // maybe