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

vis*_*ksh 4 eclipse websphere websphere-liberty

我在eclipse中有一个WebSphere Application Server V8.5 Liberty Profile.我的webapp一直在给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>
Run Code Online (Sandbox Code Playgroud)

但是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,web应用,httpDispatcher,MIME类型,httpEncoding,虚拟主机,httpOptions,httpAccessLogging,httpEndpoint,的authData,数据源,jdbcDriver,jndiEntry,JPA jspEngine,文件集,执行者,的FeatureManager,配置,customLdapFilterProperties,edirectoryLdapFilterProperties,domino50LdapFilterProperties,netscapeLdapFilterProperties,ldapRegistry,securewayLdapFilterProperties, iplanetLdapFilterProperties,idsLdapFilterProperties,activedLdapFilterProperties,logging,ltpa,ejbContainer,monitor,oauthProvider,oauth-roles,remoteFileAccess,administrator-role,
quickStartSecurity,pluginConfiguration,w ebContainer,httpSession,httpSessionDatabase,sslDefault,keyStore,ssl,sslOptions,timedOperation,transaction,webAppSecurity,federatedRepository,zosLogging,authorization-roles}'是预期的.

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

Gas*_*Gas 8

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

-Xms512m
-Xmx1024m
Run Code Online (Sandbox Code Playgroud)

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

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