Barracuda: Re:Barracuda Memory troubles
V B Skrypnyk <[email protected]>
| Newsgroups | gmane.comp.java.enhydra.barracuda.general |
|---|---|
| Message-ID | <17875688.1039317406540.JavaMail.vas@pilgrim> |
Christian, I have found where the memory leak was happening in my code. It is caused by the following scenario: 1. Create a BTemplate that will last for one servlet lifecycle (MainScreen). 2. Create a Model that represents some persistent data and store it in the session (Tabs) 3. Have different portions of your application access session-saved Model and set up their data in it. (Tabs) 4. On every MainScreen instantiation add the model, so that the respective portion of the template is rendered, i.e. Tabs. What happens now is that on every addModel() call a new listener is added to the model and the list keeps growing until the model drags around megabytes of listeners, as happened in my case. Now, maybe instead of appending the listeners in the List it is worthwhile checking if this listener has already been added, or maybe I am misusing the Barracuda framework. Please let me know what you think. Cheers, --Bill. _______________________________________________ Barracuda mailing list [email protected] http://www.enhydra.org/mailman/listinfo.cgi/barracuda FAQ - http://www.jguru.com/faq/Barracuda