Tomcat Problem

Tomcat Problem

Post by vity » Fri, 18 May 2001 19:08:01



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();

Quote:}

loop , then it create another class - Handler ( Thread
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.

 
 
 

Tomcat Problem

Post by AV » Fri, 18 May 2001 20:30:31


Vitaliy,

Something wrong with memory management. Is there any
special reasons for managing your Sockets, Listeners and
Helpers? Why you need Tomcat here? To avoid memory leak,
you have to revise all resources managing policy, closing
unnecessary threads, connections and so on.

Profiling tools or jvm profiling would be useful.

AlexV


Quote:> 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 ( Thread
> 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.


 
 
 

1. Tomcat (tomcat-apache.conf)

On my Linux box, my tomcat.conf as well as the auto-generated
tomcat-apache.conf file both have the following content:
--------------------------------
ApjServManual on
ApJServDefaultProtocol ajpv12
ApJServSecretKey DISABLED
ApJServMountCopy on
ApJServLogLevel notice

ApJServDefaultPort 8007
--------------------------------
When Apache is launched (the httpd.conf has includes for both files as
instructed) an error is returned saying these lines:

"cannot be specified more than once per host".  

However, if I comment out these lines in the tomcat-apache.conf file
after Tomcat auto-creates it, I can launch and all is fine.

QUESTION:  Does Tomcat *have* to write these lines into the
tomcat-apache.conf file?  The tomcat.conf file explicitly says not to
alter these lines in it's file. What can be done....or....is anyone else
experiencing this?

Thanks,
Rob

2. SQL 7.0 Installation Error

3. W2k, Tomcat and MySQL problem

4. Storing Co-worker network userid in Access

5. PROBLEM : Error establishing socket (Win XP, SQL Server 2000, Zone Alarm, Tomcat, IIS)

6. Views Transfer in VFP5

7. Tomcat JDBC problem

8. 4Gb ram upgarde

9. Problem with Tomcat + MySQL

10. Driver Problem in Tomcat

11. Tomcat JDBC problem

12. Problem connecting SQL Server 2000 JDBC Driver SP1 to Tomcat v4.1.18

13. problems with Tomcat and postgres