IB TWS taking a lot of memory

Discussion in 'Trading Software' started by gmst, Dec 5, 2012.

  1. regulus

    regulus

    That's exactly the way Multicharts handles it: historical data is retrieved from locally stored data and only the "gaps" are downloaded, when this option is enabled.

    I tried both Java 1.6 and 1.7. According to IB support, Java 1.7 is the recommended version. I tried installing only Java 32 bit, only 64 bit, 32/64 bit in parallel (which is recommended by IB and is my actual configuration).
    All to no avail.

    I've already provided IB with tons of logs. Supposedly, since the "heavy traders" normally do not upgrade their TWS / Gateway unless they are forced to, the issue is just not that prevalent at the moment as only few traders use TWS / Gateway 933.5+.

    For the moment, I will stick with TWS 932.4.
     
    #61     May 9, 2013
  2. ddecker

    ddecker

    Sorry, I meant version 938.1. Below is a screenshot of gateway 938.1 heap usage over a day running on Debian 6.0 (32-bit) with Oracle JVM 1.6.0_45. For my application at least which admittedly isn't very demanding, I don't see any issue.

    I run with the following Java switches:

    -Dsun.java2d.noddraw=true
    -Xmx512M

    I'm not sure how much you know about Java, but if you can I'd recommend setting the maximum heap to 1G or so and turning on GC logging so you can see what is actually going on. At the very least, it will give you some evidence to complain to IB with and some material to help them correct any issue.
     
    #62     May 9, 2013
  3. pfranz

    pfranz

    Well,if the only thing that changes between us and regulus is the 64bit type OS,maybe there lies the problem.
    As I wrote,I know java very little,and I don't think customers (who are not supposed to be programmers) are expected to dig into GC.
    I won't ask IB as I don't have problems,I tried 933.5 and will try 938.1 just to help regulus and make sure that my system works fine.
    As I wrote in the past, 50-80 MB memory usage for a TCP relay is way too much,I think IB should make it lighter.
    I tried Firetip, a complete java trading application,and while using DOM and charts,memory usage was 100 MB
     
    #63     May 9, 2013
  4. ddecker

    ddecker

    Totally agree it shouldn't be necessary and in most cases thankfully it's not. Unfortunately for regulus, it seems the next logical step if he wants to see what activity is creating the issue.

    Regulus, in case you're interested to take a look, it's quite easy. Simply add the following command line switches when invoking the client:

    -Xloggc:mygc.log
    -verbose:gc
    -XX:+PrintGCDetails
    -XX:+PrintGCTimeStamps
    -XX:+PrintHeapAtGC

    This will create a file called mygc.log that includes all of the allocation/collection/heap etc. information over the life of the app. You can then use any number of apps to view the details. I prefer HPjmeter, which you can download from the HP website.
     
    #64     May 9, 2013
  5. regulus

    regulus

    Maybe you want to try to plot in your application some charts of tick data for some Futures intruments (CL, GC, YM etc.) with a historical data range of at least several days, since I have experienced the issue only under these specific conditions.


    I made some test runs on a dissimilar Win XP 32 bit workstation with Multicharts 32 and plotted some Futures charts of tick data. Same issue here, memory usage increases continuously and TWS 933.5 freezes after some hours. No issues with TWS 932.4
    However, the effect is slightly different to the memory leak that occurs in a 64 bit environment: in 32 bit, TWS first looses data connection to IB (purple grid), and then will finally freeze. Reproduced that several times.
     
    #65     May 10, 2013
  6. pfranz

    pfranz

    Is tick data available with IB? I never heard of it,I looked in the documentation and found no mention of it
     
    #66     May 10, 2013
  7. regulus

    regulus

    Yes, it's not real tick data, but more a "consolidated" datastream that updates every few seconds.
     
    #67     May 10, 2013
  8. ddecker

    ddecker

    All of my points are regarding the Gateway, not TWS. I don't use any historical data methods within my application. Again, if you want to understand what's happening, suggest you profile/log.
     
    #68     May 10, 2013
  9. pfranz

    pfranz

    regulus,
    I use only 1 sec. data,so I'm in the same case as you are.I have 1 GB of memory and set java heap to 96 MB.
    So I don't understand why my problem is much smaller than yours (actually I have no problem)
     
    #69     May 10, 2013
  10. regulus

    regulus

    I tried to integrate the Java log commands you suggested into the TWS shortcut target field, but there is a limitation of characters. Then I tried to start TWS via batch file, but I am not sure how to set the Java class path correctly. I will have another try later on.
     
    #70     May 10, 2013