Hi,

I'm doing a testing on my  servlet codes and I'm using OptimizeIt for
testing. Now my servlet is calling none servlet class. And from the test I
found this big difference between calling a static method and none static
method.

static method:

   from my servlet I have this in my java code:

        HTMLProducer.getHtml(param1, param2);

When viewing this in OptimizeIt, HTMLProducer does not create another
instance and just right after finishing the request, HTMLProducer instance is
now equal to 0 (zero) or no more instance of this class already exist.


none static metho:

    from my servlet I have this in my java code:

          HTMLProducer hp = new HTMLProducer();
          hp.getHtml(param1, param2);

When viewing this in Optimizeit, every time I call the servlet, a new
instance of HTMLProducer is created. Thus, this instance will never be 0
(zero) or none. So it will continue to increase, and I seems that the garbage
collector doesn't collect this instances.

Can anybody explain to me what is difference between calling a class with
static method and none static methos? What is the advantage and disadvantage
between those two?

Thank you.

Best regards
/renz

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to