This article describes a performance optimization tweak for Trader Workstation that helps to get TWS running faster and smoother, and even to prevent an occasional crash (Out of Memory error).
Interactive Brokers Trader Workstation is a powerful trading platform. However, out of the box configuration contains basic settings which are not optimal for serious users. Fortunately there is a simple way to update default configuration to improve runtime performance of TWS.
Increasing Java Memory Size
This bumps up amount of memory allocated to TWS to 1GB from default 256 or 512mb (depending on TWS version). More memory will help TWS run faster, do this only if you have at least 4GB of memory on your computer.
Windows
1) Right-click on TWS icon, and select “Properties”
2) In the shortcut’s Properties window, in “Target” field add the following parameters at the end of the value (don’t forget to add space) : ” -Xmx1G -XX:MaxPermSize=256M”. Complete value of “Target” field should look something like this:
C:\Windows\System32\javaw.exe -cp jts.jar;total.2012.jar -Dsun.java2d.noddraw=true -Dswing.boldMetal=false -Dsun.locale.formatasdefault=true jclient/LoginFrame C:\Jts -Xmx1G -XX:MaxPermSize=256M
NOTICE: if you are using 64-bit Java (JRE/JVM) and have plenty of memory you can increase amount even further by setting -Xmx2G or -Xmx4G
Mac OS
1) In Finder go to Applications directory
2) Find TWS Trader Workstation app icon, right-click, select “Show Package Contents”. This will open a new directory view of the TWS application contents.
3) Expand Contents -> MacOS directory.
4) Open ‘JavaAppLauncher’ file in text editor: Right-click on ‘JavaAppLauncher’ file, click on “Open With…” option in the popup menu, click “Other…”, then find ‘TextEdit’ app in the list, or any other text editor you have installed.
6) In the ‘JavaAppLauncher’ file find line that starts with “java -cp”
7) Add following parameters after the jar file name (don’t forget to add a spaces around): ” -Xmx1G -XX:MaxPermSize=256M ”
Your ‘JavaAppLauncher’ file should contain records similar to this towards the bottom of the file:
8) Save file in the text editor and close it.
NOTICE: if you have at least 4GB, and ideally 8GB of RAM on your computer you can add even more memory by setting -Xmx2G or -Xmx4G in the file above.
Trading Geeks provides consulting in trading strategy and software development for independent traders and hedge funds. Please inquire for more information or a free quote for your project via Contact Us form on the right.
Actually in Mac OS X the file you need to change is found under
Users/*username*/Jts/tws.options
Thanks for the tip
Thanks Phillipe but that file only shows:
# maximum Java heap size
-Xmx768m
Should I just change last line to: -Xmx2G ?
Yes, -Xmx2G would work.