Troubleshooting
Problem
Your WebSphere MQ (WMQ) 32-bit Java™ program fails with ENOMEM from shmat. This indicates that there is no 32-bit data space available within the process to attach the requested memory segment.
Symptom
FDC Details
---------------------------------------------------------------------------
Probe Id :- XY129011
Component :- xstConnectExtent
Program Name :- java
Addressing mode :- 32-bit
Comment1 :- Failed to attach shared memory segment: shmat(ShmId
0x003b001e) ?rc=-1 errno=12? Cannot allocate memory
.
MQM Function Stack
zstMQConnect
zstInitCS
xcsInitialize
xcsConnectSharedSubpool
xcsAttachSharedSubpool
xcsConnectSharedMemSet
xstAttachSharedMemSet
xstConnectExtent
xcsFFST
Diagnosing The Problem
- Monitor the memory used, so you know the size of the failing shared memory segment.
- Issuing following commands every half hour or so :
Date >> out.log
ps -efl >> out.log
ps aux >> out.log
ipcs -a >> out.log
pmap <pid_process_java_getting_the_error> >> out.log
The ps output has columns which indicate the memory used by each process.
The ipcs output shows the shared memory in use.
The cumulative output would show whether there was any growth in memory use.
The output from these commands should be evaluated by the UNIX system administrator as they would be better suited to analyze the operating system output.
Resolving The Problem
- If you use a WebSphere MQ V6 or V7 64-bit queue manager, then upgrading your applications to 64-bit could eliminate then these kinds of resource issues. However, we understand that there could be reasons why that may not be possible.
- If you cannot migrate the application to 64-bit, or the Queue Manager being used is 32-bit, then it may be a good practice to end the application infrequently (Example: once a month).
- Examine the Java process to determine why it has requested 32-bit address space requirements. The Java heap could be configured in such a way that it does not leave very much 32-bit storage for other data.
- Another way to keep this from occurring is to switch from bindings mode to client connection.
- You could also reduced the size of the address space that the Java application uses, by reducing the size of the heap space and, or MaxPermSize.
Product Synonym
WebSphere MQ WMQ
Was this topic helpful?
Document Information
Modified date:
15 June 2018
UID
swg21369950