使用 Websphere 管理控制台的 Java 堆空间内存不足

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/18377280/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-12 01:00:08  来源:igfitidea点击:

Java Heap Space Out of Memory wtih Websphere Admin Console

javawebsphere

提问by n.nasa

I am not able to open the Administrative console of websphere application server v8.5. The logs report Java Heap Space and Out of Memory errors. I have searched online and the suggestions are to increase the JVM heap size. But how should I accomplish that now, when even the admin console is not working for me ?

我无法打开 websphere application server v8.5 的管理控制台。日志报告 Java 堆空间和内存不足错误。我在网上搜索过,建议是增加 JVM 堆大小。但是我现在应该如何完成,即使是管理控制台也不适合我?

Is there a method to free up the heap space somehow ?

有没有办法以某种方式释放堆空间?

采纳答案by Robert H?glund

In this situation you must bypass the administration console. If you want to do that just edit the configuration file for the server, i.e. edit the server.xmlfor that particular server, either the application server process or the deployment manager process depending on what process suffers from the memory problem.

在这种情况下,您必须绕过管理控制台。如果您想这样做,只需编辑服务器的配置文件,即编辑该server.xml特定服务器的配置文件,应用程序服务器进程或部署管理器进程取决于哪个进程遇到内存问题。

edit the following attributes:

编辑以下属性:

jvmEntries debugArgs="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=7777" debugMode="false" disableJIT="false" genericJvmArguments="-Xquickstart" runHProf="false" verboseModeClass="false" **initialHeapSize**="512" **maximumHeapSize**="1024" verboseModeGarbageCollection="false" verboseModeJNI="false" xmi:id="JavaVirtualMachine_1183121908656"

The server.xmlcan be found here: /*IBM_ROOT_DIR*/WebSphere/WAS85/AppServer/profiles/*MyProfile*/config/cells/*MyCell*/nodes/*MyNode*/servers/*MyServer*/server.xml

server.xml可以在这里找到: /*IBM_ROOT_DIR*/WebSphere/WAS85/AppServer/profiles/*MyProfile*/config/cells/*MyCell*/nodes/*MyNode*/servers/*MyServer*/server.xml

After the update of the server.xmljust restart the server process to utilize the new memory settings.

更新后server.xml只需重新启动服务器进程即可使用新的内存设置。

回答by Ivan Nikolaev

You need to restart your Websphere profile to free up memory:

您需要重新启动 Websphere 配置文件以释放内存:

Windows:

视窗:

cd WAS_home\profiles\profile_name\bin
stopServer.bat server_name
startServer.bat server_name 

Unix:

Unix:

cd WAS_home/profiles/profile_name/bin
./stopServer.sh server_name 
./startServer.sh server_name

After that you can change appropriate settings in WAS administration console. Or you can edit profile configuration file server.xml before restarting. And of course you need to establish the reason of the OutOfMemeory error. Most likely it's a memory leak in some application on this server.

之后,您可以在 WAS 管理控制台中更改适当的设置。或者您可以在重新启动之前编辑配置文件配置文件 server.xml。当然,您需要确定 OutOfMemeory 错误的原因。很可能是此服务器上某些应用程序中的内存泄漏。

回答by Joginder Malik

Search for a file named server.xmlin your WebSphere installation. Generally, the location of this file is as follows:

在 WebSphere 安装中搜索名为server.xml的文件。一般这个文件的位置如下:

<profilehome>/config/cells/<cellname>/nodes/<nodename>/servers/<servername>/server.xml

Select the server.xmlspecific to your server and edit it to add/modify/delete the attributes initialHeapSizeand maximumHeapSizeof the element <jvmEntries>. The value of these attributes is the heap size in MB.

选择server.xml特定于您的服务器并编辑它以添加/修改/删除元素的属性initialHeapSizemaximumHeapSize<jvmEntries>。这些属性的值是以 MB 为单位的堆大小。

For example:

例如:

 <jvmEntries ... initialHeapSize="2048" maximumHeapSize="3072" ...>
 ...
 </jvmEntries>

Then restart the server.

然后重启服务器。