-3

I am running TWS from Interactive Brokers in Parallels on a Mac. When I use the cloud-based link or the stand-alone application, TWS takes up 99% of available CPU. Is there a way that I can limit amount of RAM the JVM will be allocated?

I have 4gig of memory allocated to the Parallels VM. TWS is taking up about 433K of memory.

I added -Xmx300M -Xms300M to the command line for starting TWS, but this did nothing. When I start up, it is still consuming 99% of CPU and has 400K of memory allocated

Rob Little
  • 35
  • 3
  • 4
    what is the conection between CPU consumption and RAM allocation?? – Sharon Ben Asher Aug 31 '15 at 11:45
  • @sharonbn one possiblity is having a GC running continuosly because heap is full, but it would eventually get an `OutOfMemoryException` – Fran Montero Aug 31 '15 at 11:47
  • Does it http://stackoverflow.com/questions/1493913/how-to-set-the-maximum-memory-usage-for-jvm answer your question? – Paulo Aug 31 '15 at 11:49
  • 1
    If the CPU time is going in garbage collection, you want to *increase* the RAM, not decrease it. – user207421 Aug 31 '15 at 11:49
  • Thanks. Can I add these "-Xms -Xmx" arguments to the short cut? Do I want to limit memory or CPU usage? – Rob Little Aug 31 '15 at 11:51
  • You can't limit CPU usage, and I've already addressed the other part of that. What you can add to the shortcut depends on the nature of the shortcut. – user207421 Aug 31 '15 at 11:59
  • I added -Xmx300M -Xms300M to the command line for starting TWS, but this did nothing. When I start up, it is still consuming 99% of CPU and has 400K of memory allocated. – Rob Little Aug 31 '15 at 12:00
  • So GC isn't the problem then, or RAM. So your question is now null. Start again. Find out what thread is running and what it's doing. – user207421 Aug 31 '15 at 12:05
  • Setting the maximum heap of a JVM doesn't limit all memory usage, there is the threads, the shared libraries, the GUI component, socket buffers etc. – Peter Lawrey Aug 31 '15 at 12:29

1 Answers1

0

I found the problem to be with Parallels. I was using Parallels 8. When I used TWS on a stand-alone Windows machine, the CPU usage never exceeded 50%.

I created a new VM with Parallels 8, and the CPU usage was still 99%.

I upgraded to Parallels 11 and created a new VM and installed TWS. Now it takes less than 10%.

Rob Little
  • 35
  • 3
  • TWS takes way more memory than 300M. My guess is you reinstalled TWS and used the default cmd line from the install which includes ` -Xmx768M -XX:MaxPermSize=128M`, so now you have enough memory. – brian Sep 01 '15 at 02:47