I deployed a simple web-app to glassfish v2ur2. The web app is very basic, it tests JSTL <c:set> tag.
index.jsp:
[pre]
<%@ page contentType="text/html" pageEncoding="UTF-8" %>
<%@ taglib uri="
http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
class Foo { }
class Foo2 { }
class Foo3 { }
pageContext.setAttribute("fooObj", new Foo());
pageContext.setAttribute("foo2Obj", new Foo2());
pageContext.setAttribute("foo3Obj", new Foo3());
%>
<c:set var="foo1" value="${fooObj}" />
<c:set var="foo2" value="${foo2Obj}" />
<c:set var="foo3" value="${foo3Obj}" />
[/pre]
I ran the application
http://localhost:8080/WebApplication1/ and checked the heap for Foo (leaked?) instances afterwards with
[b]jmap -histo:live <pid> | grep "Foo" [/b]
where <pid> is the glassfish process id.
The result:
[pre]
num #instances #bytes class name
289: 1 16 org.apache.jsp.index_jsp$1Foo3
[/pre]
That is a live instance of Foo3 is sitting there.
Can someone explain this behavior to me ? Is this a bug or am I missing some basic knowledge here why Foo1 and Foo2 instances are gone and Foo3 stays ?
[Message sent by forum member 'kolmis' (kolmis)]
http://forums.java.net/jive/thread.jspa?messageID=280351