Hello!
I'm using Tomcat to run my servlets.
In my servlet , I create class - Listenner ( Thread subclass ) -
that open ServerSocket and listens to requests in the :
while( true )
{
connection = listenSocket.accept();
// When accepts the applet request opens another thread
to talk with it.
AppletsHandlerServer handleServer = new
AppletsHandlerServer( connection ,dbClient );
handleServer.start();
loop , then it create another class - Handler ( ThreadQuote:}
subclass ) that will talk with the clients.
The Listenner class also open JDBC connection to the Oracle and
then gives it to the Handler
My problem is that after some time that my servlet is running ,
and it can be 20 minutes up to 20 hours , my servlet got
folowwing exception:
java.lang.OutOfMemoryError
at java.lang.Thread.start(Native Method)
at
org.apache.tomcat.service.SimpleTcpEndpoint.processSocket
(SimpleTcpEn
dpoint.java:239)
at
org.apache.tomcat.service.SimpleTcpEndpoint.acceptConnections
(SimpleT
cpEndpoint.java:250)
at org.apache.tomcat.service.TcpListenerThread.run
(SimpleTcpEndpoint.jav
a:319)
at java.lang.Thread.run(Unknown Source)
Endpoint ServerSocket
[addr=0.0.0.0/0.0.0.0,port=0,localport=8080] shutdown due t
o exception: java.lang.OutOfMemoryError
and then it crashs absolutely , so even all my computer
freezes , it also prints following message:
#
# An EXCEPTION_STACK_OVERFLOW exception has been detected in
native code outside
the VM.
# Program counter=0x5025c2c7
#
I need urgent help.
Do you think it is my bug or may be something else.
Thanks.Victor.