Question

I am using a fresh Glassfish install with very little customizations.

I have a Message Driven Bean (ObjectUpdateMDB) that listens to a topic, then updates the object it receives in a database. There are a lot of objects being updated. After a while of running I get this exception:

SEVERE: JTS5031: Exception [org.omg.CORBA.INTERNAL:   vmcid: 0x0  minor code: 0 completed: Maybe] on Resource [rollback] operation.
SEVERE: MDB00049: Message-driven bean [Persistence:ObjectUpdateMDB]: Exception in postinvoke : [javax.transaction.SystemException: org.omg.CORBA.INTERNAL: JTS5031: Exception [org.omg.CORBA.INTERNAL:   vmcid: 0x0  minor code: 0 completed: Maybe] on Resource [rollback] operation.  vmcid: 0x0  minor code: 0  completed: No]
SEVERE: javax.transaction.SystemException
javax.transaction.SystemException: org.omg.CORBA.INTERNAL: JTS5031: Exception [org.omg.CORBA.INTERNAL:   vmcid: 0x0  minor code: 0 completed: Maybe] on Resource [rollback] operation.  vmcid: 0x0  minor code: 0  completed: No
    at com.sun.jts.jta.TransactionManagerImpl.rollback(TransactionManagerImpl.java:350)
    at com.sun.enterprise.distributedtx.J2EETransactionManagerImpl.rollback(J2EETransactionManagerImpl.java:1144)
    at com.sun.enterprise.distributedtx.J2EETransactionManagerOpt.rollback(J2EETransactionManagerOpt.java:426)
    at com.sun.ejb.containers.BaseContainer.completeNewTx(BaseContainer.java:3767)
    at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:3571)
    at com.sun.ejb.containers.MessageBeanContainer.afterMessageDeliveryInternal(MessageBeanContainer.java:1226)
    at com.sun.ejb.containers.MessageBeanContainer.afterMessageDelivery(MessageBeanContainer.java:1197)
    at com.sun.ejb.containers.MessageBeanListenerImpl.afterMessageDelivery(MessageBeanListenerImpl.java:79)
    at com.sun.enterprise.connectors.inflow.MessageEndpointInvocationHandler.invoke(MessageEndpointInvocationHandler.java:139)
    at $Proxy98.afterDelivery(Unknown Source)
    at com.sun.messaging.jms.ra.OnMessageRunner.run(OnMessageRunner.java:324)
    at com.sun.enterprise.connectors.work.OneWork.doWork(OneWork.java:76)
    at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:555)

INFO: MDB00037: [Persistence:ObjectUpdateMDB]: Message-driven bean invocation exception: [java.lang.OutOfMemoryError: Java heap space]
INFO: java.lang.OutOfMemoryError
java.lang.OutOfMemoryError: Java heap space

Looks like it is an issue with Heap Space. What do I need to adjust the heap space for? The App Server itself or the Broker? How do I do this?

Was it helpful?

OTHER TIPS

I have used the following asadmin commands to sort the problem on Glassfish 3.1:

asadmin create-jvm-options --target server-config -- '-XX\:+UnlockExperimentalVMOptions'
asadmin create-jvm-options --target server-config -- '-XX\:+UseG1GC'
asadmin delete-jvm-options --target server-config -- '-Xmx512m'
asadmin create-jvm-options --target server-config -- '-Xmx1024m'
asadmin delete-jvm-options --target server-config -- '-XX\:MaxPermSize=192m'
asadmin create-jvm-options --target server-config -- '-XX\:MaxPermSize=256m'

asadmin create-jvm-options --target default-config -- '-XX\:+UnlockExperimentalVMOptions'
asadmin create-jvm-options --target default-config -- '-XX\:+UseG1GC'
asadmin delete-jvm-options --target default-config -- '-Xmx512m'
asadmin create-jvm-options --target default-config -- '-Xmx1024m'
asadmin delete-jvm-options --target default-config -- '-XX\:MaxPermSize=192m'
asadmin create-jvm-options --target default-config -- '-XX\:MaxPermSize=256m'

It is a variation on Michael Myers hint. Using asadmin commands makes the change easily repeatable.

Also I switched to the new G1 collector which is a lot better then the normal collector. Helps with Eclipse as well ;-)

Note that syntax is for TakeCommand on Windows. If you use a different combination of shell and OS you might need different escape characters (i.E. strait ticks instead of backticks for most unix shells).

If you mess your setup up with the *-jvm-options commands then you can fix it with domain.xml file.

I have a post on my blog about VM tuning and I'm pointing readers to the Java Tuning White Paper.

Anyways, to get you a quick answer you should probably look into a couple of basic settings:

-Xms: initial heap size

-Xmx: maximum heap size

To get a quick descriptions for these just run: java -X.

./alex

I don't know if this is related, but we got some strange exceptions when using XA Transactions which resulted in CORBA exceptions. The reason was the MySQL driver and we upgraded to the latest MySQL JDBC driver (5.1.7) and then these XA problems disappeared.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top