You can use properties files to modify or delete Java virtual machine (JVM) properties.
Before you begin
Determine the changes that you want to make to your JVM
configuration.
Start the wsadmin scripting tool. To start wsadmin
using the Jython language, run the wsadmin -lang Jython command
from the bin directory of the server profile.
About this task
Using a properties file, you can modify or delete JVM
properties.
Run administrative commands using wsadmin to change
a properties file for a JVM, validate the properties, and apply them
to your configuration.
Table 1. Actions for JVM properties. You can modify or
delete JVM properties.
Action |
Procedure |
create |
Not applicable |
modify |
Edit JVM properties in the properties file and
then run the applyConfigProperties command. The product ignores null
or empty list {} property values, and applies only
those values that are not null and non-empty. |
delete |
Edit the JVM properties file so that it contains
only those properties to delete and then run the deleteConfigProperties
command. Deleting a property sets the property value to a default
value, if it exists. If a default value does not exist for the property,
the product removes the property.
|
create Property |
Not applicable |
delete Property |
Not applicable |
Optionally, you can use interactive mode with the commands:
AdminTask.command_name('-interactive')
Procedure
- Modify an existing properties file.
- Obtain a properties file for the JVM that you want to
change.
You can extract a properties file for a JavaVirtualMachine
object using the extractConfigProperties command.
- Open the properties file in an editor and change the
properties as needed.
Ensure that the environment variables
in the properties file match your system.
An
example JavaVirtualMachine properties file follows:
#
# Header
#
ResourceType=JavaVirtualMachine
ImplementingResourceType=Server
ResourceId=Cell=!{cellName}:Node=!{nodeName}:Server=!{serverName}:JavaProcessDef=:JavaVirtualMachine=
AttributeInfo=jvmEntries
#
#
#Properties
#
internalClassAccessMode=ALLOW #ENUM(ALLOW|RESTRICT),default(ALLOW)
JavaHome="C:\cf50922.30\test/java" #readonly
debugArgs="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=7777"
classpath={}
initialHeapSize=0 #integer,default(0)
runHProf=false #boolean,default(false)
genericJvmArguments=
hprofArguments=
osName=null
bootClasspath={}
verboseModeJNI=false #boolean,default(false)
maximumHeapSize=0 #integer,default(0)
disableJIT=false #boolean,default(false)
verboseModeGarbageCollection=false #boolean,default(false)
executableJarFileName=null
verboseModeClass=false #boolean,default(false)
debugMode=false #boolean,default(false)
#
# Header JVM System properties
#
ResourceType=JavaVirtualMachine
ImplementingResourceType=Server
ResourceId=Cell=!{cellName}:Node=!{nodeName}:Server=!{serverName}:JavaProcessDef=:JavaVirtualMachine=
AttributeInfo=systemProperties(name,value)
#
#
#Properties
#
com.ibm.security.krb5.Krb5Debug=off
com.ibm.security.jgss.debug=off
#
EnvironmentVariablesSection
#
#
#Environment Variables
cellName=myCell04
nodeName=myNode
serverName=myServer
- Run the applyConfigProperties command to create or change
a JVM configuration.
Running the applyConfigProperties
command applies the properties file to the configuration. The product
ignores null or empty list {} property values, and
applies only those values that are not null and non-empty. In this
Jython example, the optional -reportFileName parameter
produces a report named report.txt:
AdminTask.applyConfigProperties(['-propertiesFileName myObjectType.props -reportFileName report.txt '])
- If you no longer need a JVM property, you can delete the
property, provided the property does not have a default value.
To delete one or more properties, specify only the properties
to be deleted in the properties file and then run the deleteConfigProperties
command; for example:
AdminTask.deleteConfigProperties('[-propertiesFileName myObjectType.props -reportFileName report.txt]')
If
a property has a default value, the property is not deleted but rather
is set to the default value.
Results
You can use the properties file to configure and manage
the JVM properties.
What to do next
Save the changes to your configuration.