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

2

6

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?

Optimize answered 17/2, 2015 at 13:56 Comment(0)
G
11

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

Gel answered 17/2, 2015 at 17:55 Comment(1)
Thanks for sharing perfect solution. I almost about to lose my lifeDefy
S
0

The Liberty profile is a bit different than the regular WebSphere profile. You will need to configure a jvm.options file per these instructions:

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

Customizing the Liberty profile environment

Saks answered 17/2, 2015 at 17:56 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.