`
jessdy
  • 浏览: 60263 次
  • 性别: Icon_minigender_1
  • 来自: 上海虹口区
社区版块
存档分类
最新评论

IBM Websphere 内存溢出一例

    博客分类:
  • Java
阅读更多

[10-5-18 16:08:43:855 CST] 00000161 SystemErr     R Exception in thread "WebContainer : 18" java.lang.OutOfMemoryError
[10-5-18 16:08:44:470 CST] 00000161 SystemErr     R 	at java.nio.ByteBuffer.allocateDirect(ByteBuffer.java:303)
[10-5-18 16:08:44:470 CST] 00000161 SystemErr     R 	at com.ibm.ws.buffermgmt.impl.WsByteBufferPoolManagerImpl.allocateCommon(WsByteBufferPoolManagerImpl.java:514)
[10-5-18 16:08:44:470 CST] 00000161 SystemErr     R 	at com.ibm.ws.buffermgmt.impl.WsByteBufferPoolManagerImpl.allocateDirect(WsByteBufferPoolManagerImpl.java:450)
[10-5-18 16:08:44:470 CST] 00000161 SystemErr     R 	at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:472)

 解决方法:

Excessive native memory use in IBM WebSphere Application Server 6.0 and 6.1

Excessive native memory use in IBM WebSphere Application Server 6.0 and 6.1
 Technote (troubleshooting)
 
Problem(Abstract)
The use of asynchronous data transfer may require an excessive number of buffers to send data over a TCP/IP connection.


This predominately occurs when files are being transferred (e.g., a PDF being returned in a response, the dmgr updating the nodeagents, etc.) but, can also occur with normal responses from IBM® WebSphere® Application Server. 
 
Symptom
The process size for the application server or deployment manager can grow quite large.


You may also see OutOfMemoryError’s thrown and malloc errors in SystemOut.log. 
JVMDBG001: malloc failed to allocate … 
 



Cause
A new feature was added to allow the sending of data asynchronously as a performance enhancement. Unfortunately, this can require the allocation of enough buffers to contain the entire file being transferred (java.nio.DirectByteBuffer's). 


Depending on the size of the file, this can be a bad decision, as it may require a large amount of memory. There are also occasions when these buffers will not be freed up, causing even more problems with native memory utilization. 
 

Environment
WebSphere Application Server 6.0.2 and 6.1 
 

Diagnosing the problem
Check the JVM’s™ process size using operating system specific tools (e.g., ps, top, perfmon). Check the Application Server logs for malloc errors. 
 

Resolving the problem
A Java™ property can be set which will force the data transfer to be synchronous rather than asynchronous. Since the asynchronous transfer is generally faster, at least for small files, the use of synchronous transfer may result in a slight performance impact. This performance impact should be quite small, and would be far outweighed by the performance impact of the extra memory used by all of the buffers allocated by the asynchronous transfer algorithm.

This property was added in later Application Server FixPacks, so you may need to upgrade your Application Server installation before setting the property. 


1. Check if your Application Server installation is at least at 6.0.2.21 or 6.1.0.11, depending on whether you are on Application Server 6.0.2 or 6.1. If not, please install one of the FixPacks to get your installation up to that level or more recent.

2. Set the channelwritetype property to use synchronous data transfer (sync):

For an application server
In the Admin Console: 
Servers -> Application Servers -> serverName -> Web Container Settings -> Web Container -> Custom Properties:
Press New:
Add the following pair: 
Name: com.ibm.ws.webcontainer.channelwritetype
Value: sync
Press OK, and then save the configuration.

The application server must be recycled to pick up the property.


For a deployment manager
Start an interactive wsadmin session: 
<dmgr-profile-root>\bin>wsadmin -lang jacl

Copy the following block of lines, then paste them all at once at the wsadmin> prompt: 
set dmgr [$AdminConfig getid /Server:dmgr/]
set webcontainer [$AdminConfig list WebContainer $dmgr]
$AdminConfig create Property $webcontainer {{name com.ibm.ws.webcontainer.channelwritetype} {value sync}} properties
$AdminConfig show $webcontainer
$AdminConfig save

The deployment manager must be recycled to pick up the property.
,照此设置即可。

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics