-----------------------------
Please read the FAQ!
<http://java.apache.org/faq/>
-----------------------------

[EMAIL PROTECTED] wrote:

> -----------------------------
> Please read the FAQ!
> <http://java.apache.org/faq/>
> -----------------------------
>
> Hi!
>
> Im just working on some nice internet projects with JServ 1.0 (on
> Blackdown JDK1.1.7 & SuSE Linux) and Apache (1.3.6).
>
> The project is connecting to a database Oracle 8.x.x.i) using a
> (thin)JDBC Driver. To improve the performance I wrote a
> connectionpool which stores and recycles some already open
> connections.This connectionpool also runs as his own watchdog
> thread (demon-threat) to monitor the number open connections, etc.
> This works quite nice so far but when JServ is reloading, the
> connections pools is quite open.
>
> The AdaptiveClassloader seems not to close the classes he loaded
> when he is discarded?! Is this correct ??!
>
> The next (related) problem is that, there are some classes to
> manage html templates which also seem to be more or less
> persistent (?!). In the end I got a really big VM (302MB .. <uhrg!>).
>
> Any good Ideas ???!!
>
> Niclas
> --
>

The AdaptiveClassLoader, or any class loader for that matter, has no
clue that your connection pool class needs to be cleaned up.  You can
provide a finalize() method (so that the garbage collector can call it
for clean up when it is reaping the dead object), but this still leaves
the connections open until the garbage collector is called.  A better
strategy:  if you want your classes not to be thrown away when using the
auto-reload feature, you should make sure they are on the system
classpath (i.e. the wrapper.classpath variable in jserv.properties)
instead of a repositories setting in your zone.

NOTE:  Auto-reload exacts a small performance penalty on every request,
and you might want to think about how often you really need it in a
production environment, versus simply restarting the server when you
make a change.

Craig McClanahan




--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Archives and Other:  <http://java.apache.org/main/mail.html>
Problems?:           [EMAIL PROTECTED]

Reply via email to