Yes, as of this evening, I have conclusions that might help others...
Let me start with contextualizing my findings with more specifics about my trading workstation. At the end of this post, I will provide conclusions that should benefit anyone with lesser or greater specs.
MODEL: HP Z620
CPU: 2 x Xeon E5-2680 v2 @ 2.80GHz (total of 20 cores / 40 threads)
RAM: 192GB DDR3
DISK: PNY CS900 1TB SSD
VIDEO: Radeon R9 Nano 4GB
SCREENS: Four physical * x virtual desktops
OS: Debian 12
JVM: Originally Zulu but currently using Corretto-17.0.11.9.1.
Next, I should probably provide a high level overview of my ToS views.
Virtual desktop #1, bottom two physical screens:
- Used for analyzing whatever stock is in #1
- Seven columns spread across both screens
- 3YM, 3YW, 1YD, 1D30m, 1D5m, 1D1m, buttons+T&S+L2
- Each chart column has about six technical indicator rows
Virtual desktop #1, top two physical screens:
- Used for monitoring four more stocks
- Two columns per stock--1D5m and 1D1m--for a total of eight columns
- Stocks in #2, #3, #4, and #5
- Each chart column has about six technical indicator rows
Virtual desktop #2, all four physical screens:
- Used to enter/exit same four stocks
- Four columns per stock--1D30m, 1D5m, 1D1m, and buttons+T&S+L2--for a total of 16 columns
- Stocks in #2, #3, #4, and #5
- Each chart column has about six technical indicator rows
Now, at the time of my last post, I had the following settings configured in thinkorswim.vmoptions:
-Xmx32768m
-Xms16384m
-DThinkScriptCalculatingPool=20
Unfortunately, I still experienced two symptoms:
1. Lagging (bad but able to endure it)
2. Crashing (very often, like 1-3 times a day, usually when interacting with the menus)
The crashing was actually so bad that I moved my use of Stock Hacker to a second computer with an entirely separate ToS instance. And even then, I used Visual Studio Code to create my scripts because it was "safer" to copy & paste rather than actually make changes within the Thinkscript "IDE". The crashing in the IDE and the crashing in the menu was just miserable.
All during this time, my computer was mostly idling. CPU and RAM was in use but not even close to 20%.
I switched between the Zulu and Corretto JVMs which didn't seem to make much of a difference. I lowered DThinkScriptCalculatingPool which didn't resolve the lagging or crashing either. So then I focused on memory, increasing the Xmx and Xms settings until I hit the max that the JVM (or perhaps ToS) would allow--Xmx65408m and Xms32768m. It just didn't seem to help.
Today I had an idea--since ToS runs out of the local folder, what if I just created multiple copies of the folder so I could run separate instances for my "views" listed above?
I set about doing this. I made four copies of my thinkorswim folder, each with a suffix that describes the purpose/view. My thinkorswim.vmoptions file in each is configured thus:
-Xmx8192m
-Xms4096m
-DThinkScriptCalculatingPool=5
I started a ToS instance from each folder and configured the following:
Instance #1, virtual desktop #1, bottom two physical screens:
- Used for analyzing whatever stock is in #1
- Seven columns spread across both screens
- 3YM, 3YW, 1YD, 1D30m, 1D5m, 1D1m, buttons+T&S+L2
- Each chart column has about six technical indicator rows
Instance #2, virtual desktop #2, ALL four physical screens:
- Used for monitoring EIGHT (up from only four previously) more stocks
- Two columns per stock--1D5m and 1D1m--for a total of 16 columns
- Stocks in #2, #3, #4, and #5
- Each chart column has about six technical indicator rows
Instance #3, virtual desktop #3, all four physical screens:
- Used to enter/exit four stocks
- Four columns per stock--1D30m, 1D5m, 1D1m, and buttons+T&S+L2--for a total of 16 columns
- Stocks in #2, #3, #4, and #5
- Each chart column has about six technical indicator rows
Instance #4, virtual desktop #4, all four physical screens:
- Used to enter/exit four stocks
- Four columns per stock--1D30m, 1D5m, 1D1m, and buttons+T&S+L2--for a total of 16 columns
- Stocks in #6, #7, #8, and #9
- Each chart column has about six technical indicator rows
Now, I made these changes this evening, i.e. after hours, so the verdict is not out yet. But already I can tell each instance runs a LOT smoother. The cross hair, which is sync'd across charts, is snappier than I have seen it in a long time. I have had zero lagging and crashing. Tomorrow will be the true performance test. I'll let you know how it goes.
Thus far, however, it seems that switching from a setup that runs everything under one instance to a setup that spreads everything over four instances is going to be a lot more efficient. I think this same concept might work for Windows and Linux users with other amounts of CPU and memory resources, i.e. calculate your DThinkScriptCalculatingPool value but then divide it by the number of ToS instances you plan to run. Also do the same with the Xmx and Xms values.