Chapter 6. Optimize RHAMT Performance

RHAMT performance depends on a number of factors, including hardware configuration, the number and types of files in the application, the size and number of applications to be evaluated, and whether the application contains source or compiled code. For example, a file that is larger than 10 MB may need a lot of time to process.

In general, RHAMT spends about 40% of the time decompiling classes, 40% of the time executing rules, and the remainder of the time processing other tasks and generating reports. This section describes what you can do to improve the performance of RHAMT.

6.1. Tips to Optimize Performance

6.1.1. Application and Command-line Suggestions

Try these suggestions first before upgrading hardware.

  • If possible, execute RHAMT against the source code instead of the archives. This eliminates the need to decompile additional JARs and archives.
  • Specify a comma-separated list of the packages to be evaluated by RHAMT using the --packages argument on the RHAMT_HOME/bin/rhamt-cli command line. If you omit this argument, RHAMT will decompile everything, which has a big impact on performance.
  • Specify the --excludeTags argument where possible to exclude them from processing.
  • Avoid decompiling and analyzing any unnecessary packages and files, such as proprietary packages or included dependencies. For additional information, see Configure RHAMT to Exclude Files and Packages.
  • Increase your ulimit when analyzing large applications. See this Red Hat Knowledgebase article for instructions on how to do this for Red Hat Enterprise Linux.
  • If you have access to a server that has better resources than your laptop or desktop machine, you may want to consider running RHAMT on that server.

6.1.2. Hardware Upgrade Suggestions

If the application and command-line suggestions above do not improve performance, you may need to upgrade your hardware.

  • If you have access to a server that has better resources than your laptop/desktop, then you may want to consider running RHAMT on that server.
  • Very large applications that require decompilation have large memory requirements. 8 GB RAM is recommended. This allows 3 - 4 GB RAM for use by the JVM.
  • An upgrade from a single or dual-core to a quad-core CPU processor provides better performance.
  • Disk space and fragmentation can impact performance. A fast disk, especially a solid-state drive (SSD), with greater than 4 GB of defragmented disk space should improve performance.

6.2. Configure RHAMT to Exclude Files and Packages

6.2.1. Exclude Packages

RHAMT can exclude packages during decompilation and analysis to increase performance. References to these packages are still found in the application’s source code, but avoids the decompilation and analysis of proprietary classes.

Any packages that match the defined value will be excluded. For instance, to exclude com.acme.example and com.acme.roadrunner, you would only need to specify com.acme.

Packages may be excluded by using either of the following methods.

  • Using the --excludePackages argument, as described in the CLI Arguments.
  • Specify the packages in a file contained within one of the ignored locations. Each package should be included on a separate line, and the file must end in .package-ignore.txt. For example, see RHAMT_HOME/ignore/proprietary.package-ignore.txt.

6.2.2. Exclude Files

RHAMT can exclude specific files, such as included libraries or dependencies, during scanning and report generation. Files to be ignored are defined inside of a file ending in .rhamt-ignore.txt or .windup-ignore.txt within one of the ignored locations.

These files contain a regex string detailing the name to exclude, with one file listed per line. For instance, to exclude the library ant.jar and any Java source files beginning with Example, the following file would be used:

.*ant.jar
.*Example.*\.java

6.2.3. Locations to Search for Exclusion

RHAMT searches the following locations:

  • ~/.rhamt/ignore/
  • ~/.windup/ignore/
  • RHAMT_HOME/ignore/
  • Any files and folders specified by the --userIgnorePath argument.

Each of these files should adhere to the rules specified in Exclude Packages or Exclude Files, depending on the type of content to be excluded.