JDK-4673954 : Applets consume 100% CPU usage by using 1.4 plugin
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 1.4.1
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_nt
  • CPU: x86
  • Submitted: 2002-04-24
  • Updated: 2003-09-03
  • Resolved: 2003-09-03
Related Reports
Duplicate :  
Relates :  
Description
J2SE Version (please include all output from java -version flag):
  java version "1.4.1-beta"
  Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-beta-b8)
  Java HotSpot(TM) Client VM (build 1.4.1-beta-b8, mixed mode)

Does this problem occur on J2SE 1.3 or 1.4?  Yes / No (pick one)
  Only on 1.4 and 1.4.1 Plugin, works fine with IE native VM and
  1.3.1 Plugin.


Operating System Configuration Information (be specific):
  windows

Bug Description:
  Some applets will consume 100% CPU usage by using 1.4/1.4.1 plugin in
  Netscape and IE browser. 

  Attached a program snippet of some sort that reproduces the probelm:

     Panel m_bodyPane = new Panel();

     ....

        synchronized(viewLock_) {
            m_bodyPane.removeAll();
            System.out.println(new Date().toString());
            for (i = 0; i < m_vRow.size(); i++) {
                r = (QuoteRow)m_vRow.elementAt(i);
                if (!m_bodyPane.isAncestorOf(r)) {
                        m_bodyPane.add(r);
                }
            } // end for
         System.out.println(new Date().toString());

  Panel.add(Component) method, it takes 100% CPU, and last about 5 second to 
  add one component.
 
  m_vRow.size() is a small number, no more than 10.

  and if remove line "m_bodyPane.add(r);", CPU will be perfect. And the 
  output of "new Date().toString()" show me there is 10 to 20 seconds different.


Steps to Reproduce (be specific):
  go to http://demo.xstreamquotes.com/50trial.html (call ingrid to get
  the username and password).

  After logged in, just click those "LAST/NET/VOLUME" tabs, you will
  see the CPU usage go high up to 100%.

Comments
EVALUATION ###@###.### 2002-05-02 I did reproduce it on Window platform using 1.4.0/1.4.1 JRE. It did work fine on Unix platform. This applet is working fine under Java 1.3.1 release. I even found out it still works under 1.4.0-b75 build, but it failed under 1.4.0-b89 build. I asked the customer to run the same applet using appletviewer application, the problem still happened. So I think this is not a plugin bug, but a AWT bug. I attached the java file QuoteTable.java in the bug report. Reassign it to AWT group. Dennis Gu ---------------------------------------------------------------------------- Looks like most of the time is spent in the user's component (com.spcomstock.xstream.bi[panel40,0,36,937x18,invalid]). The user seems to have overridden the addNotify method and that is where it is waiting. This could be some kind of Threading issue related to improper or excessive locking. I also noticed that if, after you click on the column header, you move the window, then it seems to get the add done right away. I feel this is somekind of threading/locking issue that is exacerbated by excessive or improper locking sequence in the user code. Can we get the source to com.spcomstock.xstream.bi ?? ###@###.### 2002-07-16 ------------------------------------------------ ###@###.### 2002-07-17 Get some response from the customer: We didn't overwrite addNotify method. For the thread issue, just wondering why it do not have problem in other vm, are there any changes in the thread mechanism? Attached is the source code - QuoteRow.java This problem cannot be fixed without a smaller testcase. As it is we cannot determine the cause of the performance issue. I agree that this may be a regression, but it is not possible to debug it without a more managable test case. First of all the code is obfuscated , second we dont have all the code. We need a small testcase with the source that reproduces the problem. ###@###.### 2002-10-21 This is indeed the same problem as 4745222. ###@###.### 2003-09-03
21-10-2002