Bug 49116 - Memory leak by HttpSession.
Memory leak by HttpSession.
Status: RESOLVED FIXED
Product: Tomcat 6
Classification: Unclassified
Component: Catalina
6.0.26
All All
: P2 normal (vote)
: default
Assigned To: Tomcat Developers Mailing List
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2010-04-14 04:43 UTC by Keiichi Fujino
Modified: 2010-05-10 04:42 UTC (History)
0 users



Attachments
If session is already invalid, expire session to prevent memory leak. (865 bytes, text/plain)
2010-04-14 04:45 UTC, Keiichi Fujino
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Keiichi Fujino 2010-04-14 04:43:30 UTC
When session is stored in StandardManager#doUnload method, 
an invalid session is stored. 

For instance, 
If HttpSession#invalidate is executed while executing StandardManager#doUnload,
session of "isValid=false" is stored.

The session of isValid=false is restored in StandardManager#doLoad, 
and it registers in session map (sessions). 
However, no one can invalidate this session. 

If isValid is false, StandardSession#invalidate() and StandardSession#isValid() can not expire session.
They are throws IllegalStateException or return immediately. 

Consequently, the session of isValid=false is never deleted from the session map(sessions). 

I made a patch.
If session is already invalid, expire session to prevent memory leak.

Best Regards.
Keiichi.
Comment 1 Keiichi Fujino 2010-04-14 04:45:10 UTC
Created attachment 25290 [details]
If session is already invalid, expire session to prevent memory leak.
Comment 2 Keiichi Fujino 2010-04-14 04:57:53 UTC
Fixed in trunk and proposed for 6.0.x.
Comment 3 Keiichi Fujino 2010-05-10 04:42:59 UTC
This fix applied to 6.0, will be in 6.0.27 onwards.