The web application I develop creates many threads in a "StartupServlet"'s init method and destroys them in the destroy method.
The threads work in an infinite loop unless they are signaled to stop. They have to create a lot of list objects, that is, they produce a lot of garbage object (objects left for the GC).
The reason, I create them within a servlet environment is because they need to invoke remote ejbs. I pass them an InitialContext object prepared within the servlet environment. (and invoking remote EJBs in a standalone application can be quite cumbersome.)
The threads are marked as daemon threads, so that they don't hinder the WAS process (main process) from shutting down.
My questions are :
1) Websphere runs on the IBM JVM. What are the odds that the IBM JVM's GC doesn't collect garbage objects created by my custom threads ?
2) Are there any other drawbacks in creating custom threads within a servlet environment ?
This topic has been locked.
2 replies Latest Post - 2011-02-21T17:03:52Z by SystemAdmin
Pinned topic Starting custom threads in Websphere Servlet Container
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
Updated on 2011-02-21T17:03:52Z at 2011-02-21T17:03:52Z by SystemAdmin
Re: Starting custom threads in Websphere Servlet Container2011-02-16T18:37:53Z in response to SystemAdminHello,
Just FYI, you might want to look at Asynchronous beans at http://publib.boulder.ibm.com/infocenter/wasinfo/v7r0/topic/com.ibm.websphere.nd.doc/info/ae/asyncbns/concepts/casb_asbover.html as a way of running multiple threads within WebSphere Application Server.
Lotus Web Content Management support
The postings on this site are my own and do not necessarily represent the positions, strategies, or opinions of IBM.
Re: Starting custom threads in Websphere Servlet Container2011-02-21T17:03:52Z in response to SystemAdminThanks for the tip.
I had a conversation here : http://www.coderanch.com/t/521650/Websphere/Starting-custom-threads-Websphere-Servlet
This question is kind of answered.