hi aces

i am giving this reply with hope that it wont be too childish, if it is
useful just enjoy it or else just ignore it

finally

                       {

                         try

                         {

                         System.out.println("inside finally");

                           if (rs != null)

{

rs.close();

rs=null;

}



                                   System.out.println("final");

                         } catch (SQLException
e){System.out.println("exception
in closing " + e.getMessage());

                         }



here rs is the object reference once the http request and response is over
there is no need for this object reference, so we can assign rs=null, the
basic logic behind this is rs.close() statement is not ready for garbage
collection, it will be available only when it is set to rs=null.



If the heap size reaches the maximum, garbage collector put in to action. In
some situation rs will not be reachable, if rs is put to null means it will
be easily  collected by the garbage collector.



One more way to over memory.out.oferror is to run the garbage collector at
reasonable intervals.





bye

with regards

prakash.S





On 3/15/07, Caldarale, Charles R <[EMAIL PROTECTED]> wrote:

> From: Vinu Varghese [mailto:[EMAIL PROTECTED]
> Subject: Re: apache-tomcat-6.0.10 OutOfMemoryError
>
>  Please check this
> http://my.opera.com/karmazilla/blog/2007/03/13/good-riddance-p
> ermgen-outofmemoryerror

Unfortunately, the blogger is simply wrong in his premise that the
default GC mechanism won't collect objects in the PermGen.  All Sun JVMs
have always garbage collected unreachable class objects unless prevented
by command line options.  It's only the relatively new concurrent GC
implementation that does not, by default, free up dead classes; for
that, you need the extra parameters as described in the blog.

Enabling concurrent GC can have some side effects: it's less efficient,
requiring more CPU cycles to get the job done, and requires more
frequent, albeit very short, app pauses.  Whether it's better in your
particular environment depends entirely on the requirements of that
environment.

- Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--
Thanks and Regards
S.Prakash

Reply via email to