Sie sind auf Seite 1von 16

IBM RAD Performance Tips and Best Practices for Development

Some of Performance Tips for IBM RAD and Best Practices for Development using IBM RAD

6/28/2013

IBM Santosh Manakdass, Sonal Shrivastava, & Parthsarthi Komperla

Manakdass, Sonal Shrivastava, & Parthsarthi Komperla About the authors: Santosh Manakdass, Sonal Shrivastava,
Manakdass, Sonal Shrivastava, & Parthsarthi Komperla About the authors: Santosh Manakdass, Sonal Shrivastava,
Manakdass, Sonal Shrivastava, & Parthsarthi Komperla About the authors: Santosh Manakdass, Sonal Shrivastava,

About the authors: Santosh Manakdass, Sonal Shrivastava, & Parthsarthi Komperla are working as a developer for Atlas team under ECM. Our daily work involves in developing and fixing defects for product involving areas like Java, JavaScript, JSF, GWT, Oracle etc. Reach out to them at samanakd@in.ibm.com, sonashri@in.ibm.com, parthakom@in.ibm.com

Abstract: This article describes some of Performance Tips for IBM RAD and Best Practices for
Abstract: This article
describes some of
Performance Tips for IBM
RAD and Best Practices
for Development using
IBM RAD. This article
assumes that the reader is
familiar with IBM RAD.
The article was developed
using RAD 8.0.3.

IBM RAD Performance Tips and Best Practices for Development

Overview

Rational Application Developer is an integrated development environment that helps Java software developers design, develop, and deploy their applications. It contains specialized wizards, editors, and validators for a variety of technologies

IBM® Rational® Application Developer for WebSphere® Software accelerates the development and deployment of Java, Java EE, Web 2.0, mobile, OSGi, portal and service-oriented architecture (SOA) applications. Both expert and novice developers can increase productivity and efficiency by using its many integrated capabilities for easier development, testing, analysis and delivery of applications.

Rational Application Developer includes tools to improve code quality. A Java profiling tool helps to analyze an application's performance, memory usage, and threading problems. A software analysis tool identifies patterns and anti-patterns in application code, and compares code to coding standards.

Performance Tips

Today a lot of Java development projects use RAD as development IDE. Developers complain about the performance issue with IDE and spent most of the valuable time in troubleshooting IDE issues rather than focusing on development. RAD comes with default setting, it is important to re-configure some of the setting in RAD to improve the performance in the development time and productivity.

Following is the list of some of performance tips and some of the techniques used in our projects with screenshots.

1. Auto Build:

Accessed from the Windows > Preferences ->General ->Workspace-> Build Automatically

->General ->Workspace-> Build Automatically Figure 1: Auto Build When Build automatically (auto build)

Figure 1: Auto Build

When Build automatically (auto build) is turned on, every time we save a file, an incremental build takes place. This includes not only building (or compiling) the file, but

IBM RAD Performance Tips and Best Practices for Development

also building the entire workspace. It also runs validation .Turning auto build off will improve the performance of save operations at the expense of slower builds and less up- to-date error information. This option is really one of personal choice, since there are pros and cons to both settings.

2. Refresh Workspace:

Accessed from the Windows > Preferences ->General ->Workspace-> Refresh Workspace

->General ->Workspace-> Refresh Workspace Figure 2 : Refresh Workspace Turning Refresh workspace

Figure 2 : Refresh Workspace

Turning Refresh workspace automatically on will start a background process that searches for changes that have been made by other processes to resources in the workspace. If changes are found, this will cause an incremental build to run if auto build is turned on, but otherwise it does not initiate any builds.

3. Capabilities:

Accessed from the Windows > Preferences ->General-> Capabilities

IBM RAD Performance Tips and Best Practices for Development

IBM RAD Performance Tips and Best Practices for Development Figure 3: Capabilities By turning off some

Figure 3: Capabilities

By turning off some of the capabilities, we can remove certain user interface items. This in turn will prevent from invoking certain functions. Since Rational Application Developer uses lazy loading, any time we invoke a new function, it takes more memory to hold the classes that implement the new function.

If you are not using those functions, turning off the capability won't make any difference. In general, turning off capabilities will not improve your performance, other than preventing you from accidentally invoking a function.

4. Closing Editors

Accessed from the Windows > Preferences ->General-> Editors

IBM RAD Performance Tips and Best Practices for Development

IBM RAD Performance Tips and Best Practices for Development Figure 4 : Closing Editors Any editor

Figure 4 : Closing Editors

Any editor that is active (that is, has focus) when Rational Application Developer is shut down, will become active again when Rational Application Developer is restarted. To improve the startup time of Rational Application Developer, you can select the Close all editors on exit preference.

5. Quick Diff:

Accessed from the Windows > Preferences ->General-> Editors

Windows > Preferences ->General-> Editors-> Text Editor ->Quick Diff->Enable Quick Diff

Text Editor ->Quick Diff-> Enable Quick Diff Figure 5 : Quick Diff Quick diff is a

Figure 5 : Quick Diff

Quick diff is a function that shows a line in the margin to show you what has changed. Disabling quick diff will slightly improve your performance while editing files.

IBM RAD Performance Tips and Best Practices for Development

6.

Validation:

Accessed from the Windows > Preferences ->Validation

Running all of the validators all of the time is a reasonably expensive operation. If builds are taking too long, we can turn off all or some of the validators. Or we can have them run only during manual builds.

If a validator is turned off, it means you won't have the benefit of any errors, warnings, or informational messages that it might have produced.

In particular:

The JSP Compilation Validator is quite expensive to run.

The XML Validator can be expensive to run if it is referencing DTDs or XML schemas on external servers.

to run.  The XML Validator can be expensive to run if it is referencing DTDs

IBM RAD Performance Tips and Best Practices for Development

Figure 6 : Validation

7. Swapping:

If you minimize Rational Application Developer, it is very possible that Windows will swap Rational Application Developer out of physical memory. This happens with any large application, but it is particularly bad for Java based applications (like Rational Application Developer), since the memory that it uses is so dispersed. Swapping an application back into memory is very slow, often slower than starting the product from scratch. It is so slow that developers sometimes think that their system is hung.

One way to tell if Rational Application Developer is swapping back-in, is to bring up the Task manager and look for the Rational Application Developer (javaw.exe) process. You know that Rational Application Developer is being swapped in, if you see the Mem Usage counting up (a megabyte or two per second) slowly.

8. Task Manger:

If you sort by Mem Usage, it will list the processes that are using the most physical memory. If you are running both Rational Application Developer and the WebSphere test server, the large javaw.exe is most likely Rational Application Developer, and the large java.exe is most likely the WebSphere Application Server.

Note the distinction between javaw and java.

The other number to pay attention to is the Commit Charge at the bottom of the window. If the Commit Charge is higher than the amount of physical memory that you have on your system, then your system may be thrashing. In this case, reducing the amount of memory that is needed or getting more memory will help your performance.

9. Early Startup:

Accessed from the Windows > Preferences ->Workbench-> Start Up and Shutdown

IBM RAD Performance Tips and Best Practices for Development

IBM RAD Performance Tips and Best Practices for Development Figure 7 : Early Startup These preferences

Figure 7 : Early Startup

These preferences control which plug-ins start automatically as part of startup. At this point in time, it‟s not recommend disabling any of them. We have not been able to measure much of a performance difference.

10. Disable Automatic Publishing on Startup

Automatic publishing can be disabled by navigating to Windows > Server - >Launching which can reduce the startup time

IBM RAD Performance Tips and Best Practices for Development

IBM RAD Performance Tips and Best Practices for Development Figure 8 : Disable Automatic Publishing on

Figure 8 : Disable Automatic Publishing on Startup

11. Server Admin Console Configuration

Once the Admin Console is running, select the server (it is usually called server1; Servers->Application Servers->Server1), and ensure that the Run in development mode and Parallel start options are selected. This will provide even more server startup improvements.

IBM RAD Performance Tips and Best Practices for Development

IBM RAD Performance Tips and Best Practices for Development Figure 9a : Server AdminConsole Configuration 

Figure 9a : Server AdminConsole Configuration

Check if there are any not-needed applications that could be removed. There are a

couple of small sample applications (DefaultApplication, ivtApp and query) that

are installed by default. These can be safely removed.

If you don't need the universal test client (it is enabled by default), you should clear its checkbox so that it won‟t be installed.

The Optimize server for testing and developing option should always be checked. This sets some JVM parameters that improve the startup time of the server.

IBM RAD Performance Tips and Best Practices for Development

IBM RAD Performance Tips and Best Practices for Development Figure 9b : Server AdminConsole Configuration 12.

Figure 9b : Server AdminConsole Configuration

12. RAD Console setting

Minimize continuous console focus when not required by disabling the view when writing to standard outs.

IBM RAD Performance Tips and Best Practices for Development

IBM RAD Performance Tips and Best Practices for Development Figure 10 : RAD Console setting 13.

Figure 10 : RAD Console setting

13. Deployment Options

Web projects can be deployed either on Server or the Workspace in RAD. This can be configured while creating the server.

in RAD. This can be configured while creating the server. Figure 11: Showing Deployment options Deploying

Figure 11: Showing Deployment options

Deploying on the „workspace‟ is found to be more efficient in publishing times and hot deployments. „Workspace‟ option should be chosen as often as possible during development.

14. JVM Tuning:

IBM RAD Performance Tips and Best Practices for Development

Accessed from the Run->Run Configurations->Java Application->Arguments

There have been a number of articles that discuss parameters that you can use to tune the JVM. The main parameter that is usually mentioned is the -Xmx parameter. This parameter is used to limit the amount of memory that the Java heap is allowed to allocate. The default for Rational Application Developer's JVM is to use up to one half of the physical memory. So for example, if you are running on a 1GB machine, the heap could grow to 0.5GB.

In general, it is better not to change this parameter, especially on machines that have 1GB or less memory. The consequences of setting this too low are quite bad, since Rational Application Developer will fail with an OutOfMemoryError.

Other parameters that are safer to experiment with are: -Xmaxf and -Xminf. These parameters control how the heap is expanded and contracted. The defaults are:

-Xmaxf0.6

-Xminf0.3

The numbers are percentages. -Xmax0.6, instructs the JVM to try to compact (shrink) the heap if the amount of free space exceeds 60%. Setting this to a smaller number will cause your heaps to be smaller, at the cost of doing more garbage collections. For example, - Xmaxf0.4 will cause heap compaction if the free space exceeds 40%.

The -Xminf parameter is used to control the minimum free space. The setting -Xminf0.3 instructs the JVM to expand the heap, if after doing a garbage collection it doesn't have at least 30% free space.

If you are having memory problems you could try experimenting with -Xmaxf0.4, -

Xminf0.2

The advantage of using these parameters over the -Xmx parameters is that you won't artificially get an OutOfMemoryError.

Another parameter that you can add is -Xgcpolicy: optavgpause. This will cause part of the garbage collection to run concurrently and will help reduce any pauses that are caused by garbage collection.

If you want to change any of these parameters, one way of doing it is by editing the rationalsdp.ini file. This file is found in the Rational Application Developer installation directory. If you would like to try an experiment, try copying and pasting these lines into your rationalsdp.ini file:

VMArgs=-Xminf0.2

VMArgs=-Xmaxf0.4

15. Multiple Application Server support

IBM RAD Performance Tips and Best Practices for Development

If you have multiple application servers to support, RAD supports adapters for most of the non-WAS servers. So applications can be deployed from RAD instead of deploying them on the standalone server saving development time.

them on the standalone server saving development time. Figure 12a: Multiple Application Server support You can

Figure 12a: Multiple Application Server support

You can click on “Add” and select the application server adapter to be added to RAD‟s runtime environment. You can even download new adapters to be loaded from download site.

You can even download new adapters to be loaded from download site. Figure 12b: Multiple Application

Figure 12b: Multiple Application Server support

IBM RAD Performance Tips and Best Practices for Development

Best Practices for Development

Following is the list of some of the best practices for development we have used in our projects.

1.

It

is a good practice to stop the server and close the RAD when the work is

completed for the day.

2.

If you find that your changes have not been reflected in the application, better to clean the application and build the application by using Project > Clean.

3.

It would be better to avoid starting the server in debug mode. Start the server in Debug mode whenever it necessary.

4.

If your system is getting out of memory, there would be one of the reasons that the server heap dump with large capacity created in \ profiles \ <Appropriate Profile Folder (E.g.: default) >. Delete those files with the extension .dmp files.

5.

Over a period of time, there is metadata that accumulates in the workspace (in the .metadata directory). This includes things like log files, for instance. Cleaning this up every so often means that there are less things needed to keep track of for Rational Application Developer

6.

As a general rule you should not have projects in your workspace that are not needed. They just cause extra overhead when building, validating and indexing your workspace

7.

Install only what you will use in your application development and uninstall features that you no longer require.

8.

Periodically starting with a clean workspace and re-importing your source will improve performance. This is quite easy to do if your projects are all st ored in

a

source control system.

9.

As you use more functions, more classes are loaded into memory. Rational Application Developer uses lazy loading, so the code for a particular function is not loaded until it is required. For example, if you do not usually use the XML editor, but in this session you edited one XML file, the XML editor is loaded only when it is needed. However, once it is loaded it will not be un- loaded. The only way to free this memory is to close and restart Rational Application Developer. You should close Rational Application Developer at least once a day.

10.

Avoid frequent minimizing of Rational Application Developer since that will initiate memory swap.

11.

When creating server profiles, do not select the option starting the server as a windows service, as over time when you have many profiles, the servers will be started even when you are not using them consuming memory and CPU.

IBM RAD Performance Tips and Best Practices for Development

Resources

Further going beyond for any other information on IBM RAD refer to the infocenter link