I have a j2ee application and inside which i have a class 1 which starts multiple threads T1 ,T2 ,T3.Now i also have a webserrvice.Now I want that that my threads T1,T2,T3,should run indevinitely till the webserver is stopped or my application is undeployed.My Thread internally connects to some urls and perform some action and other taks related to db.
1)Now The code that starts my threads is called from servletContextListener.I see a warning on tomcat console that it may cause a memory leak.will there be any problem?
2)From my Threads i connect to urls on other server on porrt 80.Will this clash with my local port?
I am 95% certain that any thread long running or not can experience memory leaks. Memory leaks have to do with GC and finalization not threads.
just because you target your connection to port 80 does not mean that you initiate your comm from port 80. because the server always has to respond on port 80, and you can only either listen or send on port 80, not both. the transmission has to come from some other port. So no it will not clash with your local port.