/>
Teamcenter

Software Notice: String Deduplication in Teamcenter

January 23, 2017

The following software notification has been issued by Siemens PLM Software.

Affected Software: Teamcenter 10.1.4 and higher version

PROBLEM:

String objects consume a large amount of memory in an average application. In practice, a lot of Strings could be duplicated due to various reasons. Java 8 has introduced a new feature called String Deduplication, reducing memory footprint of java application.

REMEDY:

String deduplication is looking for not processed strings, calculates their hash codes and then looks if there are any other strings with the same hashcode and the equal underlying char[]. If found, it replaces a new string char[] with an existing string char[]. Sting deduplication is processing only strings which have survived a few garbage collections. This ensures that a majority of very short living strings will not be processed. The minimal string age is managed by -XX:StringDeduplicationAgeThreshold=3 JVM parameter (3 is the default value of this parameter).

Since the garbage collector recognizes duplicates String and merges them, this costs some CPU power, but it shouldn’t be much of a concern because the garbage collector runs in its own thread. Plus, on the long run the reduced memory footprint makes the garbage collector run faster. As per oracle’s observation, this feature of JDK can decrease heap usage by about 10%.

Reference links:

https://blogs.oracle.com/java-platform-group/entry/g1_from_garbage_collector_to

https://blog.codecentric.de/en/2014/08/string-deduplication-new-feature-java-8-update-20-2/

We tested this feature in Teamcenter Rich Client, our test result shows average 16.96% decrease in memory usage. We highly recommend to use this feature for your performance tuning up and it is very easy to use.

To use this feature, JRE1.8 update 20 or higher version is required and G1 Garbage Collector (G1GC) is required by specifying it in VM arguments list along with StringDeduplication parameter. Add two VM arguments in portal.bat on windows platform or portal.sh on Linux platform as below

[PLEASE NOTE, Applied CAx has not adjusted or verified linebreaks from the Siemens PLM Software notice]:

In portal.bat, add “-XX:+UseG1GC -XX:+UseStringDeduplication” argument
after “-XX:MaxPermSize=128m”. For example:
start Teamcenter.exe %* -vm “%JRE_HOME%binjavaw.exe” -vmargs -Xmx%VM_XMX%
-XX:MaxPermSize=128m -XX:+UseG1GC -XX:+UseStringDeduplication
-Xbootclasspath/a:”%JRE_HOME%libplugin.jar”;”%JRE_HOME%libdeploy.jar”;”%
JRE_HOME%libjavaws.jar”

In portal.sh, add “-XX:+UseG1GC -XX:+UseStringDeduplication” arguments
after “-XX:MaxPermSize=128m”. For example:
./Teamcenter ${SCRIPT_ARGS} -vm ${JRE_HOME}/bin/java -vmargs -Xmx1024m
-XX:MaxPermSize=128m -XX:+UseG1GC -XX:+UseStringDeduplication ${DJIPJL_VMARG}

It’s time to unleash your potential

Reach out to the team at Applied CAx to learn how our solutions can make your company’s goals achievable.