IB TWS taking a lot of memory

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

  1. regulus

    regulus

    I had another test with these parameters. With this setting, Gateway crashes after some hours as well, after memory usage gets to around 1.1 GB. For some reason, when I try to open the log file with HPjmeter, I get the failure message below.
     
    #81     May 15, 2013
  2. ddecker

    ddecker

    Awesome error message.

    Yeah, those parameters were just in case it was a permgen issue, but I took a look at your log and it seems very much like TWS is leaking memory as you've always suggested. The oldgen is completely full, with no space to grow and none freed on collection.

    I can't imagine everyone is experiencing this so presumably it's a result of whatever API functions Multicharts are calling. As I said earlier, there are some things you could do to try to track down the offending API operations, but that's IB's job, not yours. I'd send them all this info and demand attention.

    Good luck.
     
    #82     May 16, 2013
  3. pfranz

    pfranz

    ddecker,
    this is not a matter of API: I connect to Gateway directly with a TCP/IP socket the same way java and C++ clients do in the IB API package.
    I download 2000 seconds (the maximum allowed) per historical data request.

    regulus,
    if ib doesn't pay attention,post it here and I'll try to send them my results that show I have a (small) memory leak.
    I think you should try to convince multicharts guys to work on this problem together with ib.
    If you want to make another try,a good idea could be to try to do the same data downloads multicharts does,using IB java API client,and see if you can make the memory leak come out. At this point,it would be easy to convince ib.
     
    #83     May 16, 2013
  4. ddecker

    ddecker

    I don't mean the API client code itself. That doesn't even run in the same process as the gateway/TWS. I'm referring to whatever gateway/TWS in-process activities result from calling specific API functions, whether by IBs API, custom client, or telneting to the socket and typing in requests manually.
     
    #84     May 17, 2013
  5. pfranz

    pfranz

    today I tried 933.5 for hours: I used it to trade,then had to go away,then returned:in a total of 5 hours, memory usage is always 140-145 MB.
    Program is getting quotes and 1-second historical data for futures and forex.
    heap size being 96MB, maybe gc is sweeping memory,but I always see 0%,1% or 2% cpu utilization from gateway (sometimes 6%).
    So,now I'd say no memory leak.
     
    #85     May 17, 2013
  6. regulus

    regulus

    #86     Jul 17, 2013
  7. Mine started using ~700MB & made PC fans run loud. Save settings to server in login box, close TWS, uninstall (unwise.exe), then re-install stable version. Now using 370MB. Easiest / quickest fix
     
    #87     Jan 21, 2015
  8. "TWS is not taking enough memory"
    what's the best settings nowadays?
    i want it to utilize as much memory as possible, of course. It takes just 1gig. Sometimes too high java mem size values can be contraproductive. So I wonder who knows the good values for current tws.exe.
     
    #88     May 1, 2016