如何在Eclipse中增加WebSphere Application Server V8.5 Liberty Profile的堆大小?

时间:2015-02-17 13:56:57

标签: eclipse websphere websphere-liberty

我在eclipse中有一个WebSphere Application Server V8.5 Liberty Profile。我的webapp一直在提供java.lang.OutOfMemoryError,因此我需要增加堆大小。

由于thisthis帖子建议我更改了server.xml,添加了jvmEntries标记(以前不存在):

<server description="new server">

    <!-- Enable features -->
    <featureManager>
        <feature>jsp-2.2</feature>
        <feature>localConnector-1.0</feature>
        <feature>jpa-2.0</feature>
    </featureManager>

    <!-- To access this server from a remote client add a host attribute to 
        the following element, e.g. host="*" -->
    <httpEndpoint httpPort="9080" httpsPort="9443"  id="defaultHttpEndpoint" />

    <jvmEntries initialHeapSize="1024" maximumHeapSize="2048" />
    <applicationMonitor updateTrigger="mbean" />
    <webApplication id="app" location="app.war"
        name="app" />
</server>

但是eclipse将其显示为无效标记,并出现以下错误:

  

cvc-complex-type.2.4.a:找到无效的内容   元素&#39; jvmEntries&#39;。其中一个{include,variable,trustAssociation,   applicationMonitor,application,classloading,basicRegistry,   bundleRepository,osgiApplication,authentication,authCache,   jaasLoginModule,jaasLoginContextEntry,cdiContainer,channelfw,   tcpOptions,library,collectiveMember,hostAuthInfo,   managedExecutorService,connectionManager,contextService,   distributedMap,enterpriseApplication,webApplication,httpDispatcher,   mimeTypes,httpEncoding,virtualHost,httpOptions,   httpAccessLogging,httpEndpoint,authData,dataSource,jdbcDriver,   jndiEntry,jpa,jspEngine,fileset,executor,featureManager,config,   customLdapFilterProperties,edirectoryLdapFilterProperties,   domino50LdapFilterProperties,netscapeLdapFilterProperties,   ldapRegistry,securewayLdapFilterProperties,   iplanetLdapFilterProperties,idsLdapFilterProperties,   activedLdapFilterProperties,logging,ltpa,ejbContainer,monitor,   oauthProvider,oauth-roles,remoteFileAccess,administrator-role,
  quickStartSecurity,pluginConfiguration,webContainer,httpSession,   httpSessionDatabase,sslDefault,keyStore,ssl,sslOptions,   timedOperation,transaction,webAppSecurity,federatedRepository,   zosLogging,authorization-roles}&#39;是预期的。

我应该如何增加堆大小呢?

2 个答案:

答案 0 :(得分:7)

正确的方法是使用以下内容在服务器目录中创建jvm.options文件,例如:

-Xms512m
-Xmx1024m

点击此链接Customizing the Liberty profile environment

在Eclipse中,在Servers视图中,您可以右键单击服务器,然后选择New > Server Environment File > jvm.options

答案 1 :(得分:0)

Liberty概要文件与常规WebSphere概要文件略有不同。您需要按照以下说明配置jvm.options文件:

IBM Setting generic JVM arguments in the WebSphere Application Server V8.5 Liberty profile

Customizing the Liberty profile environment