TWS reducing memory usage , skipping version check

Discussion in 'Trading Software' started by es45, May 21, 2010.

  1. es45

    es45

    Inside tws directory there is a folder that stores profile : dwh .... 9 characters.

    1st)

    Edit content of nia.properties file to this:

    #HSQL Database Engine
    hsqldb.applog=0
    hsqldb.script_format=0
    runtime.gc_interval=0
    sql.enforce_strict_size=false
    hsqldb.cache_size_scale=1
    readonly=true
    hsqldb.nio_data_file=true
    hsqldb.cache_scale=1
    version=1.8.0
    hsqldb.default_table_type=memory
    hsqldb.cache_file_scale=1
    hsqldb.log_size=1
    modified=no
    hsqldb.cache_version=1.7.0
    hsqldb.original_version=1.8.0
    hsqldb.compatible_version=1.8.0

    and change file attributes to read only.




    2nd)

    Sometimes tws creates a lot of files named nia_... and when this happens it triggers the memory consumption.

    I wrote a simple batch program to clear this rubbish running inside amibroker:

    del tws.tmp /f /q
    del nia_*.* /f /q
    del *.trd /f /q
    del *.rul /f /q

    Settings are in tws.xml


    - Now trading with tws 895 and I'm trying 890.6 bypass version check when tws logon :

    -Change registry settings :
    [HKEY_LOCAL_MACHINE\SOFTWARE\Trader Workstation]
    "version"="9037"

    unsuccessfully


    -Change jts.jar\jclient\version (exchange files btw versions)
    unsuccessfully


    Gateway still takes a lot of memory and update 904 does not work with IBcontroller .


    tws 895 version takes 18Mb of memory and 140Mb of virtual memory , XP and java 1.6.0.18


    sorry bad english

    Any ideas more ?
     
  2. LeeD

    LeeD

    Interesting effort!

    I tried the gateway out of interest only and my iprssion was its memory use was in teh range of 30mb... which is very good compared to TWS. Maybe the memory use grows a lot when one streams quotes or does lots of trades....

    IBcontroller here is an Amibroker autotrading connection, not a tool from yahoo groups that logs into TWS automatically and prevents auto logoff, right?
     
  3. es45

    es45

    Right .

    IBcontroller

    That's a minor problem.
    standard error with the 904 version:

    Error Code 200, No Security definition has been found for the request

    No problem with 903 or lower.
     
  4. Thank you. Your post saved me a lot of time and appears to have solved my problem with TWS crawling to a standstill

    have a great weekend
     

  5. sounds like you should be a programmer for IB.:)
     
  6. pfranz

    pfranz

    I was examining windows on my pc with Spy++ when I discovered that TWS keeps open many of its windows - making them invisible - when you close them. For example, if you ever open the Account window, it will be destroyed only when you close TWS.
    Think this eats resources...
     
  7. That should be a trivial amount of memory for any modern computer.
     
  8. pfranz

    pfranz

    Not sure about that. Java, and Swing in particular, are excellent at wasting resources when doing the simplest things. Consider that IB Gateway, just to open some sockets and translate from FIX to API, takes at least one million bytes of memory