Thursday, 25 August 2011

Heap size modification in citrix applications


Java virtual machine memory erroryy

Could not create the Java virtual Machine


If you  get Java virtual machine memory error in your citrix server.

Please try to remove the splash screen in your java application script .




see the below document you may get more ideas

Java Virtual Machine tuning

This section describes how you can tune your Java™ Virtual Machine (JVM) for TBSM.
In addition to the TBSM database tuning parameters described for the Discovery Library Toolkit in Tuning for the Discovery Library toolkit, a correctly tuned JVM provides the best possible performance for TBSM server processing. Of the many parameters that can be set for a JVM, those that make the biggest difference for the TBSM Data and Dashboard servers are:
  • Minimum heap size
  • Maximum heap size
Although correct JVM tuning helps TBSM performance, one set of parameters does not fit all environments. Each environment might respond differently to certain tuning parameters based on factors such as platform (Windows® or UNIX®), processor speed, number of processors, amount of installed RAM, and memory space addressable by the operating system. In addition, other co-resident applications such as PostgreSQL and Discovery Library Toolkit also consume and compete for system resources.
By default, both the TBSM Data and Dashboard servers are installed with the following values for the JVM.

Table 1. JVM performance tuning values
JVM parameterWindowsUNIXDescription
Minimum heap size (-Xms)256 Mb256 MbSets the minimum heap size for the TBSM JVM.
Maximum Heap Size (-Xmx)512 Mb512 MbSets the maximum memory size for the TBSM JVM.
Although the default values listed in Table 1 might be sufficient for small environments, if your environment consists of a service model that includes more than 1000 service instances, you might need to increase the value for both heap size parameters.

Modifying the heap size

To achieve the 1.6 GB heap in the Windows environment, the /3GB switch needs to be configured in theboot.ini file. This switch tells the operating system to reserve 3 Gb of the available RAM for applications and only 1 GB of RAM for the OS. Otherwise, without this switch, Windows will by default reserve half of the available memory for the OS, leaving the other half to be shared between applications. For example, if you do not set the /3GB switch on a machine with 4 Gb of RAM, you will only have 2 Gb of shared RAM for all applications. This means that the maximum amount of memory that can be allocated to the TBSM server heap will most likely be much less than 2 Gb.
For more information, see the Windows documentation. Add the /3GB switch to the boot.ini file as follows:.
  1. Right click on My Computer and select > Properties > Advanced > Startup and Recovery [Settings].
  2. Click on the Edit button immediately following this prompt; To edit the startup options file manually, click Edit.
  3. Add the /3GB switch to the [operating systems] section, in the last line of the file.
Here is an example boot.ini file with the /3GB parameter set.
[boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Windows Server 2003, Enterprise" /NoExecute=OptOut /3GB /PAE /fastdetect
Note: If a heap of the specified size cannot be allocated to the JVM process, the JVM will not start.
To modify the heap sizes on the Data server, perform the following steps:
  1. Stop the TBSM Data server, if it is running.
  2. Issue the command wsadmin.bat -lang jython -conntype NONE from the following directory:
    • UNIX $TIP_PROFILE/profiles/profile_name/bin
    • Windows %TIP_HOME%\profiles\TBSMProfile\bin
  3. At the wsadmin> prompt, issue the following commands, where xxx is the heap size value, in megabytes, that you want:
    jvm=AdminConfig.list("JavaVirtualMachine")
    
    AdminConfig.modify(jvm, '[[initialHeapSize xxx]]')
    AdminConfig.modify(jvm, '[[maximumHeapSize xxx]]')
    AdminConfig.save()
    
    exit
  4. Start the TBSM Data server. Your changes will be included when the server starts.
    If you attempt to start the TBSM Data server on Windows with a maximum heap size that is too large, error messages that are similar to the following will be generated in the%TIP_HOME%\profiles\profile_name\logs\server1\native_stderr.log directory:
    JVMJ9GC019E -Xms too large for -Xmx
    JVMJ9VM015W Initialization error for library j9gc23(2): Failed to initialize
    Could not create the Java virtual machine.
To modify JVM heap sizes on the Dashboard server, perform the following steps:
  1. Stop the Dashboard server, if it is running.
  2. Issue the command wsadmin.bat -lang jython -conntype NONE from the following directory::
    • UNIX $TIP_PROFILE/profiles/profile_name/bin
    • Windows %TIP_HOME%\profiles\TIPProfile\bin
  3. At the wsadmin> prompt, issue the following commands, where xxx is the heap size value, in megabytes, that you want:
    jvm=AdminConfig.list(”JavaVirtualMachine”)
    AdminConfig.modify(jvm, ‘[[initialHeapSize xxx]]’)
    AdminConfig.modify(jvm, ‘[[maximumHeapSize xxx]]’)
    AdminConfig.save()
    exit
  4. Start the TBSM Dashboard server. Your changes will be included when the server starts.
    If you attempt to start the TBSM Data server on Windows with a maximum heap size that is too large, error messages that are similar to the following will be generated in the%TIP_HOME%\profiles\profile_name\logs\server1\native_stderr.log directory:
    JVMJ9GC019E -Xms too large for -Xmx
    JVMJ9VM015W Initialization error for library j9gc23(2): Failed to initialize
    Could not create the Java virtual machine.
Attention: If you set either of these properties to values that are incorrect, the TBSM Data server, the TBSM Dashboard server, or both might fail to start.

Client-side JVM tuning

Within the client Web browser hosting the TBSM console is a JVM plug-in that is needed for running client-side Java code. Just like the JVM running the either of the TBSM servers, the browser plug-in JVM can also be tuned to specify initial and maximum heap sizes. Typically, an untuned plug-in JVM has an initial heap size of no more than 4 MB and a maximum heap size of 64 MB, though these numbers can vary depending on the platform being used.
The GUI Service Viewer is the feature most affected by changes to JVM parameters. You might be able to improve the performance of the service viewer by increasing the initial heap size (-Xms) to 32 MB and the maximum heap size (-Xmx) to 64 MB. Of course, whether this configuration change is really needed or not will depend on the size of the business service model being loaded by the Service Viewer.
The procedure to change the JVM plug-in tuning parameters can be different depending on the provider of the plug-in (for example IBM® or Sun) and also depending on the platform (Windows or UNIX). As an example, the following procedure shows how to access and set the JVM plug-in parameters for the IBM-provided 1.5.0 plug-in on Windows:
  1. Click Control Panel > Java Plug-in.
  2. Click the Advanced tab.
  3. In the text box under Java Runtime Parameters, type the following:
    -Xms32m -Xmx64m
  4. Click Apply and then close the window.
After you make these changes, you might need to log out of and then log in to the TBSM console.
Note: To change the JVM plug-in parameters on a supported UNIX platform, navigate to the /binsubdirectory under the file system location where the plug-in is installed and look for a shell script named either ControlPanel or JavaPluginControlPanel, depending on the version of Java. Run this shell script to open a GUI that will look similar to the equivalent interface on the Windows platform.

No comments:

Post a Comment