Thanx  a lott..
This is exactly what I was looking for!!

I have used all local variables.  :-)

Regards,
Vibha


----- Original Message -----
From: Anton Tagunov <[EMAIL PROTECTED]>
To: Vibha Jindal <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Thursday, January 31, 2002 11:08 PM
Subject: Re: Garbage Collection


> Hello Vibha!
>
> VJ> Hi,
>
> VJ> I am creating instances of dataclasses in my Servlets and JSPs.
> VJ> I am not explicitly setting them to null after use.
> VJ> Could this be a problem?
> VJ> I mean, would these objects not be eligible for garbage collection or
would
> VJ> they be eligible?
>
> It depends. If you put references to classes to variables that have
> method-scope (that is local ones in doGet() f.e.) there's no problem.
> If you store them to class instance or static variables the objects
> are retained. But you have no reason to assign to static/class
> variables.
>
> With JSP what you declare inside <%! %> become class instance
> variables, best do not use them at all!
> What you declare inside <% %> are local variables.
>
> Good luck!
> VJ> Regards,
> VJ> Vibha
>
>
> - Anton
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
>
>

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

Reply via email to