TWS Java Bloat or do you have any other ideas?

Quote from syswizard:

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:
deployment.system.config=c:\\windows\\Sun\\Java\\Deployment\\deployment.properties
deployment.system.config.mandatory=false

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

4) Edit the file and add this line or edit the existing line:
deployment.javapi.jre.1.5.0_11.args=-XX:DefaultMaxRAM=512m
(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:
-Xincgc
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.

Wow, and here I am mistakenly thinking that I know few things about computers. Thanks for this info.

I had TWS minimized last night, but the size of javaw.exe did not increase even a bit. There were several files with this name, and their size was about 50kb.

I only trade 1 product at a time.

redduke
 
Someone mentioned a bug in 1.6. I have been using 1.6 and it seems a lot faster. Is there an upgrade coming to fix this bug?


By the way, any IB customers know if there is any difference between using the automatic upgrade procedure via the 'check for ib upgrade' or just manually installing the latest version over of an older version from the website? There is a newer version out and my automatic upgrade is NOT working. LOL. I go to log in and IB TWS tells there is an upgade availible then I go to automatic upgade and it tells me I am running the latest version.......
 
There is a newer version out and my automatic upgrade is NOT working.

Glad this isn't only me! Automatic update loads every single day when I start any of my 3 PC's now, instead of every few days like it used to. This is really annoying, and has been going on for at least a month. Furthermore, it doesn't appear to actually be upgrading TWS. I had to manually upgrade TWS to the last update, even though the stupid automatic upgrade is running every day.


Is this how it is working for you?

By the way, any IB customers know if there is any difference between using the automatic upgrade procedure via the 'check for ib upgrade' or just manually installing the latest version over of an older version from the website?

Upgrading TWS manually didn't seem to cause any problems for me. I also upgraded TWSAPI at the same time, and this did have an incompatibility with my own software. If your not using TWSAPI, I don't think it will be a problem.
 
Quote from syswizard:

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.


I went back to Java 1.5 about a month ago after major slowness using 1.6. Much better performance since then.
 
Thanks to all who contributed to this thread. IDS from IB sent me a solution which seems to have worked. here it is:


Java will try to use as much memory as it needed in limits set from the command line. Even if the memory is released, it will not be visible in the Task manager. Java garbage collector releases this memory. If you minimize, you will be able to see how much is really allocated.
The TWS hanging is really bad thing but I am not sure it happens because of the memory leak. Meanwhile, try to right click on TWS icon, pick properties, target, and change value of

-Xmx256M (or whatever your value is)
to
-Xmx512M
or even
-Xmx768M

Restart TWS after that and see if it helps to give more memory to TWS and fix your problem at least this rough way.

Thanks,
ids
 
Sounds like good advice to me. Java applications can get very slow or appear to hang if the memory heap is close to being completely used up (eg if there is a significant memory leak). Under these circumstances the JVM keeps running garbage collection in an attempt to stay in business. This chews up CPU cycles.

The -Xmx parameter is the maximum heap size allowed for your Java app. Making it bigger may provide a work around for an app with a serious memory leak, or simply may be necessary for an app that uses a fair bit of memory.

Quote from patch227:

Thanks to all who contributed to this thread. IDS from IB sent me a solution which seems to have worked. here it is:


Java will try to use as much memory as it needed in limits set from the command line. Even if the memory is released, it will not be visible in the Task manager. Java garbage collector releases this memory. If you minimize, you will be able to see how much is really allocated.
The TWS hanging is really bad thing but I am not sure it happens because of the memory leak. Meanwhile, try to right click on TWS icon, pick properties, target, and change value of

-Xmx256M (or whatever your value is)
to
-Xmx512M
or even
-Xmx768M

Restart TWS after that and see if it helps to give more memory to TWS and fix your problem at least this rough way.

Thanks,
ids
 
The approach I take to garbage collection is simply to restore a minimized TWS and then minimize it again a few hundred milliseconds later. If its already restored then just minimizing it will do it.

After doing that you can observe the drop in memory usage.

When I only had 384k of ram I had a little macro routine that did it every half hour on the hour (so I wasn't surprised) but now that I'm running 2G I haven't needed it.
 
Quote from dcraig:

The -Xmx parameter is the maximum heap size allowed for your Java app. Making it bigger may provide a work around for an app with a serious memory leak, or simply may be necessary for an app that uses a fair bit of memory.
The Xms and Xmx arguments / property settings will most likely be eventually deprecated....see the post (attached) on the new memory control parameters.
 

Attachments

Back
Top