Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to increase the heap size of WebSphere Application Server V8.5 Liberty Profile in Eclipse?

I have a WebSphere Application Server V8.5 Liberty Profile in eclipse. My webapp has been giving java.lang.OutOfMemoryError and thus I need to increase the heap size.

As this and this post suggested I changed the server.xml, by adding jvmEntries tag (It was not previously there):

<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>

But eclipse shows it as an invalid tag, with following error:

cvc-complex-type.2.4.a: Invalid content was found starting with element 'jvmEntries'. One of '{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}' is expected.

How should I increase the heap size then?

like image 637
vishalaksh Avatar asked Feb 17 '15 13:02

vishalaksh


1 Answers

Correct way to do it is to create jvm.options file in the server directory with the following content e.g.:

-Xms512m
-Xmx1024m

Check this link Customizing the Liberty profile environment

In Eclipse, in the Servers view you can right-click the server, and select New > Server Environment File > jvm.options

like image 181
Gas Avatar answered Oct 25 '22 06:10

Gas