0
votes

Im trying to call a command from wsadminlib.py to change the initialHeapSize and the maximumHeapSize in a script. But unfortunately my jython (and general scripting knowledge) is still total newbie.

Im using the call

#Change Java Heap Size

setJvmProperty(nodeName,serverName,maximumHeapsize -2048 ,initialHeapSize -2048)

Which should relate to the command in the wsadminlib.py library

def setJvmProperty(nodename,servername,propertyname,value):

"""Set a particular JVM property for the named server

Some useful examples:

    'maximumHeapSize': 512 ,

    'initialHeapSize':512,

    'verboseModeGarbageCollection':"true",

    'genericJvmArguments':"-Xgcpolicy:gencon -Xdump:heap:events=user -Xgc:noAdaptiveTenure,tenureAge=8,stdGlobalCompactToSatisfyAllocate -Xconcurrentlevel1 -Xtgc:parallel",



"""

jvm = getServerJvm(nodename,servername)

AdminConfig.modify(jvm, [[propertyname, value]])

But I'm met with this issue when i run the script

WASX7017E: Exception received while running file "/etc/was-scripts/administrateservertest.py"; exception information: com.ibm.bsf.BSFException: exception from Jython: Traceback (innermost last): File "", line 14, in ? NameError: maximumHeapsize

Any suggestions would be appreciated as I'm tearing my hair out trying to work this out

2
I am not sure, is it typo maximumHeapsizeDevesh

2 Answers

0
votes

this was answered by a friend on face book

I think you might need to make two calls, one for each property you want to set. e.g. setJvmProperty(nodeName,serverName,'maximumHeapsize',2048)

0
votes

For others looking for a more specific answer, try this:

AdminConfig.modify(jvmId,[['genericJvmArguments',arguments],["maximumHeapSize", str(1536)]])