I've recently moved to myfaces with tomahawk (following this successful thread link), and I'm getting out of memory errors whenever I'm writing new code and the application (Tomcat) reloads the context. This is the generic reload message: "INFO: Reloading Context with name [/Auctions] has started"
And it's followed seconds later by this: "Exception in thread "ContainerBackgroundProcessor[StandardEngine[Catalina]]" java.lang.OutOfMemoryError: PermGen space"
I know that I can increase the memory (btw., should it be done directly in Tomcat, or somewhere in Eclipse?) but this out of memory error used to pop up only after several reloads, and now it slows down my development.
Also, I'm obviously concerned about deployment.
What should I do?
EDIT:
One thing that seems related: I'm getting 2 warning messages like this:
"WARNING: Cannot serialize session attribute auctionsViewBean for session CB0149C43DF44F5AA6A084A022F1D418"
immediately followed by
java.io.NotSerializableException: org.apache.catalina.session.StandardSessionFacade.
And then the out of memory error happens.
Now, AuctionsViewBean implements Serializable, but I'm reading here that a bean may not be re-serialized into the session unless it has a no argument constructor. My bean does have a no argument constructor, but I am setting some values in it. Could this cause the problem?
If so -- and in any case, really -- what is the best place for setting values into a bean? Is it in the constructor, or somewhere else in its lifecycle?