Dellee schrieb:
> Hi all, 
>    I am new to myFaces and I think a little bit confusing on the saveState
> option.
> When using the saveState, will it keep referencing the beans that it pointed
> to ?
> if yes, will this cause a memory leak coz the pointed bean should be died
> and GC after the server method finished. 
> However, as someone is pointing to it (by saveState), so it still alive and
> won't be collected when GC start.
> what do u think ?
> am i mis-understanding something ?
> 
First of all I am moving this into the users list.
The devs list is for development discussions on myfaces.

Yes you misunderstand something:
saveState uses the jsf internal save restore mechanisms, hence
every object which is referenced by safestate is serialized and
deserialized at every request, so no memory leak situation theoretically
can occur
unless the serialisation happens into the session
(this is app server dependent)

besides that once you reach a page where savestate  is not referenced
anymore the object is basically dropped from the save restore cycled
and fed into the garbage collector at the next save cycle.

Reply via email to