이 콘텐츠는 선택한 언어로 제공되지 않습니다.

Chapter 6. Optimizing MTR performance


MTR 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, MTR 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 MTR.

6.1. Deploying and running the application

Try these suggestions first before upgrading hardware.

  • If possible, run MTR 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 MTR using the --packages argument on the <MTR_HOME>/bin/mtr-cli command line. If you omit this argument, MTR 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.
  • 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 MTR on that server.

6.2. Upgrading hardware

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 MTR 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.3. Configuring MTR to exclude packages and files

6.3.1. Excluding packages

You can exclude packages during decompilation and analysis to increase performance. References to these packages remain in the application’s source code but excluding them avoids the decompilation and analysis of proprietary classes.

Any packages that match the defined value are excluded. For example, you can use com.acme to exclude both com.acme.example and com.acme.roadrunner.

You can exclude packages by either of the following methods:

  • Using the --excludePackages argument.
  • Specifying 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 <MTR_HOME>/ignore/proprietary.package-ignore.txt.

6.3.2. Excluding files

MTR can exclude specific files, such as included libraries or dependencies, during scanning and report generation. Excluded files are defined in a file with the .mtr-ignore.txt or .windup-ignore.txt extension within one of the ignored locations.

These files contain a regex string detailing the name to exclude, with one file listed per line. For example, you can exclude the library ant.jar and any Java source files beginning with Example with a file containing the following:

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

6.3.3. Searching locations for exclusion

MTR searches the following locations:

  • ~/.mtr/ignore/
  • ~/.windup/ignore/
  • <MTR_HOME>/ignore/
  • Any files and folders specified by the --userIgnorePath argument

Each of these files must conform to the rules specified for excluding packages or files, depending on the type of content to be excluded.

Red Hat logoGithubRedditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

© 2024 Red Hat, Inc.