dev@glassfish.java.net

SelectorThread and recycling problem

From: Roman Pokhodzhai <rpohod_at_gmail.com>
Date: Mon, 19 Jan 2009 21:03:49 +0200

Hi All,

If you use tasks recycling for
com.sun.enterprise.web.connector.grizzly.SelectorThread in your
application (it is used by default) then you get the following
reference chain that keeps the application class loader after the
application is undeployed:

--> com.sun.enterprise.web.connector.grizzly.SelectorThread_at_0xe0a64e0
(433 bytes) (field processorTasks:)
--> java.util.concurrent.ConcurrentLinkedQueue_at_0xe0ba468 (16 bytes)
(field head:)
--> java.util.concurrent.ConcurrentLinkedQueue$Node_at_0xe0caa80 (16
bytes) (field next:)
--> java.util.concurrent.ConcurrentLinkedQueue$Node_at_0x116288d0 (16
bytes) (field item:)
--> com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask_at_0xe0f6180
(169 bytes) (field request:)
--> org.apache.coyote.Request_at_0xe10bef0 (153 bytes) (field notesManager:)
--> org.apache.coyote.NotesManagerImpl_at_0xe16b140 (12 bytes) (field notes:)
--> [Ljava.lang.Object;@0xe1c6e90 (136 bytes) (Element 1 of
[Ljava.lang.Object;@0xe1c6e90:)
--> com.sun.enterprise.web.connector.coyote.PwcCoyoteRequest_at_0x10cda420
(190 bytes) (field filterChain:)
--> org.apache.catalina.core.ApplicationFilterChain_at_0x10ce8d48 (28
bytes) (field filters:)
--> [Lorg.apache.catalina.core.ApplicationFilterConfig;@0x10ce8d68 (48
bytes) (Element 0 of
[Lorg.apache.catalina.core.ApplicationFilterConfig;@0x10ce8d68:)
--> org.apache.catalina.core.ApplicationFilterConfig_at_0x10e2de48 (20
bytes) (field context:)
--> com.sun.enterprise.web.WebModule_at_0xf3b73b8 (501 bytes) (field
parentClassLoader:)
--> com.sun.enterprise.loader.EJBClassLoader_at_0xefde040 (88 bytes)

This trace shows that Request objects are not fully recycled. Their
'notes' are not recycled.
You can also see it at org.apache.coyote.Request.recycle.


It there some idea behind it? Or it's just a bug?