1

TL;DR -- How do I give ws_ant.sh and/or the <wsInstallApp> task more heap at runtime?

I am attempting to deploy a relatively large (~160-MB) EAR file to WebSphere 8.5 running on a 64-bit Linux platform.

Here is the task I have in my build.xml:

<wsInstallApp
    ear="/my/ear/file/location/New.EAR"
    properties="jvm.properties"
    options="-appname myNewEarApp -update -deployws"
    host="localhost"
    conntype="SOAP"
    user="the_username"
    password="not_telling_you"
    failonerror="true" />

Executing it with the ws_ant.sh packaged with WAS results in an OutOfMemoryError and heap dumps.

So, I need to increase the heap available to the task (or ws_ant itself?) at runtime, but I cannot figure out the proper place to do so. I tried modifying wsadmin.sh, and while that has an effect if I run my deployment as a Jython script with wsadmin.sh directly, it does not seem to have any impact whatsoever on the execution of <wsInstallApp> from within the Ant script.

According to the IBM documentation of wsInstallApp:

The properties attribute is optional and it contains a java properties file containing attributes to set in the JVM System properties

In my jvm.properties file, I tried:

[user@localhost]$ cat jvm.properties
-Xms4096m
-Xmx4096m

That had no effect. Executing ws_ant.sh with the -v verbose flag showed that, somewhere, the -Xmx value is set as -Xmx256m. I tried several other hair-brained combinations and formats, but nothing seems to work.

I also tried adding arguments onto the ws_ant.sh call:

[user@localhost]$ ws_ant.sh -Xms4096m -Xmx4096m -v -f build.xml was.deploy

... but that also seems to do nothing.

What am I doing wrong? I concede that, if pressed, I could probably meet my requirements by re-writing the deployment using wsadmin.sh and a Jython script, but I'm trying to leverage some extensive Ant scripting from a different EAR application.

Alternatives? I also recognize that I could use the <wsadmin> Ant task to call some Jython scripts from within Ant-- I have not yet tried this-- but again, we already have some extensive scripting otherwise. What are the relative advantages and disadvantages of one way versus the other? (i.e., executing wsadmin.sh/Jython script via <[ssh]exec> or <wsadmin> versus <wsInstallApp> [and its "ws_____" siblings]).

  • I had the same problem and found no other solution except directly modifying ws_ant.sh. I believe you can get comment on this from WAS developers at developer.ibm.com/answers – ͏͏͏user25961 May 7 '15 at 11:49
0

Try attribute jvmMaxMemory

<wsInstallApp
    ear="/my/ear/file/location/New.EAR"
    jvmMaxMemory="1024M"
    options="-appname myNewEarApp -update -deployws"
    host="localhost"
    conntype="SOAP"
    user="the_username"
    password="not_telling_you"
    failonerror="true" />
0

For ws_ant.sh you have to use the JVM_EXTRA_CMD_ARGS env variable.

export JVM_EXTRA_CMD_ARGS="-Xms1G -Xmx2G"
sh $WEBSPHERE_HOME/bin/ws_ant.sh -f was-build.xml

To prove the point, swap the min and max sizes "-Xms2G -Xmx1G", and you will get the error:

VMJ9GC019E -Xms too large for -Xmx
JVMJ9VM015W Initialization error for library j9gc26(2): Failed to initialize
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
0

We are using Maven for deployment and I can confirm, adding jvmMaxMemory to the wsInstallApp helped. I had to fork the original plugin and add the support for it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.