Hi Dustin,
There are a myriad of reason why the Java VM can appear to leak memory,
mostly (all?) due to your objects still being referenced somewhere in
your software that you didn't expect.
But in the case of JSP and specifically the JSWDK, I have come across
one tricky fact that caused a similar situation to the one you
described. By default, the JSWDK JSP implementation leaves the session
timeout value as "never timeout" (-1 from memory). This means that,
unless you explicity invalidate your sessions, they will continue to
exist in the container until it is restarted. Of course, each time a
user closes their browser, they loose the session cookie and get
allocated a new session when they next visit. This was causing our web
apps to hemorrage memory under NT until the "out of virtual memory error
occurred"
I have since added the somthing similar to the following code to our
globally included jsp header file :
session.setMaxInactiveInterval(barrack.jsp.JSPUtil.SESSION_TIMEOUT_SECS)
;
This appears to have fixed our "memory leak" 100%. Many thanks to Craig
McClanahan for helping with this one!
Regards
Drew Cox
Barrack Consulting
> -----Original Message-----
> From: Dustin Aleksiuk [SMTP:[EMAIL PROTECTED]]
> Sent: Saturday, November 06, 1999 7:02 AM
> To: [EMAIL PROTECTED]
> Subject: advice on memory leak
>
> I'm having a small problem and I'm wondering if anyone could give me
> some advice. I'm somewhat new to java and jsp, coming from a C++
> background.
>
> We have a fairly involved e-commerce operation which we are
> implementing in JSP. After about a day or so of fairly good testing
> we start getting an 'out of memory' error.
> We're developing on NT, but our servers run on Solaris. Our test
> server is the basic little Java server that comes with the JSWDK that
> you get from Sun.
>
> Questions:
>
> Has anyone experienced this? Could it be the Web Server we're using
> for our testing (meaning the problem will go away when we move to a
> better web server)?
>
> Also: where should I start looking for this, if the bug is in my code?
>
> Has anyone done any extensive testing on the Jswdk server (or whatever
> it's called) for an extended period of time?
>
> Thanks a lot,
>
> Dustin Aleksiuk
>
> [EMAIL PROTECTED]
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html