Before writing a simple JSP to do the stress test, did not expect a problem is when the pressure is relatively large, run a long time will appear a phenomenon, that is, the JVM's memory is almost exhausted, with Jprofiler view will find that there is a Concurrenthashmap object Memory has been growing, and there are no signs of release, and then into debug mode, tracking find who has new Concurrenthashmap, because the test scenario is a very simple JSP page, found that only the JSP request session will create this Concurrenthashmap, long time no JSP, guessing is the default timeout time for the request session is too long, resulting in high pressure (200 concurrent, a total of 500,000 consecutive visits, JVM memory 1G) will occur memory has not been recycled problem, It was later printed. The default timeout for the request session (as is JBoss 4.2.2), is half an hour, if so it is true that the above memory has been occupied by the phenomenon.
This JSP is this, very simple:
<% @pagecontentType = "TEXT/HTML;CHARSET=GBK"%>
Justtest.
The specific reasons for this problem need to be combined with the mechanism of Session, the session mechanism of the article is quite a lot of interest can see the following two articles:
Http://www.builder.com.cn/2007/1123/650439.shtml
http://bbs.chinaunix.net/viewthread.php?tid=1178466
What about the question? can only say session with the time to be very careful, after all, is to consume memory resources, and usually the session will not be configured as an instant invalidate, are a certain amount of time out, in such cases, if the scope of the timeout in the time of high traffic is very likely to cause problems, so the reasonable setting of the timeout is very important.
PS: Long time no play JSP and session, really did not pay attention to this situation, for familiar with the JSP and session mechanism of the person may be common sense
, ^_^, forgive forgive me.
If you don't need a session on the page, you can do this:
<%@ page session= "false"%>