如何在Eclipse中增加WebSphere应用服务器V8.5 Liberty Profile的堆大小?

6
我在eclipse中拥有一个WebSphere应用服务器V8.5 Liberty Profile。我的Web应用程序一直报java.lang.OutOfMemoryError,因此我需要增加堆大小。
帖子建议,我更改了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:在元素“jvmEntries”之后找到无效内容。其中一个应该是:'{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}'。
那么我应该如何增加堆大小呢?
2个回答

11

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

-Xms512m
-Xmx1024m

请查看此链接 自定义Liberty配置文件环境

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


感谢分享完美的解决方案。我差点失去了生命。 - Swap L

0

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接