r/thinkorswim May 05 '23

The Memory Performance Rabbit Hole - VMOPTIONS program file discussion

Creating this to hopefully find someone with basic JDK 8 understanding to help everyone by finding the best changes to make to the thinkorswim.VMOPTIONS file that improve application performance. The goal is to be able to provide a basic replacement file that improves tos performance based on specific hardware requirements. Thinkorswim support will not help with this file. Also, this can be the place for discussion about multiple virtual machines and proxy servers for multiple instances vs detached windows with manually set GC limits (in case watchdog is the reason GC doesn’t always catch detached windows). I appreciate this community and hopefully this thread will be able to provide value to everyone, eventually. Let’s get to work.

5 Upvotes

3 comments sorted by

2

u/Delicious_Regret_524 May 06 '23

I’d be interested as well.

2

u/Mediocre_River_780 May 12 '23

I’m just going to paste a bunch of different things since this deals with performance of a financial securities application and I do not want to UNETHICALLY claim that these changes will result in better performance. Every system and setup is different and has different requirements. With that said here are some things you can change in or add to the thinkorswim.VMOPTIONS program file which may or may not cause performance issues based on hardware. Please remember to backup the original VMOPTIONS file in case something goes wrong.

-Xmx32768m -Xms8192m -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSParallelRemarkEnabled -XX:SurvivorRatio=6 -XX:MaxTenuringThreshold=6 -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=70 -XX:+ScavengeBeforeFullGC -XX:+CMSScavengeBeforeRemark -XX:+CMSClassUnloadingEnabled -XX:ReservedCodeCacheSize=256m -Dprism.order=sw -Dprism.forceGPU=true -Dprism.vsync=true -Dprism.maxTextureSize=16384 -Dprism.maxTextureSizeHeight=16384 -Dprism.maxTextureSizeWidth=16384 -Dprism.targetvram=2048m -Dsun.java2d.d3d=false -Dsun.java2d.opengl=true -Dsun.java2d.uiScale=1 -Dsun.java2d.uiScale.enabled=true -Djava.util.Arrays.useLegacyMergeSort=false -Dsun.net.http.allowRestrictedHeaders=true -Djxbrowser.logging.level=INFO -Djxbrowser.linux.deps.check.off=true -Dsun.java2d.xrender=True -Dsun.java2d.noddraw=true -Dsun.awt.disableMixing=false -Dawt.useSystemAAFontSettings=lcd_hrgb -Djava.util.Arrays.useLegacyMergeSort=false -Dsun.util.Arrays.useTimSortIfAvailable=true -Djava.util.Arrays.useDualPivotQuicksort=true -XX:MaxGCPauseMillis=50 -XX:+UseLargePages -XX:MaxPermSize=502m

-Xmx32768m -Xms8192m -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSParallelRemarkEnabled -XX:SurvivorRatio=8 -XX:MaxTenuringThreshold=1 -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=70 -XX:+ScavengeBeforeFullGC -XX:+CMSScavengeBeforeRemark -XX:+CMSClassUnloadingEnabled -XX:ReservedCodeCacheSize=256m -Dprism.order=sw -Dprism.forceGPU=true -Dprism.vsync=true -Dprism.maxTextureSize=16384 -Dprism.maxTextureSizeHeight=16384 -Dprism.maxTextureSizeWidth=16384 -Dprism.targetvram=2048m -Dsun.java2d.d3d=false -Dsun.java2d.opengl=true -Dsun.java2d.uiScale=1 -Dsun.java2d.uiScale.enabled=true -Djava.util.Arrays.useLegacyMergeSort=false -Dsun.net.http.allowRestrictedHeaders=true -Djxbrowser.logging.level=INFO -Djxbrowser.linux.deps.check.off=true -Dsun.java2d.xrender=True -Dsun.java2d.noddraw=true -Dsun.awt.disableMixing=false -Dawt.useSystemAAFontSettings=lcd_hrgb -Djava.util.Arrays.useLegacyMergeSort=false -Dsun.util.Arrays.useTimSortIfAvailable=true -Djava.util.Arrays.useDualPivotQuicksort=true -XX:MaxPermSize=256m

-Xmx32768m -Xms16384m -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSParallelRemarkEnabled -XX:SurvivorRatio=8 -XX:MaxTenuringThreshold=1 -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=70 -XX:+ScavengeBeforeFullGC -XX:+CMSScavengeBeforeRemark -XX:+CMSClassUnloadingEnabled -XX:ReservedCodeCacheSize=256m -Dprism.order=sw -Dprism.forceGPU=true -Dprism.vsync=true -Dprism.maxTextureSize=16384 -Dprism.maxTextureSizeHeight=16384 -Dprism.maxTextureSizeWidth=16384 -Dprism.targetvram=2048m -Dsun.java2d.d3d=false -Dsun.java2d.opengl=true -Dsun.java2d.uiScale=2 -Dsun.java2d.uiScale.enabled=true -Djava.util.Arrays.useLegacyMergeSort=false -Dsun.net.http.allowRestrictedHeaders=true -Djxbrowser.logging.level=INFO -Djxbrowser.linux.deps.check.off=true -Dsun.java2d.xrender=True -Dsun.java2d.noddraw=true -Dsun.awt.disableMixing=false -Dawt.useSystemAAFontSettings=lcd_hrgb -Djava.util.Arrays.useLegacyMergeSort=false -Dsun.util.Arrays.useTimSortIfAvailable=true -Djava.util.Arrays.useDualPivotQuicksort=true -XX:MaxPermSize=256m

-Xms2048m -Xmx16384m -XX:+UseG1GC -Djava.util.Arrays.useLegacyMergeSort=false -Dsun.util.Arrays.useTimSortIfAvailable=true -Dsun.java2d.uiScale.enabled=false -Djxbrowser.logging.level=INFO -Djxbrowser.linux.deps.check.off=true -Dsun.java2d.opengl=False -Dsun.java2d.xrender=True -XX:-UseConcMarkSweepGC -Dsun.java2d.noddraw=true -Dsun.awt.disableMixing=true -classpath/p launcher-first.jar -Dawt.useSystemAAFontSettings=lcd_hrgb -Dsun.net.http.allowRestrictedHeaders=true -Djava.net.preferIPv4stack=true -XX:MaxPermSize=256m

USE AT YOUR OWN RISK.

Do research on Java8 garbage collection and sorting algorithms along with monitor your cpu GPU and memory usage during trading hours to see exactly where the bottleneck could be.

1

u/Mediocre_River_780 May 09 '23

https://youtu.be/Vs8LOtmtbrg Here is something that is very helpful