当前位置: 代码迷 >> Java Web开发 >> JBoss 没有有加任何的 Xms Xmx 的 JVM 内存限制,但是,在启动的时候,提示 Out Of Memory
  详细解决方案

JBoss 没有有加任何的 Xms Xmx 的 JVM 内存限制,但是,在启动的时候,提示 Out Of Memory

热度:573   发布时间:2016-04-16 21:43:16.0
JBoss 没有加任何的 Xms Xmx 的 JVM 内存限制,但是,在启动的时候,提示 Out Of Memory
本帖最后由 global_biz 于 2014-11-08 09:33:00 编辑
Hi,

在 Linux 服务器有一个 JBoss ,我给JBoss 没有加任何的 Xms Xmx 的 JVM 内存限制,但是,在启动的时候,提示 Out Of Memory。

请问,我应该如何检查 JBoss (今天第一天使用, 之前使用 Weblogic, Webshpere ), 我想分配尽可能小(足以运行)的内存给JBoss 使用,请问在 JBoss 里面我怎么知道内存都用在哪了?如何将可能的地方列出来(比如:某个应用使用了多少内存等)?

注:我这台是 VMWare, 原始安装完后,在 JBoss 的启动参数里面是带有 Xms = 3GB, Xmx = 4GB 的参数的,但是,个人用来测试,我想用最小的内存来运行,所有,我将参数里面的 Xms Xmx 删除了。

下面是 boot.log 里面的信息供参考:


00:18:04,477 ERROR [ProfileDeployAction] Failed to add deployment: um_bulkimport.ear: org.jboss.deployers.spi.DeploymentException: Exception determining structure: AbstractVFSDeployment(um_bulkimport.ear)
at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49) [:2.2.2.GA]
at org.jboss.deployers.structure.spi.helpers.AbstractStructuralDeployers.determineStructure(AbstractStructuralDeployers.java:85) [:2.2.2.GA]
at org.jboss.deployers.plugins.main.MainDeployerImpl.determineStructure(MainDeployerImpl.java:1106) [:2.2.2.GA]
at org.jboss.deployers.plugins.main.MainDeployerImpl.determineDeploymentContext(MainDeployerImpl.java:417) [:2.2.2.GA]
at org.jboss.deployers.plugins.main.MainDeployerImpl.addDeployment(MainDeployerImpl.java:367) [:2.2.2.GA]
at org.jboss.deployers.plugins.main.MainDeployerImpl.addDeployment(MainDeployerImpl.java:277) [:2.2.2.GA]
at org.jboss.system.server.profileservice.deployers.MainDeployerPlugin.addDeployment(MainDeployerPlugin.java:77) [:6.1.0.Final]
at org.jboss.profileservice.dependency.ProfileControllerContext$DelegateDeployer.addDeployment(ProfileControllerContext.java:133) [:0.2.2]
at org.jboss.profileservice.dependency.ProfileDeployAction.deploy(ProfileDeployAction.java:132) [:0.2.2]
at org.jboss.profileservice.dependency.ProfileDeployAction.installActionInternal(ProfileDeployAction.java:94) [:0.2.2]
at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:54) [jboss-kernel.jar:2.2.0.SP2]
at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:42) [jboss-kernel.jar:2.2.0.SP2]
at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62) [jboss-dependency.jar:2.2.0.SP2]
at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71) [jboss-dependency.jar:2.2.0.SP2]
at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51) [jboss-dependency.jar:2.2.0.SP2]
at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:379) [jboss-dependency.jar:2.2.0.SP2]
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2044) [jboss-dependency.jar:2.2.0.SP2]
at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1083) [jboss-dependency.jar:2.2.0.SP2]
at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1322) [jboss-dependency.jar:2.2.0.SP2]
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1246) [jboss-dependency.jar:2.2.0.SP2]
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1139) [jboss-dependency.jar:2.2.0.SP2]
at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:939) [jboss-dependency.jar:2.2.0.SP2]
at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:654) [jboss-dependency.jar:2.2.0.SP2]
at org.jboss.profileservice.dependency.ProfileActivationWrapper$BasicProfileActivation.start(ProfileActivationWrapper.java:190) [:0.2.2]
at org.jboss.profileservice.dependency.ProfileActivationWrapper.start(ProfileActivationWrapper.java:87) [:0.2.2]
at org.jboss.profileservice.dependency.ProfileActivationService.activateProfile(ProfileActivationService.java:215) [:0.2.2]
at org.jboss.profileservice.dependency.ProfileActivationService.activate(ProfileActivationService.java:159) [:0.2.2]
at org.jboss.profileservice.bootstrap.AbstractProfileServiceBootstrap.activate(AbstractProfileServiceBootstrap.java:112) [:0.2.2]
at org.jboss.profileservice.resolver.BasicResolverFactory$ProfileResolverFacade.deploy(BasicResolverFactory.java:87) [:0.2.2]
at org.jboss.profileservice.bootstrap.AbstractProfileServiceBootstrap.start(AbstractProfileServiceBootstrap.java:91) [:0.2.2]
at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:132) [:6.1.0.Final]
at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:56) [:6.1.0.Final]
at org.jboss.bootstrap.impl.base.server.AbstractServer.startBootstraps(AbstractServer.java:827) [jboss-bootstrap-impl-base.jar:2.1.0-alpha-6]
at org.jboss.bootstrap.impl.base.server.AbstractServer$StartServerTask.run(AbstractServer.java:417) [jboss-bootstrap-impl-base.jar:2.1.0-alpha-6]
at java.lang.Thread.run(Thread.java:662) [:1.6.0_33]
Caused by: java.lang.OutOfMemoryError: Java heap space
at java.lang.String.substring(String.java:1939) [:1.6.0_33]
at org.jboss.vfs.util.PathTokenizer.getTokens(PathTokenizer.java:141) [jboss-vfs.jar:3.0.1.GA]
at org.jboss.vfs.util.PathTokenizer.getTokens(PathTokenizer.java:102) [jboss-vfs.jar:3.0.1.GA]
at org.jboss.vfs.spi.JavaZipFileSystem.<init>(JavaZipFileSystem.java:104) [jboss-vfs.jar:3.0.1.GA]
at org.jboss.vfs.VFS.mountZip(VFS.java:380) [jboss-vfs.jar:3.0.1.GA]
at org.jboss.vfs.util.automount.Automounter$RegistryEntry.mount(Automounter.java:263) [jboss-vfs.jar:3.0.1.GA]
at org.jboss.vfs.util.automount.Automounter$RegistryEntry.access$000(Automounter.java:232) [jboss-vfs.jar:3.0.1.GA]
at org.jboss.vfs.util.automount.Automounter.mount(Automounter.java:117) [jboss-vfs.jar:3.0.1.GA]
at org.jboss.vfs.util.automount.Automounter.mount(Automounter.java:103) [jboss-vfs.jar:3.0.1.GA]
at org.jboss.web.deployers.WARStructure.doDetermineStructure(WARStructure.java:187) [:6.1.0.Final]
at org.jboss.deployers.vfs.plugins.structure.AbstractVFSArchiveStructureDeployer.determineStructure(AbstractVFSArchiveStructureDeployer.java:60) [:2.2.2.GA]
at org.jboss.deployers.vfs.plugins.structure.StructureDeployerWrapper.determineStructure(StructureDeployerWrapper.java:73) [:2.2.2.GA]
at org.jboss.deployers.vfs.plugins.structure.VFSStructuralDeployersImpl.doDetermineStructure(VFSStructuralDeployersImpl.java:197) [:2.2.2.GA]
at org.jboss.deployers.vfs.plugins.structure.VFSStructuralDeployersImpl.determineStructure(VFSStructuralDeployersImpl.java:143) [:2.2.2.GA]
at org.jboss.deployers.vfs.spi.structure.StructureContext.determineChildStructure(StructureContext.java:294) [:2.2.2.GA]
at org.jboss.deployment.EARStructure.doDetermineStructure(EARStructure.java:267) [:6.1.0.Final]
at org.jboss.deployers.vfs.plugins.structure.AbstractVFSArchiveStructureDeployer.determineStructure(AbstractVFSArchiveStructureDeployer.java:60) [:2.2.2.GA]
at org.jboss.deployers.vfs.plugins.structure.StructureDeployerWrapper.determineStructure(StructureDeployerWrapper.java:73) [:2.2.2.GA]
at org.jboss.deployers.vfs.plugins.structure.VFSStructuralDeployersImpl.doDetermineStructure(VFSStructuralDeployersImpl.java:197) [:2.2.2.GA]
at org.jboss.deployers.vfs.plugins.structure.VFSStructuralDeployersImpl.determineStructure(VFSStructuralDeployersImpl.java:222) [:2.2.2.GA]
at org.jboss.deployers.structure.spi.helpers.AbstractStructuralDeployers.determineStructure(AbstractStructuralDeployers.java:77) [:2.2.2.GA]
at org.jboss.deployers.plugins.main.MainDeployerImpl.determineStructure(MainDeployerImpl.java:1106) [:2.2.2.GA]
at org.jboss.deployers.plugins.main.MainDeployerImpl.determineDeploymentContext(MainDeployerImpl.java:417) [:2.2.2.GA]
at org.jboss.deployers.plugins.main.MainDeployerImpl.addDeployment(MainDeployerImpl.java:367) [:2.2.2.GA]
at org.jboss.deployers.plugins.main.MainDeployerImpl.addDeployment(MainDeployerImpl.java:277) [:2.2.2.GA]
at org.jboss.system.server.profileservice.deployers.MainDeployerPlugin.addDeployment(MainDeployerPlugin.java:77) [:6.1.0.Final]
at org.jboss.profileservice.dependency.ProfileControllerContext$DelegateDeployer.addDeployment(ProfileControllerContext.java:133) [:0.2.2]
at org.jboss.profileservice.dependency.ProfileDeployAction.deploy(ProfileDeployAction.java:132) [:0.2.2]
at org.jboss.profileservice.dependency.ProfileDeployAction.installActionInternal(ProfileDeployAction.java:94) [:0.2.2]
at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:54) [jboss-kernel.jar:2.2.0.SP2]
at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:42) [jboss-kernel.jar:2.2.0.SP2]
at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62) [jboss-dependency.jar:2.2.0.SP2]

00:24:44,855 INFO  [STDOUT] Posting Shutdown Request to the server...
00:24:49,924 INFO  [STDOUT] Server startup has not completed, so halting the process


谢谢。
------解决思路----------------------
下面是tomcat的启动脚本catalina.bat 中的两个注释掉的配置项
rem   CATALINA_OPTS   (Optional) Java runtime options used when the "start",
rem                   "run" or "debug" command is executed.
rem                   Include here and not in JAVA_OPTS all options, that should
rem                   only be used by Tomcat itself, not by the stop process,
rem                   the version command etc.
rem                   Examples are heap size, GC logging, JMX ports etc.
rem

rem   JAVA_OPTS       (Optional) Java runtime options used when any command
rem                   is executed.
rem                   Include here and not in CATALINA_OPTS all options, that
rem                   should be used by Tomcat and also by the stop process,
rem                   the version command etc.
rem                   Most options should go into CATALINA_OPTS.

JVM启动时候会有一个默认的内存分配的,想自己设置jvm启动内存分配的话,可以放开注释使用
JAVA_OPTS="-Xms256m -Xmx512m"   或 CATALINA_OPTS="-Xms256m -Xmx512m" 就可以了

jboss中应该有类似的配置项,楼主找找看,同样的方法修改下就可以了

  相关解决方案
本站暂不开放注册!
内测阶段只得通过邀请码进行注册!
 
  • 最近登录:Tue Nov 21 12:28:30 CST 2017
  • 最近登录:Tue Nov 21 12:28:30 CST 2017
  • 最近登录:Tue Nov 21 12:28:30 CST 2017
  • 最近登录:Tue Nov 21 12:28:30 CST 2017
  • 最近登录:Tue Nov 21 12:28:30 CST 2017