glassfish 中的 Java 堆空间错误

发布于 2024-07-14 17:26:06 字数 2378 浏览 9 评论 0原文

我使用的是全新的 Glassfish 安装,几乎没有进行任何定制。

我有一个消息驱动 Bean (ObjectUpdateMDB),它侦听主题,然后更新它在数据库中接收的对象。 有很多对象正在更新。 运行一段时间后,我收到此异常:

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

看起来这是堆空间的问题。 我需要调整堆空间做什么? 应用程序服务器本身还是代理? 我该怎么做呢?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

场罚期间 2024-07-21 17:26:06

我使用了以下 asadmin 命令来对 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'

它是 Michael Myers 提示的变体。 使用 asadmin 命令可以轻松重复更改。

我还切换到了新的 G1 收集器,它比普通收集器好很多。 对 Eclipse 也有帮助;-)

请注意,语法适用于 Windows 上的 TakeCommand。 如果您使用 shell 和操作系统的不同组合,则可能需要不同的转义字符(即,对于大多数 unix shell,使用海峡标记而不是反引号)。

如果您使用 *-jvm-options 命令搞乱了设置,那么您可以使用 domain.xml 文件修复它。

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.

带上头具痛哭 2024-07-21 17:26:06

我的博客上有一篇关于 VM 的帖子调优,我将向读者推荐 Java 调优白皮书< /a>.

无论如何,为了让您快速得到答案,您可能应该研究几个基本设置:

-Xms:初始堆大小

-Xmx:最大堆大小

要获得这些的快速描述,只需运行:java -X.

./亚历克斯

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

岛歌少女 2024-07-21 17:26:06

我不知道这是否相关,但是在使用 XA 事务时我们遇到了一些奇怪的异常,导致了 CORBA 异常。 原因是 MySQL 驱动程序,我们升级到最新的 MySQL JDBC 驱动程序(5.1.7),然后这些 XA 问题就消失了。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文