0 Replies Latest reply: Dec 29, 2009 12:14 PM by 843829 RSS

    Elevated Java 1.6 CPU usage, affected by other apps

    843829
      Hello,

      We upgraded our application from java 1.5 to 1.6 and have now strange elevated CPU problems on some computers. On some customer computers the CPU usage can skyrocket from 30% (on java 1.5) to 80% (on java 1.6.0_17) and become unresponsive.

      Below I provide a simple example how firefox with flash can affect my standalone (!) test application on my Windows 7 (quad core, AMD 64 bit), but this problem seems to be wider then that (so please do not advice to reinstall flash etc). On other (XP) computer exactly the same test runs just fine, so you may not be able to reproduce it.

      My example (see snippet below) is a very simple test. On java 1.6 it takes about 4% of CPU (without firefox). When I start firefox with flash (flash plugin is essential in this case), the java.exe CPU usage rises to about 12%, then I close firefox and it is back to 4%. When I run the same on java 1.5 it always stays at the same level (4-6%). I could provide more cases when java CPU usage is affected by other apps, but that is not the point.

      Do you have any idea what can cause this?
      while (true) {
           try {
                float a = 0;
                for (int i = 0; i < 900000; i++) {
                     a += 2.0f;
                     a /= 2.0f;
                }                    
                Thread.sleep(10);
           } catch (Exception e) {                    
           }
      }