tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Luba Powell" <luba...@bellatlantic.net>
Subject Re: memory allocation
Date Thu, 14 Jun 2001 19:11:18 GMT
Not to worry.
The only time that I know you need to set objects to null
is when you write servers and inside you (while (true)..
eternal loop.

----- Original Message -----
From: <altuga@koc.net>
To: <tomcat-user@jakarta.apache.org>
Sent: Thursday, June 14, 2001 1:41 PM
Subject: memory allocation


hi all , i want to ask something about jsp pages

sample jsp code  =
**************************************************************
<%@ page import = "java.util.*" %>
<%@ page import = "MyBean" %>
<%@ page contentType="text/html;charset=ISO-8859-9" %>


<jsp:useBean id="my_bean" class="MyBean" scope="page"/>

<html>
<head>

<%
ArrayList al = new ArrayList();

mybean.showData(al); // we are going to fill
ArrayList
Iterator it = al.iterator();
while( it.hasNext() ) {
%>
<%=(String)it.next()%>
<%
} //while

al = null ; // should i  do this ?  or is it going to be
garbage collected by itself
it = null  ; // shoul i do this   ? or is it going to be
garbage collected by itself

%>
</head>
</html>
**************************************************************

my_bean  object will be garbage collected  because it' scope is page but
what about  ArrayList and Iterator  objects  ?

thanks

Regards

Altug B. Altıntas







Mime
View raw message