Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java Heap Space error in glassfish

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?

like image 330
mainstringargs Avatar asked Mar 04 '09 21:03

mainstringargs


People also ask

How do I fix Java heap space error?

OutOfMemoryError: Java heap space. 1) An easy way to solve OutOfMemoryError in java is to increase the maximum heap size by using JVM options "-Xmx512M", this will immediately solve your OutOfMemoryError.

How do you fix heap memory problems?

There are several ways to eliminate a heap memory issue: Increase the maximum amount of heap available to the VM using the -Xmx VM argument. Use partitioning to distribute the data over additional machines. Overflow or expire the region data to reduce the heap memory footprint of the regions.

How do you increase memory in GlassFish?

In the GlassFish Server Administration Console, under Configurations, select server-config >> JVM Settings Tab >> JVM Options Sub-Tab >> Add/Modify the options... The min and max heap size options are: -XmsNNNNm and -XmxNNNNm. Generally, set max heap as large as possible given the available memory on your machine.

What is Java heap space error?

Cause: The detail message Java heap space indicates object could not be allocated in the Java heap. This error does not necessarily imply a memory leak. The problem can be as simple as a configuration issue, where the specified heap size (or the default size, if it is not specified) is insufficient for the application.


1 Answers

You need to assign more RAM to your Glassfish installation.

See http://spaquet.blogspot.com/2006/07/liferay-glassfish-part-ii-configuring.html

and http://docs.sun.com/app/docs/doc/820-4495/gepzd?a=view.

like image 184
OscarRyz Avatar answered Sep 27 '22 19:09

OscarRyz