If there are any garbage collection problems or another object is referencing the ThreadLocal objects, then they cannot get garbage collected and therefore the native memory does not get freed either. When a thread is released the memory it was holding onto is dereferenced for garbage collection. This native memory footprint issue can sometimes occur when data is attached to thread pool threads, via ThreadLocal java objects, and these threads are frequently created and destroyed. If the application server is short on native memory, sometimes disabling the AIO native library can increase the available address space for native memory.ĭisabling AIO (Asynchronous Input/Output) native transport in WebSphere Application ServerĤ. But this faster performance, different timing, and slightly different threading design can increase the native memory footprint. In general, running the WebSphere Application Server TCP Channel in AIO mode gives better performance and scalability than using the TCP Channel in NIO mode. (WebSphere Application Server 6.1 and higher). Setting the WebSphere Application Server WebContainer to synchronous modeģ. See the following page for more detail and instructions: The downside of synchronous mode is that it will use a thread exclusively during the response. We can reduce the native memory footprint by setting a WebContainer property to send responses in synchronous mode. The WebContainer may store a large number of buffers in native memory when sending large responses back to the requesters asynchronously. If you are seeing a native OutOfMemoryError on Linux on zSeries, you will want to reduce the heap size if it is more than 600m.Ģ. In fact you have to make special operating system settings if you want a heapsize greater than 800m (mapped_base). This makes the available space for the Java heap and native much less. With only 31 bits, the address space is half that of 32bit addressing (2**31 = 2GB). The Java Virtual Machine (JVM) version shows 32bit, but this is incorrect.
When it is not 64bit WebSphere Application Server, it will be 31bit. NOTE: zSeries machines have 31bit and 64bit versions. The heap may have only expanded to 256m, but if the max heap is set to 1792m, then 1792m of address space is reserved and there will only be just over 256m available for native memory use.
It is the max heap setting here, not just how large the heap has expanded to. When you increase the Java heap size you are decreasing the native area, as it only has what is left over from the heap. This address space is shared by theJava heap and the native area.
#EXPANDED MEMORY NOTE 9 CODE#
This leaves just over 2GB of address space for a process's code to use (in this case Java). This is used for operating system libraries, etc. In each process, the operating system reserves just under 2GB of the address space. If your maximum heap size is 1536m or higher, we will want to lower it to 1280m or even 1024m.Įach 32bit process has an address space of 2 ** 32, (for example., 4,294,967,296) bytes or 4GB. If the maximum heap size is too big, the address space reserved for it will encroach on the native memory area, causing there to not be enough native memory for the app server. Since the native memory area is the memory for the process left over from the Java heap, the larger the heap, the smaller the native area. If you have a 64bit install, please bypass this step, the heap size will not be causing the problem. This is the most common cause for native memory problems in 32bit WebSphere Application Server installs. If these steps do not solve your native memory issue, IBM support will guide you through the rest.ġ. They are all trying to reduce the native memory used (the native memory footprint) so both the java heap memory and native memory can fit in the address space for the application server process.
#EXPANDED MEMORY NOTE 9 TRIAL#
There are no comparable heapdumps for native memory, so we have to use trial and error, going through each of the potential native memory users until we find the one that is causing the problem.įollowing are the most common causes of native memory issues in WebSphere Application Server, so you should try them first. The first case is called Java heap exhaustion and the second, a native memory issue.įinding the users of native memory can be a lengthy process, as there is no way of knowing which code allocated the native memory. There are two types of memory problems which will throw an OutOfMemoryError: If a Java™ object cannot be allocated or if there is no more memory available for native code allocations (c malloc) or threads.