Thread Local Area and OutOfMemoryError: nativeGetNewTLA
822988Dec 10 2010 — edited Oct 3 2011I'm running a Java server with JRockit 1.5.0. This is an "event processing" application: it reads events on a socket (SNMP port 162) and processes them by saving them to a database and then forwarding a JMS message (this is a client to a JBoss 4.2.2 server). So there are a lot of threads and a lot of socket I/O, between the incoming SNMP traps and the outgoing JDBC and JMS communication.
I recently started seeing some OutOfMemory errors in the logs for this process like the following:
java.lang.OutOfMemoryError: allocLargeObjectOrArray - Object size: 9616, Num elements: 4798
java.lang.OutOfMemoryError: mmAllocArray - Object size: 192, Num elements: 44
java.lang.OutOfMemoryError: nativeGetNewTLA
java.lang.OutOfMemoryError: allocLargeObjectOrArray - Object size: 65552, Num elements: 65536
I googled around and found the following as a way to resolve this issue:
-XXlargeObjectLimit=70k -XXtlaSize:min=70k,preferred=96k
I added these options, but still see some OutOfMemoryErrors. Seems like the large object and malloc complaints are gone, this time there are only complaints about "nativeGetNewTLA".
All processing stops once these OutOfMemoryErrors occur; nothing more is written to the database, and no more messages are written to JMS.
What can I do to fix this? Raise the tlaSize more? If so, how do I know how much to raise it to? Is there any good documentation on what this TLA feature is and under what conditions it starts operating? The total system that I work on consists of a number of Java processes, all doing a combination of network I/O, database access, and JMS, but this is the only process where I've seen these OutOfMemoryErrors occur.
I'd like to understand more about how Thread Local Areas work, as well as how to fix this problem.
Any help would be much appreciated...
Version information:
java -version
java version "1.5.0_19"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_19-b02)
BEA JRockit(R) (build R27.6.5-32_o-121899-1.5.0_19-20091001-2113-linux-ia32, compiled mode)