TWS Java Bloat or do you have any other ideas?

Discussion in 'Retail Brokers' started by patch227, Mar 6, 2007.

  1. patch227


    TWS Java Bloat or do you have any other ideas?

    I am running a P4 3.2g with RAM recently upgraded to 2 gig from 1 gig. In the last month or so I have noticed that the longer TWS (Standalone) javaw.exe runs the bigger the memory use to the degree that after 6 hours of trading the system crashes.
    Tws starts out using about 81000k and ends up using 300000k depending on how long it runs.

    The CPU usage usually runs at around 10%.
    This problem only occurs during regular trading hours and even if I am only running TWS and nothing else.

    I don't use TWS charts either

    Can anyone give me any idea as to what is causing this and how to fix it?

    Thanks in anticipation

  2. ids

    ids Interactive Brokers

    What you mean by "system crashes"? Why do you believe that consumption of 300M of memory on 2G computer is the problem? How much memory TWS will consume if you minimize it? The minimization will cause a garbage collection.
  3. Hi Ids,

    What do you mean by 'The minimization will cause a garbage collection'? I have it running minimized bacuase I use Ninja as front end.

  4. I told them about a memory leak a month ago, that was finally fixed in the latest stand alone build. 867.4

    Make sure you are running that. If you are, there is another memory leak that needs to be fixed. No reason for that usage, as TWS is not storing data.
  5. patch227


    I meant by system crash that TWS hangs and stops working. I have to end the TWS process with the Task Manager and restart.

    I believe that is a problem because TWS operates slower and slower and then crashes.

    I don't know how much memory TWS will consume when minimized and I will try minimizing it and see.

    What does garbage collection mean?

    Thanks Stock777 I am running latest build and latest Java
  6. 1. You dont want the latest java (1.6) ... tws is tested for 1.5.xx I am running both versions so that zlt has 1.6 but have pointed the tws load at the 1.5.11 javaw.exe not the 1.6 version because issues have been reported here that went away when people went back to the supported version (1.5.11)

    2. Garbage collection is java related. If tws is minimized you must restore it first then you minimize it. If its on screen minimization alone will cause garbage collection - just note the size of the javaw.exe before and after.
  7. Hi Kiwi,

    What is the best way to deal with this 'garbage' issue?

  8. patch227


    Thanks kiwi

    Where do you find the info on the Java build suited to TWS. I don't see a mention of it in the Release notes

  9. I agree with #1 above....I was just told a fairly significant bug in the 1.6 version of Java JRE was discovered....thread objects were not being garbage-collected. This could be significant if TWS is constantly creating and destroying threads. Despite V 6 having the advantage of being faster, I would wait till this bug is fixed.
  10. Starting with Java V 1.5, new memory usage parameters have been made available.
    However, implementing them is a bit tricky:
    1) create a file in the c:\windows\Sun\Deployment subdirectory. A file named deployment.config must be present.
    (Note: do not use Notepad, use a good editor like Visual Slickedit that recognizes end-of-line characters properly)

    2) insure these two entries are in the above file:

    3) search your hard drive for a file.
    Copy that file to the above directory.

    4) Edit the file and add this line or edit the existing line:
    (The smiley above is a "D")
    The above assumes you are running the latest Java 1.5 JRE. Check your control panel Java icon to see which one you are running.
    Also, the above uses 512 mb of ram; if you have 2 gigs, you may want to move that up to a value of 1024m.

    Another parameter related to garbage collection is this:
    This will cause the JVM to perform garbage collection in parallel mode with a separate thread.
    The -Xincgc can just be added to the above args parm value with a leading space.
    #10     Mar 7, 2007