从 Eclipse 中使用 Portal 启动 JBoss 时出现内存不足错误
我无法让 JBoss Portal 从 Eclipse 启动,尽管从命令行启动而不是从 Eclipse 启动时,AS 单独启动正常,并且 Portal 也可以正确启动。 我运行的是 Windows,内存为 3GB。 建议? 谢谢。
I cannot get JBoss Portal to start from Eclipse, though the AS alone starts fine, and the Portal starts correctly as well, when started from the command line as opposed to from within Eclipse. I'm running in Windows, with 3GB. Suggestions? Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
根据我的实验,在 eclipse.ini 中设置的 vmargs 的所有选项仅播放一次 - 创建新工作区时。 当您想要更改现有工作区中的选项时,请使用运行/调试配置,如 https://stackoverflow.com/a/10814631 /715269。 ini 中的 vmargs 将不会再被读取。
小心,你应该设置-XX:MaxPermSize=...M,而不是-XX:PermSize=...,最后设置最小,开始PermSize。
广告。 杰里米. 将最小值和最大值设置为相同的值是没有意义的。 您剥夺了 Eclipse 的适应性。 -Xms 和 -Xmx(堆)以及 PermGen 和 MaxPermGen 应该不同。 (默认情况下 MaxPermGen =256)
According to my experiments, all options of vmargs set in eclipse.ini, plays only once - when creating a new workspace. When you want to change the options in the existing workspace, use run/debug configuration as in https://stackoverflow.com/a/10814631/715269. vmargs in ini won't be read any more.
Be careful, you should set -XX:MaxPermSize=...M, not -XX:PermSize=..., the last sets minimal, starting PermSize.
ad. Jeremy. It is senseless to put mins and maxs to the same value. You deprive Eclipse of adaptability. -Xms and -Xmx ( heap) and PermGen and MaxPermGen should be different. (MaxPermGen =256 by default)
我花了几个小时才发现这一点,几乎放弃并开始使用 Eclipse 之外的 JBoss。
为了在从 Eclipse 启动 JBoss 时增加 JBoss vmargs,您必须更改 JBoss 启动配置。 如果您更改standalone.conf,则不会发生任何事情,因为Eclipse 不使用它。
因此,要在 Eclipse 中更改 JBoss vmargs,您必须转到“服务器”选项卡,右键单击您的 Jboss 实例,然后选择“打开”。
它将出现一个新窗口。 在第一部分中,您有一个选项:“打开启动配置”。 当您单击此处时,您将看到用于更改 vmargs 的文本框。
希望这对您有帮助!
I've spend hours to discover this, and almost gave up and started to use JBoss out of Eclipse.
In order to increase your JBoss vmargs when starting it from Eclipse you have to change JBoss launch configuration. If you change standalone.conf, nothing happens because Eclipse doesn't use it.
So, to change JBoss vmargs in Eclipse, you have to go to "Servers" tab, right click on your Jboss instance, and select "Open".
It will appear a new window. In the first section, you have a option: "Open launch configuration". When you click there, you'll see the textbox to change vmargs.
Hope this helps you!
OutOfMemory 错误有不同类型:
java.lang.OutOfMemoryError: Java 堆空间
增加 -Xms 和 -Xmx。 我会确保它们至少设置为 256m,通常最好将它们设置为相同的值。
java.lang.OutOfMemoryError: PermGen space
添加 -XX:+CMSPermGenSweepingEnabled 或增加 PermGen 大小:-XX:PermSize=256m
java.lang.OutOfMemoryError: 超出 GC 开销限制 >
添加更多堆,垃圾收集器无法在每个周期释放足够的内存。 还可以尝试打开 GC 日志记录。
java.lang.OutOfMemoryError:无法创建新的本机线程
减少堆:)这意味着您分配给堆的内存太多,操作系统没有足够的内存来创建线程。
最后两件事,上面可以在jboss/bin/run.conf中配置。
另外,当启动 JBoss 时,查看哪些 -X 参数传递给 JVM,它默认打印此信息,验证它是否是您所期望的。
There are different types of OutOfMemory errors:
java.lang.OutOfMemoryError: Java heap space
Increase the -Xms and -Xmx. I'd make sure they are set at least 256m and generally it's a good idea to set them to the same value.
java.lang.OutOfMemoryError: PermGen space
Add either -XX:+CMSPermGenSweepingEnabled or increase the PermGen size: -XX:PermSize=256m
java.lang.OutOfMemoryError: GC overhead limit exceeded
Add more heap, the garbage collector can't free enough memory with each cycle. Also try turning on GC logging.
java.lang.OutOfMemoryError: unable to create new native thread
Decrease your heap :) This means that you have too much memory allocated to the heap that the OS doesn't have enough memory to create threads..
Two last things, the above can be configured in jboss/bin/run.conf.
Also when starting JBoss see what -X parameters are being passed to the JVM, it prints this information by default, verify that it's what you expect it to be.
您需要增加分配给 Java 的内存,特别是堆空间和 PermGen。 本文高度相关。 它提到这个问题经常出现在 Eclipse 和 JBoss 中(因为两者都相当大),并提供了一个解决方案(调整命令行标志)。
You need to increase the memory you're allocating to Java, in particular heap space and PermGen. This article is highly relevant. It mentions that this issue often occurs with Eclipse and JBoss (since both are fairly large), and provides a solution (adjusting the command-line flags).
你用什么来从 Eclipse 运行门户? 也许Jboss工具可以帮助你
http://www.jboss.org/tools
What are you using for running portal from eclipse? Maybe Jboss tools can help you
http://www.jboss.org/tools