JDK-8023910 : on refresh of browser window, multiple Java console windows open and pausing occ
  • Type: Bug
  • Component: deploy
  • Sub-Component: plugin
  • Affected Version: 7u25
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_7
  • Submitted: 2013-08-19
  • Updated: 2014-10-27
  • Resolved: 2014-10-27
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9Fixed
Related Reports
Relates :  
Relates :  
Description
FULL PRODUCT VERSION :
from JRE:

Java Plug-in 10.25.2.17
Using JRE version 1.7.0_25-b17 Java HotSpot(TM) 64-Bit Server VM

ADDITIONAL OS VERSION INFORMATION :
Windows 7

A DESCRIPTION OF THE PROBLEM :
When loading and refreshing a page with a number of applets, multiple Java console windows open.  After some time of refreshing the pages, pausing starts to happen.

I have a simple example with 10 applets that demonstrates the issue. I will provide it here.

REGRESSION.  Last worked in version 6u45

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Create an HTML page with an 10 or more applets.  Open the page in a browser and refresh the page often.  Make sure the Java console window is open.  After refreshing many times, you start to see multiple console windows opening, as well as pausing while refreshing.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
I expect to see one console window open, displaying the teardown and buildup of the applets.
ACTUAL -
I see multiple console windows opening, and each window continuing to report results.

ERROR MESSAGES/STACK TRACES THAT OCCUR :
I see these error messages in the console, though I have no idea if they are really related or not.

ui: missing resource: java.util.MissingResourceException: Can't find resource for bundle com.sun.deploy.resources.Deployment, key PERF: AppletExecutionRunnable - applet.init() BEGIN ; jvmLaunch dt 483744 us, pluginInit dt 9271380 us, TotalTime: 9755124 us

basic: WARNING - specified JRE version, null is invalid platform version



REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
Applet class
-------------------

package applet;

import javax.swing.JApplet;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;

public class TestApplet extends JApplet {

JTextArea area = null;

@Override
public void destroy() {
// TODO Auto-generated method stub
super.destroy();
}

@Override
public void init() {
// TODO Auto-generated method stub
super.init();
}

@Override
public void start() {
// TODO Auto-generated method stub
super.start();
setSize(640, 480);
if (area == null)
area = new JTextArea();

for (int i = 0, n = 100; i < n; i++) {
area.setText(area.getText() +  "  The brown cow the brown cow the brown cow. 
 " );
}
this.getContentPane().add(new JScrollPane(area));
}

@Override
public void stop() {
// TODO Auto-generated method stub
super.stop();
}

public String getText() {
 return area.getText();
}

public void setText(String text) {
area.setText(text);
}
}

HTML Page
------------------
<HTML>
    <HEAD>
        <TITLE>Job Tracking</TITLE>
 <script>
var AppletCount = 15;
 
 
function ReduceCounter(){
if (AppletCount == 15)
{
document.getElementById( " appCountId " ).value = AppletCount;
}
AppletCount = AppletCount -1;
document.getElementById( " appCountId " ).value = document.getElementById( " appCountId " ).value +  " , " +AppletCount;
 
if (AppletCount == 0) {
AppStat();
displayMenu();
}
}
function AppStat(){
document.getElementById( " txtId " ).innerHTML =
 " <b>1) document.CommandJobOn=</b> " +document.CommandJobOn + " <br> " +
 " <b>2) document.CommandJobOff=</b> " +document.CommandJobOff + " <br> " +
 " <b>3) document.CommandConfSave=</b> " +document.CommandConfSave + " <br> " +
 " <b>4) document.CommandDMAS=</b> " +document.CommandDMAS + " <br> " +
 " <b>5) document.CommandCarelink=</b> " +document.CommandCarelink + " <br> " +
 " <b>6) document.GetPOD=</b> " +document.GetPOD + " <br> " +
 " <b>7) document.SignatureVerification=</b> " +document.SignatureVerification + " <br> " +
 " <b>8) document.GetNextActionApplet=</b> " +document.GetNextActionApplet + " <br> " +
 " <b>9) document.GetFilePath=</b> " +document.GetFilePath + " <br> " +
 " <b>10) document.Comment=</b> " +document.Comment + " <br> " +
 " <b>11) document.TxnTextType=</b> " +document.TxnTextType + " <br> " +
 " <b>12) document.TrainerVerification=</b> " +document.TrainerVerification + " <br> " +
 " <b>13)document.StartTimerTime=</b> " +document.StartTimerTime + " <br> " +
 " <b>14)document.CheckDataCount=</b> " +document.CheckDataCount + " <br> " +
 " <b>15)document.ProdOrderList=</b> " +document.ProdOrderList;
}
function setDropDownList(){
ReduceCounter();
}
 
function windowRefresh() {
window.location.reload();
}
 
function runAutomatedTest() {

var runAutoTest = true;
for (var i =0, n = 1; i < n; i++) {
AppStat();
windowRefresh();
}
 
}
</script>
    </HEAD>
<script src= " ../scripts/topMenu.js "  type= " text/javascript " ></script>
 
<BODY class= " normal "  topmargin= " 0 "  ><!--setMessage('{Message}','{Conf}','{Suitability}','{Conftext}') "  onkeydown = " logoutPage() "  onClick = " logoutPage() "  onDoubleClick = " logoutPage() " >-->
 <div id= " topMenu " ></div>
 
<!--iCommand for Triggering on clicking  " Job On " -->
<APPLET NAME= " CommandJobOn "  WIDTH= " 1 "  HEIGHT= " 1 "  CODE= " applet.TestApplet "  CODEBASE= " /XMII/Classes "  ARCHIVE= " appletTest.zip "  MAYSCRIPT>
 </APPLET>
<!--iCommand for Triggering on clicking  " Job Off " -->
<APPLET NAME= " CommandJobOff "  WIDTH= " 1 "  HEIGHT= " 1 "  CODE= " applet.TestApplet "  CODEBASE= " /XMII/Classes "  ARCHIVE= " appletTest.zip "  MAYSCRIPT >
 </APPLET>
<!--iCommand for Triggering on clicking  " Job Off " -->
<APPLET NAME= " CommandConfSave "  WIDTH= " 1 "  HEIGHT= " 1 "  CODE= " applet.TestApplet "  CODEBASE= " /XMII/Classes "  ARCHIVE= " appletTest.zip "  MAYSCRIPT >
 </APPLET>
<!--Applet fo firing DMAS Verification command as iCommand-->
<APPLET NAME= " CommandDMAS "  CODEBASE= " /XMII/Classes "  CODE= " applet.TestApplet "  ARCHIVE= " appletTest.zip "  WIDTH= " 0 "  HEIGHT= " 0 "  MAYSCRIPT >
</APPLET>
<!--Applet for firing Carelink Verification command Type as iCommand-->
<APPLET NAME= " CommandCarelink "  CODEBASE= " /XMII/Classes "  CODE= " applet.TestApplet "  ARCHIVE= " appletTest.zip "  WIDTH= " 0 "  HEIGHT= " 0 "  MAYSCRIPT >
</APPLET>
 
<!--Applet to receive Reason for Variance as iCommand-->
<APPLET NAME= " GetPOD "  CODEBASE= " /XMII/Classes "  CODE= " applet.TestApplet "  ARCHIVE= " appletTest.zip "  WIDTH= " 0 "  HEIGHT= " 0 "  MAYSCRIPT >
</APPLET>
<!-- Applet for signature verification - CRD 8316 -->
<APPLET NAME= " SignatureVerification "  WIDTH= " 1 "  HEIGHT= " 1 "  CODE= " applet.TestApplet "  CODEBASE= " /XMII/Classes "  ARCHIVE= " appletTest.zip "  MAYSCRIPT >
 </APPLET>
<!-- Applet to search next Custom Action List - CRD 8316 -->
<APPLET NAME= " GetNextActionApplet "  WIDTH= " 1 "  HEIGHT= " 1 "  CODE= " applet.TestApplet "  CODEBASE= " /XMII/Classes "  ARCHIVE= " appletTest.zip "  MAYSCRIPT >
 </APPLET>
<!--iCommand to get File Path to write and prod order-->
<APPLET NAME= " GetFilePath "  WIDTH= " 1 "  HEIGHT= " 1 "  CODE= " applet.TestApplet "  CODEBASE= " /XMII/Classes "  ARCHIVE= " appletTest.zip "  MAYSCRIPT >
</APPLET>
<!--Applet for Confirmation Text Field-->
 <APPLET NAME= " Comment "  CODEBASE= " /XMII/Classes "  CODE= " applet.TestApplet "  ARCHIVE= " appletTest.zip "  WIDTH= " 0 "  HEIGHT= " 0 "  MAYSCRIPT TABINDEX= " -1 "  >
 </APPLET>
 
<!--Applet for getting Transaction Type as iCommand-->
<APPLET NAME= " TxnTextType "  CODEBASE= " /XMII/Classes "  CODE= " applet.TestApplet "  ARCHIVE= " appletTest.zip "  WIDTH= " 0 "  HEIGHT= " 0 "  MAYSCRIPT TABINDEX= " -1 "  >
</APPLET>
<!-- Applet for trainer verification -->
<APPLET NAME= " TrainerVerification "  WIDTH= " 1 "  HEIGHT= " 1 "  CODE= " applet.TestApplet "  CODEBASE= " /XMII/Classes "  ARCHIVE= " appletTest.zip "  MAYSCRIPT>
 </APPLET>
<!-- Applet for Start Timer Time Stamp -->
<APPLET NAME= " StartTimerTime "  WIDTH= " 1 "  HEIGHT= " 1 "  CODE= " applet.TestApplet "  CODEBASE= " /XMII/Classes "  ARCHIVE= " appletTest.zip "  MAYSCRIPT >
 </APPLET>
 
<!--begin add :singhp11 CRD11932-->
<!--Applet for Action Check Data Count as iCommand-->
<APPLET NAME= " CheckDataCount "  CODEBASE= " /XMII/Classes "  CODE= " applet.TestApplet "  ARCHIVE= " appletTest.zip "  WIDTH= " 1 "  HEIGHT= " 1 "  MAYSCRIPT>
</APPLET>
 
<!--Applet for Action Check Data Count as iCommand-->
<APPLET NAME= " ProdOrderList "  CODEBASE= " /XMII/Classes "  CODE= " applet.TestApplet "  ARCHIVE= " appletTest.zip "  WIDTH= " 1 "  HEIGHT= " 1 "  MAYSCRIPT>
</APPLET>
 
<!--end add :singhp11 CRD11932-->
 
<!-- Applet to get opertion List for supervisor - CRD 8316 -->
 
<input type =  " text "  value =  "  "  id =  " appCountId "  style= " width:400 " />
<input type =  " button "  value =  " check applet status "  onClick =  " AppStat() "   />
<input type =  " button "  value =  " start refresh cycle "  onClick =  " runAutomatedTest() "   />
<div  id= " txtId " > </div>
</BODY>
</HTML>



---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
no workaround found.
Comments
Looks like this issue has been fixed with JDK-8023095. Can't reproduce it with 8u40_b11
27-10-2014

Relaunch logic is improved under JDK-8023095. Now separate_jvm parameter is not added to relaunched app, so they could share the same VM.
21-10-2014

Not a critical issue. There is a workaround. Taking out of 8-pool. Can be fixed in 9. If needed escalate this issue.
16-10-2014

<Cut from the e-mail conversation> #1 The thread count limit feels to me like an artificial limit to determine when to spawn a new client VM to run applets in. I've no idea why it was reduced, maybe someone complained about too many applets being loaded in the VM causing it to bog down. #2 is a bug in our plugin server code, sounds like it's stuck only checking the first VM. #3 seems like a bug too. We shouldn't bog down with only 4-5 client VMs running. I wonder if we're using separate threads or even ports to communicate with the client VMs, if it's all going through the same resources then that's likely why. This would absolutely need to be fixed if/when we start launching each applet in it's own VM/process. -DrD- > Here is the customer report. 17497893 (Its in closed state as customers are not responding , but I still feel there is some issue) > > 1. We don't know why the thread count is limited to 50. > 2. When the thread count reaches to 50 , we start a new jvm which is right but why the subsequent applets are not using the same jvm. Why are we creating multiple jvms? > If you look at the thread count in each console or jvm with the testcase you will see the count is way less than 50. So why not just the 2 jvms instead 4/5 jvms we see. > 3. Once 4/5 jvms are started we see pausing or hanging which can be annoying. Can we improve that?
16-10-2014

Confirmed locally.
10-10-2014

I just carried out the testcase on 8u40_b09 and this bug is still reproducible. You have to refresh the applets for quiet some time to see the multiple jvms and hanging. Otherwise you can also reproduce it by reducing the maxAppletThreadCount around 20/30. The workaround for this is to increase the thread count in deployment.properties file. But we still need to fix the underlying cause.
08-10-2014

Tested with 8u40_b04. Can't reproduce.
30-09-2014

not a new/urgent issue - investigate for 8/7u
31-08-2013