Skip to content
Prasad Talasila edited this page Jun 26, 2020 · 5 revisions

Memory Settings

Overture and the VDM models run on Overture tool are memory intensive. Hence, you as a user might need to tune the Java Virtual Machine (JVM) settings for effective user of Overture tool. This Eclipse help for proper way to define JVM settings for launching Overture application from inside Eclipse project. In case you are using the Overture executable directly, please modify Overture.ini file.

Some useful VM arguments are:

-XX:+UseG1GC 
-XX:+PrintGCDetails 
-XX:+PrintTenuringDistribution 
-Xloggc:/<absolute_file_path>/overture_gc.log   
-XX:+UseStringDeduplication 
-Xmx1g 
-XX:NewSize=50M 
-XX:MaxNewSize=100M 
-verbose:class 
-Xprof 
-XX:+UnlockDiagnosticVMOptions 
-XX:LogFile=/<absolute_file_path>/overture.log

A concise explanation of these and some other flags is provided below.

Flag Explanation
-Xms min heap size, for example -Xms1g
-Xmx max heap size, for example -Xmx4g
-XX:+UseG1GC GI GC algo; also use string deduplication flag
-XX:NewSize=size 0.25 to 0.5 of total heap; smaller leads to frequent GC and delays full GC
-XX:MaxNewSize=size Sets the maximum size (in bytes) of the heap for the young generation (nursery)
-XX:+UseStringDeduplication deduplicate immutable strings
-XX:+PrintGCDetails Enables printing of detailed messages at every GC.
-Xloggc:filename Sets the file to which verbose GC events information should be redirected for logging
-XX:+PrintTenuringDistribution Enables printing of heap tenuring age information
-verbose:class log of classes loaded into method area of JVM memory; lots of details, but might be useful as a last option to track classes in large models; this log is shown on the terminal, you might want to redirect the same for later analysis.
-Xprof Shows the logs of classes being interpreted / compiled inside Overture (see the explanation)
-XX:+AggressiveHeap Enables automated heap optimization. Worth an initial try

The above given default settings are useful for small models running on Overture. If you have reasonably complex models, you might want to adjust the settings.

The debug flags of JVM are not well documented. To see the list of available debug flags for your version of JVM, try

java -XX:+UnlockDiagnosticVMOptions -XX:+PrintFlagsFinal -version

A brief explanation of these debug flags is available on the man page (man java) or oracle website.


Log Analysis

Once the logs are stored in "overture.log" and "overture_gc.log", the following commands can be used to quickly parse the logs

Command Purpose
grep overture overture.log shows overture classes being loaded. If your packages are in different namespace, please change the grep keyword.
grep -C 2 Eden overture_gc.log shows the sizes of Eden (fresh objects), Survivors (have been around for a while) and Heap size. The numbers in the brackets are allocations to respective regions and the numbers outside the brackets are the current use of the allocated space.

To understand the log data in overture_gc.log, please see [oracle}(https://blogs.oracle.com/poonam/understanding-g1-gc-logs) and stackoverflow pages.

To figure out the classes being loaded and compiled / interpreted, use the "-verbose:class" / "-Xprof" flags. The log results of these two flags get dumped to the terminal. You need to redirect them to a file for later analysis.

Clone this wiki locally