Re: Should one process continue to grow on Linux???

2002-10-15 Thread JensStutte


For my experience, the Sun jdk 1.3.x on linux tend to grow infinitely with
tomcat. Try out the IBM JDK 1.3.1 or the newest Sun 1.4.1 (for servers i
use the IBM, it's seems more reliable and stable in its memory
consumption).

Regards,

Jens Stutte



   
  
Brandon   
  
CruzTo: Tomcat Users List   
  
bcruz@norvax[EMAIL PROTECTED]  
  
.comcc:   
  
 Subject: Should one process continue to 
grow on 
24/09/2002   Linux???  
  
01.25  
  
Please 
  
respond to 
  
Tomcat Users  
  
List  
  
   
  
   
  




We are running tomcat 3.2.4 connected to Apache on Linux RedHat 7.1.  We
are
using jdk1.3.1_01.  Recently, we have noticed that one process continues to
grow in the memory consumption and cpu usage.  If we do not restart tomcat,
the time this process shows to be running keeps getting bigger.  This is
not
the parent process created on startup, it is one of the child processes.
Is
this normal, or do we need to start checking our code?  Below is a sample
output of the process, showing that is has been running for 27:49 minutes.



root 17825  7.8 15.5 818396 77144 ?  S13:10  27:49
/usr/java/jdk1.3.1_01/bin/i386/native_threads/java -Dtomcat.home=/usr


Brandon


--
To unsubscribe, e-mail:   
mailto:[EMAIL PROTECTED]
For additional commands, e-mail: 
mailto:[EMAIL PROTECTED]






--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: Running class finalize method when stopping/restarting a WebApp

2002-10-14 Thread JensStutte


There is no way to ensure, that a finalize method is called. It depends on
the JVM's GC implementation and has nothing to do with tomcat. If it's a
servlet, you can override the destroy() method of the servlet class to
close your connections. Or you make a class that implements
HttpSessionBindingListener and put it into the session (depends on your
connection architecture).

Regards,

Jens Stutte



   
 
Oakleaf Admin  
 
Admin@oakleafconsulTo: 
'[EMAIL PROTECTED]'  
tancy.com  [EMAIL PROTECTED]   
 
cc:
 
27/09/2002 15.20Subject: Running class finalize 
method when 
Please respond to   stopping/restarting a WebApp   
 
Tomcat Users List
 
   
 
   
 




Hi,

I have an application scope class that is managing an Oracle connection
cache to my database.

The finalize method of this class is written to terminate all connections
and close the connection cache.

However, when I stop the webapp or restart it (using the manager app) the
finalize of this class is not run everytime (about1 in every 3 times it
does
run), furthermore it seems to me that Tomcat is keeping a reference to the
class as the garbage collector never closes it and Oracle DCD cannot
terminate the connection as it thinks it is still alive.

Can anyone tell me how to ensure the finalize method is run everytime the
webapp is stopped/restarted or if there is any other way of doing the same
thing ?

Thanks in advance, Eddie






--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: Does closing a Connection variable and setting it to null close all ofthe ResultSet and Statements?

2002-08-28 Thread JensStutte


Unfortunately there are databases and JDBC combinations, that do not free
database resources, if you do not explicitely close all result sets and
statements. If i remember right, SAP DB was one of them (BTW, only problem
i had with it, and easy to resolve). You may then run out of connections,
because the database did not free the connection until there were open
result sets. I am quite sure, that this may apply to other databases, too,
and i got used to explicitely close everything (i wrote my own wrapper
classes for connections and statements, which ease these tasks).

Regards,

Jens Stutte



   
  
Glenn Nielsen  
  
[EMAIL PROTECTED]To: Tomcat Users List 
[EMAIL PROTECTED]  
ore.net cc:   
  
 Subject: Re: Does closing a Connection 
variable and 
28/08/2002   setting it to null close all of the ResultSet 
and   
02.03Statements?   
  
Please 
  
respond to 
  
Tomcat Users  
  
List  
  
   
  
   
  




Per the javax.sql javadocs...

When a Connection is closed it closes any open Statements.
When a Statement is closed, it closes any open ResultSets.

If you just dereference a connection (non connection pool) when the
Connection is GC'd it is closed.

If you use DBCP 1.0 as your connection pool it tracks Statements and
ResultSets used
by a connection.  When you close the connection it will ensure the
Statements and ResultSets
still open for that Connection are closed.

Regards,

Glenn


Michael Nicholson wrote:
 Well, I guess the subject line says it all.  I'm having memory issues,
and having read the OOM error messages on the list, I've checked and found
some open and not being closed connections, so I'm going back and closing
them all.  The question is do I need to explicitly close/dereference (set
to null) all statements and recordsets too?  Right now the system takes
about 4% of my available memory just for the beans in question, so I'm
trying to minimize what I store so that I could conceptually have more than
one user.

 Thanks in advance,
 Mike Nicholson




--
To unsubscribe, e-mail:   
mailto:[EMAIL PROTECTED]
For additional commands, e-mail: 
mailto:[EMAIL PROTECTED]






--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: Checking Tomcat's Memory

2002-08-16 Thread JensStutte


That's true, the adress space for each Win32 process is limited to 2GB
(same on Linux? I would assume yes for the same processor architecture, but
i do not know it). Another hint: If your applications are compatible with
jdk 1.3, try out the IBM jdk. For me it works more stable and performant
than the Sun jdks in a server environment both on Windows and Linux. For
example the GC does not stop the whole JVM from time to time as with the
Sun jdk.

Regards,

Jens Stutte



   
   
Sexton,   
   
George   To: Tomcat Users List  
   
gsexton@mhsof[EMAIL PROTECTED] 
   
tware.comcc:  
   
  Subject: RE: Checking Tomcat's Memory
   
16/08/2002 
   
01.01  
   
Please respond 
   
to Tomcat 
   
Users List
   
   
   
   
   




I really doubt it. I seem to recall that for Windows 32 bit applications
the
maximum address space of an application is 2GB. I would try reducing the
second parameter to below 2GB and see what happens.

I'm sure Sun has some boxes that could do this...

-Original Message-
From: Marinko, Jeff [mailto:[EMAIL PROTECTED]]
Sent: 15 August, 2002 3:28 PM
To: 'Tomcat Users List'
Subject: RE: Checking Tomcat's Memory


Ah, there it is!

So I would add additional JVM Option Number X with the -server, -Xms,
-Xmx
parameters and change JVM Option Count to account for this.

I've managed to change the VM heap size through editing the catalina.bat
script, however I get the following:

Error occurred during initialization of VM
Could not reserve enough space for object heap

when I try to set my parameters at -Xms1024m -Xmx3072m (currently running
at
128m and 1024m).  Are there any VMs out there that can handle this kind of
memory (1+ gigs to start)?

Thanks!

-Original Message-
From: Sexton, George [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 15, 2002 1:20 PM
To: Tomcat Users List
Subject: RE: Checking Tomcat's Memory


HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ServiceName
\Parameter
s


--
To unsubscribe, e-mail:   
mailto:[EMAIL PROTECTED]
For additional commands, e-mail: 
mailto:[EMAIL PROTECTED]






--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: Login problem with reverse proxy

2002-08-12 Thread JensStutte


No, i have no concrete idea. My only doubt is, that the chain
browser-proxy-tomcat must be involved, that is your redirect somehow gets
executed over this chain, otherwise the problem would not exist. I think,
there is an option to say, wether redirects should be executed via the
browser or really internally, but i don't remember, where...

Regards,

Jens Stutte



   
  
Barney Hamish  
  
Hamish.Barney@ect-teTo: 'Tomcat Users List' 
  
lecoms.de   [EMAIL PROTECTED]  
  
 cc:   
  
09/08/2002 13.52 Subject: RE: Login problem with 
reverse proxy   
Please respond to  
  
Tomcat Users List
  
   
  
   
  




Thanks Jens. I'm afraid that doesn't help with my specific problem. This is
something to do with the forwarding of requests to the login page that
Tomcat does internally. I'm not sure how I can avoid that in the way I
design my application (if I want to use the built-in authentication method
without modifying the way Tomcat handles realms).
Do you know how I can deal with this specific problem?
Thanks,
Hamish



-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 09, 2002 12:58 PM
To: Tomcat Users List
Subject: Re: Login problem with reverse proxy



Sorry for the empty mail, i struggled with my Lotus client (who the heck
creates a dialog box that defaults to Send when closing a modified mail
without sending it ?)...

I have a similar configuration here (slightly complicated due to the use of
struts). You must follow some rules in your design, to be able to do this:
- do not use browser redirects, but internal redirects. Or create
dynamically JavaScript redirects on your pages (not very nice, i know).
- use only relative URLs. Otherwise, especially if your application does
not map to your proxys root directory but some subfolder, nothing will
work.
- if you use struts, be aware of some tags, that create absolut URL pathes
(the form tag for example). I extended and overrided some of these tags in
order to create relative pathes (the struts community has decided, to not
treat this issue).

Hence, the most existing J2EE applications, that are not designed and
tested for a similar environment, most likely won't work without
modifications.

Regards,

Jens Stutte





JensStutte@qu

idinfo.itTo: Tomcat Users List

 [EMAIL PROTECTED]

09/08/2002   cc:

11.46Subject: Re: Login problem
with
reverse proxy
Please

respond to

Tomcat Users

List










Barney Hamish

Hamish.Barney@ect-teTo:
'[EMAIL PROTECTED]'
lecoms.de
[EMAIL PROTECTED]
 cc:

09/08/2002 11.32 Subject: Login problem
with reverse proxy
Please respond to

Tomcat Users List











Hi,
I'm using tomcat 3.2 with form based login and an apache reverse proxy to
filter requests to the webserver. When tomcat issues the redirect to the
login page the users are sent directly to the webserver not the reverse
proxy. As the webserver is not directly accessable they are unable to
request the log-in page. Is anyone aware of a way I can configure tomcat
and
or the reverse proxy to make this set-up work?


More info:

-Internet--
   |
Reverse Proxy
   |
Private Net
   |
Webserver (with Tomcat)

When a request for a secure resource is sent to the reverse proxy, it
forwards that request to the webserver. If the user is not logged-in tomcat
tries to redirect the user to the login form. In that redirect Tomcat
apparently includes the IP address of the server upon which it is currently
residing. The reverse proxy forwards the webserver's response to the
client.
When the client tries to request the log-in page from the directly from the
webserver it is unable to reach the webserver.

Hamish

--
To unsubscribe, e-mail

Re: Login problem with reverse proxy

2002-08-09 Thread JensStutte

   
  
Barney Hamish  
  
Hamish.Barney@ect-teTo: 
'[EMAIL PROTECTED]'  
lecoms.de   [EMAIL PROTECTED]  
  
 cc:   
  
09/08/2002 11.32 Subject: Login problem with 
reverse proxy   
Please respond to  
  
Tomcat Users List
  
   
  
   
  








Hi,
I'm using tomcat 3.2 with form based login and an apache reverse proxy to
filter requests to the webserver. When tomcat issues the redirect to the
login page the users are sent directly to the webserver not the reverse
proxy. As the webserver is not directly accessable they are unable to
request the log-in page. Is anyone aware of a way I can configure tomcat
and
or the reverse proxy to make this set-up work?


More info:

-Internet--
   |
Reverse Proxy
   |
Private Net
   |
Webserver (with Tomcat)

When a request for a secure resource is sent to the reverse proxy, it
forwards that request to the webserver. If the user is not logged-in tomcat
tries to redirect the user to the login form. In that redirect Tomcat
apparently includes the IP address of the server upon which it is currently
residing. The reverse proxy forwards the webserver's response to the
client.
When the client tries to request the log-in page from the directly from the
webserver it is unable to reach the webserver.

Hamish

--
To unsubscribe, e-mail:   
mailto:[EMAIL PROTECTED]
For additional commands, e-mail: 
mailto:[EMAIL PROTECTED]






--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: Login problem with reverse proxy

2002-08-09 Thread JensStutte


Sorry for the empty mail, i struggled with my Lotus client (who the heck
creates a dialog box that defaults to Send when closing a modified mail
without sending it ?)...

I have a similar configuration here (slightly complicated due to the use of
struts). You must follow some rules in your design, to be able to do this:
- do not use browser redirects, but internal redirects. Or create
dynamically JavaScript redirects on your pages (not very nice, i know).
- use only relative URLs. Otherwise, especially if your application does
not map to your proxys root directory but some subfolder, nothing will
work.
- if you use struts, be aware of some tags, that create absolut URL pathes
(the form tag for example). I extended and overrided some of these tags in
order to create relative pathes (the struts community has decided, to not
treat this issue).

Hence, the most existing J2EE applications, that are not designed and
tested for a similar environment, most likely won't work without
modifications.

Regards,

Jens Stutte



   
  
JensStutte@qu  
  
idinfo.itTo: Tomcat Users List   
  
 [EMAIL PROTECTED]  
  
09/08/2002   cc:   
  
11.46Subject: Re: Login problem with reverse 
proxy   
Please 
  
respond to 
  
Tomcat Users  
  
List  
  
   
  
   
  





Barney Hamish

Hamish.Barney@ect-teTo:
'[EMAIL PROTECTED]'
lecoms.de
[EMAIL PROTECTED]
 cc:

09/08/2002 11.32 Subject: Login problem
with reverse proxy
Please respond to

Tomcat Users List











Hi,
I'm using tomcat 3.2 with form based login and an apache reverse proxy to
filter requests to the webserver. When tomcat issues the redirect to the
login page the users are sent directly to the webserver not the reverse
proxy. As the webserver is not directly accessable they are unable to
request the log-in page. Is anyone aware of a way I can configure tomcat
and
or the reverse proxy to make this set-up work?


More info:

-Internet--
   |
Reverse Proxy
   |
Private Net
   |
Webserver (with Tomcat)

When a request for a secure resource is sent to the reverse proxy, it
forwards that request to the webserver. If the user is not logged-in tomcat
tries to redirect the user to the login form. In that redirect Tomcat
apparently includes the IP address of the server upon which it is currently
residing. The reverse proxy forwards the webserver's response to the
client.
When the client tries to request the log-in page from the directly from the
webserver it is unable to reach the webserver.

Hamish

--
To unsubscribe, e-mail:   
mailto:[EMAIL PROTECTED]
For additional commands, e-mail: 
mailto:[EMAIL PROTECTED]






--
To unsubscribe, e-mail:   
mailto:[EMAIL PROTECTED]
For additional commands, e-mail: 
mailto:[EMAIL PROTECTED]






--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: memory usage (longish)

2002-07-08 Thread JensStutte


I cannot help you on the real problem, but i think both kinds of error are
the same. The missing memory in your free output seems to be gone into
linux' file system buffers and cache (cache: 1082072, nearly 1GB). So
almost every file on your hard drive most likely has been cached ;-). If
any other real process needs memory, linux automatically reduces its
cache. So don't worry too much about low memory, until the cache usage is
high in the output of free.

I don't think, that this is a tomcat issue, but a jvm problem. On our
servers we usually use the IBM jdk 1.3, which for my experience is more
stable in a server environment (while for client applications with swing i
always use a sun jdk) and does not produce these annoying server stops on
garbage collection, if your application uses many little objects. It uses
more memory on startup of the server, but then usually grows slower.

Jens Stutte



   
  
Simon Juden
  
Simon.Juden@ProQuestATo: 
'[EMAIL PROTECTED]' 
lison.com[EMAIL PROTECTED] 
  
  cc:  
  
08/07/2002 12.04  Subject: memory usage (longish)  
  
Please respond to  
  
Tomcat Users List
  
   
  
   
  




Got a funny problem with memory usage.  Initially assumed likely to be a
linux issue.  Had the problem on RedHat 6.2, upgraded to RedHat 7.3, still
have the problem.  Not sure now if it's a linux or tomcat issue.

Set-up/environment: Red Hat (now 7.3, with ext3), 1xi686 processor, 1.5Gb
memory, Apache 1.3.26, Tomcat 3.2.4, JVM 1.3.1_01 (for the curious there
are
plans to upgrade these latter three elements but not yet).  There are four
of these in a webserver farm (hardware-accelerated SSL and loadbalancing
happens before traffic gets near the farm).  The problem happens on two of
the four boxes occasionally, on one fairly often and on the fourth almost
every other day.

There are two ways the problem manifests itself.  The most usual is as
follows.

Run webapp in tomcat (max heap size set to 500Mb).  After some time Tomcat
falls over with a an OutOfMemoryError.  When it does this it is only using
about 150Mb total (so in particular heap well under 500mb max) reported
under ps, top etc.

However the box reports all but a few megs of the 1.5Gb in use.  It reports
all this as still in use when every single java process (and every process
my clients wrote) is shut down.  There's about 60 Mb-worth of usage from
the
CPU processes and that's all I can account for.  There is virtually no swap
space usage though there's plenty available.  The output of free (after
tomcat and all non-canonical processes shut down) is:

[root@prodfarm3 logs]# free
 total   used   free sharedbuffers cached
Mem:   15480841351560 196524  0 1069001082072
-/+ buffers/cache: 1625881385496
Swap:   538136  0 538136

Load averages are not high throughout any of this (1.6-1.7 or so).

I know the DMA can take memory (but surely not this much and not for so
long).  I can't for the life of me think what could be using all the rest.


The other way the problem manifests itself is that Tomcat falls over with
an
OutOfMemoryError but there are still several hundred megs still available
on
the linux box.  The webapp does not allocate huge objects - I can fully
load it on the test box with a bunch of (robot) users and it uses about 200
megs or so.  So how it finds itself out of memory in this instance I don't
know.  I'm not sure if this is the same problem or a different one.

I've written a few robots and bombarded a test box (identical
configuration,
except less physical memory, only 250Mb) with a bunch of concurrent user
sessions.  Different phenomena totally: load average soars (to about 8-9)
but java correctly handles its memory and the thing doesn't die.  However
after an extended run turning tomcat off again leaves 248 of 250Mb reported
in use (but this doesn't seem to be a problem when rerunning stuff).  But
my
point is this isn't happening because 

Re: Property file for a WAR

2002-07-03 Thread JensStutte


I don't think, you can change a property file at runtime, because the java
class loaders usually cache classes and other resources during runtime.
Without at least an application reload the changes won't be active.
Application specific configurations i usually put into a properties file
situated in WEB-INF/classes, in that way at least i can modify it after the
war has been unpacked and restart the application.

Jens Stutte



   
 
Søren Neigaard 
 
s.neigaard@mobilTo: [EMAIL PROTECTED]  
 
ethink.dk   cc:   
 
 Subject: Property file for a WAR  
 
03/07/2002 13.51   
 
Please respond to  
 
Tomcat Users  
 
List  
 
   
 
   
 




Hi

If I want to have a property file for my application, and I must be able to
edit this file at runtime, where should I place it, and how do I now on
runtime where it is placed (as I have no idea where the WAR file will be
placed)?

How do you guys do it, it must be common problem :)

Med venlig hilsen/Best regards
Søren Neigaard
System Architect

Mobilethink A/S
Arosgaarden
Åboulevarden 23, 5.sal
DK - 8000 Århus C
Telefon: +45 86207800
Direct: +45 86207810
Fax: +45 86207801
Email: [EMAIL PROTECTED]
Web: www.mobilethink.dk



--
To unsubscribe, e-mail:   
mailto:[EMAIL PROTECTED]
For additional commands, e-mail: 
mailto:[EMAIL PROTECTED]






--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]