On Thu, Jan 20, 2011 at 2:42 AM, Mihai Toma <mihai.t...@asf.ro> wrote:

> Hi guys!
>
> I resolved the problem.
>
> Here is what I was doing:
>
> - I have a page, let's say HomePage which extends WebPage.
> - This HomePage add a MenuPanel which extends Panel (add(new MenuPanel()).
> - This MenuPanel add a SubmenuPanel like this menuPanel.add(new
> SubmenuPanel(MenuPanel.this)).
>
> Because of this reference the whole page was kept in session and the
> session
> grows very fast.
>
> You can say that I can access the MenuPanel from SubmenuPanel using
> getParent() but let's omit this thing.
>
> Is it normal for wicket to keep these pages in session if you have this
> type
> of reference?
>

Every component has a reference to its page.  So, what you described above
should not be a problem.  And since you're using HttpSessionStore, all pages
will be serialized into session anyway.  But pages and components themselves
are not very large.  You need to run a memory analyzer and look for:

1 - references to pages or components from another page hierarchy (don't
pass one component to another page)
2 - (more likely) references to domain objects or, worse yet, services /
daos that are being serialized

-- 
Jeremy Thomerson
http://wickettraining.com
*Need a CMS for Wicket?  Use Brix! http://brixcms.org*

Reply via email to