weblogic weblogic.servlet.internal.session.MemorySessionData对象过多导致内存溢出
2016-05-20 12:38
1531 查看
用MAT分析DUMP文件,可以发现weblogic.servlet.internal.session.MemorySessionData过多,
SELECT * FROM weblogic.servlet.internal.session.MemorySessionData 对象有120万之多,占用900M的内存。
当一个用户登陆之后,在会在weblogic里面生成一个MemorySessionData对象,这个对象生命周期是weblogic控制,通过web.xml中的一个配置项。
<session-config>
<session-timeout>300000</session-timeout>
</session-config>
这里的单位是分钟
To look for session objects collected in the heap, you first need to know the session persistence method used by the customer's application. The same can be found out from the application's weblogic.xml file. In
the example, the following entries are made in the weblogic.xml:
<weblogic-web-app xmlns="http://www.bea.com/ns/weblogic/90">
<session-descriptor>
<persistent-store-type>replicated</persistent-store-type>
</session-descriptor>
</weblogic-web-app>
The tag "persistent-store-type" governs which class WLS would internally use to store the session objects; this is important to the debugging aspect while reviewing the heap dump. Valid values for the "persistent-store-type"
and the corresponding classes used are listed below.
Oracle WebLogic Server - Version 10.3.5 and later
Information in this document applies to any platform.
There is huge consumption of memory in the production environment. A memory dump shows two WebLogic classes as leak suspects:
weblogic.servlet.internal.session.MemorySessionContext (66.05%)
weblogic.servlet.internal.session.MemorySessionData (21.52%)
The "session-timeout" value in in web.xml is set to 1 hour (3600 seconds) by default. If the session is not invalidated or timed out in application code, each session will live for that full hour, causing objects
to accumulate until the container times the session out. Combine this with heavy traffic (so lots of sessions opened), and this causes huge memory consumption.
To find if there are any invalid sessions lingering in the heap after a particular time, it is recommended that the application explicitly call
user logs out. However WLS also provides a mechanism to expire sessions after a specific interval that is referred to as the "session-timeout" parameter in the web.xml. The value set in this element overrides the value set in the TimeoutSecs attribute of the
element in the WebLogic-specific deployment descriptor weblogic.xml. If nothing is specified the default value of 3600 seconds is used. See Session
Timeout for more information.
To reduce the memory consumption from HTTP session objects, please follow these steps:
Ensure that the application code explicitly calls
Lower the "session-timeout" value set in in web.xml to (for example) 15 minutes.
SELECT * FROM weblogic.servlet.internal.session.MemorySessionData 对象有120万之多,占用900M的内存。
当一个用户登陆之后,在会在weblogic里面生成一个MemorySessionData对象,这个对象生命周期是weblogic控制,通过web.xml中的一个配置项。
<session-config>
<session-timeout>300000</session-timeout>
</session-config>
这里的单位是分钟
To look for session objects collected in the heap, you first need to know the session persistence method used by the customer's application. The same can be found out from the application's weblogic.xml file. In
the example, the following entries are made in the weblogic.xml:
<weblogic-web-app xmlns="http://www.bea.com/ns/weblogic/90">
<session-descriptor>
<persistent-store-type>replicated</persistent-store-type>
</session-descriptor>
</weblogic-web-app>
The tag "persistent-store-type" governs which class WLS would internally use to store the session objects; this is important to the debugging aspect while reviewing the heap dump. Valid values for the "persistent-store-type"
and the corresponding classes used are listed below.
Persistent Store Type | WLS Implementation Class |
---|---|
memory | weblogic.servlet.internal.session.MemorySessionData |
replicated | weblogic.servlet.internal.session.ReplicatedSessionData |
async-replicated | weblogic.servlet.internal.session.AsyncReplicatedSessionData |
file | weblogic.servlet.internal.session.FileSessionData |
async-jdbc | weblogic.servlet.internal.session.AsyncJDBCSessionData |
jdbc | weblogic.servlet.internal.session.JDBCSessionData |
cookie | weblogic.servlet.internal.session.CookieSessionData |
APPLIES TO:
Oracle WebLogic Server - Version 10.3.5 and laterInformation in this document applies to any platform.
SYMPTOMS
There is huge consumption of memory in the production environment. A memory dump shows two WebLogic classes as leak suspects:weblogic.servlet.internal.session.MemorySessionContext (66.05%)
weblogic.servlet.internal.session.MemorySessionData (21.52%)
CAUSE
The "session-timeout" value in in web.xml is set to 1 hour (3600 seconds) by default. If the session is not invalidated or timed out in application code, each session will live for that full hour, causing objectsto accumulate until the container times the session out. Combine this with heavy traffic (so lots of sessions opened), and this causes huge memory consumption.
To find if there are any invalid sessions lingering in the heap after a particular time, it is recommended that the application explicitly call
session.invalidate()to invalidate a session after the
user logs out. However WLS also provides a mechanism to expire sessions after a specific interval that is referred to as the "session-timeout" parameter in the web.xml. The value set in this element overrides the value set in the TimeoutSecs attribute of the
element in the WebLogic-specific deployment descriptor weblogic.xml. If nothing is specified the default value of 3600 seconds is used. See Session
Timeout for more information.
SOLUTION
To reduce the memory consumption from HTTP session objects, please follow these steps:Ensure that the application code explicitly calls
session.invalidate()when a user logs out of their session.
Lower the "session-timeout" value set in in web.xml to (for example) 15 minutes.
相关文章推荐
- 安卓APP关于切图标
- 【Android学习札记】数据类型
- Spring Bean的范围
- CodeForces - 672B Different is Good (模拟)水
- 挑战 Random Walk[高斯消元&&期望]
- Linux配置防火墙
- js继承
- Android 图片闪烁(延迟切换)
- 国家网信办开展网址导航网站专项治理行动
- 国家网信办开展网址导航网站专项治理行动
- 7.spark Streaming 技术内幕 : 从DSteam到RDD全过程解析
- SQL
- android获取拍照图片、本地图片简单实现!
- (4.1.27.4)NI/NDK开发指南(一)——JVM查找java native方法的规则
- 那一阙词,早已波澜-仓央嘉措
- 合并两个有序链表(递归非递归方法)
- Java+WebSocket+WebRTC实现视频通话实例
- 滑块控件
- 垂直居中display:table;
- 辞职