Hi Scott,

Thanks for the checking.

Today I double checked the CDI spec and got some new knowledge.

Nearly all my beans were not annotated with any scope, so that they
should be @Dependent.

Some of the beans were created (not injected) in a servlet filter via
a static ObjectFactory.
I think the beans should be transient but they are NOT.

They actually were probably immortal because they were created in a
servlet filter (singleton in webapp).
And also my ObjectFactory was annotated with @Singleton too, too bad.

As a workaround, I may annotated most my beans as @ApplicationScoped
or @SessionScoped,
because they're all stateless. At least after a bean was annotated as
@SessionScoped, the
@PreDestroy method was correctly fired when the request ended.

This workaround SHOULD address the memory leak problem of my site,
though not thoroughly tested.

It's my initial thought. Hope you have a full story to tell me, if
u've got some time. :)

Thanks again.


resin-interest mailing list

Reply via email to