Results 1 to 2 of 2
  1. #1
    JSuser is offline Member
    Join Date
    Jun 2012
    Rep Power

    Default IE8-9: Executing Java Script repeatedly causes Java Applet or JVM to crash

    This is a case of memory leak in IE when running JavaScript repeatedly.

    I am running some JavaScript repeatedly (per our development requirement) on an applet which causes the applet or JVM to exit. I have an example page and my JavaScript code that can reproduce this issue.

    Here are steps to follow to produce this issue:

    1. Launch Internet Explorer (8/9).
    2. Go to [] webpage
    3. Open Developer Tools window (using F12 or Settings->F12 Developer Tools)
    4. On the Developer Tools window select the "Console" tab
    5. Type and run following Java Script in the console tab

    // Java Script function to process the Applet component.
    // This function recursively walks through the Chidren
    // of a component and counts the number of components
    // thre are in this applet.

    var JavaAppletTest = {};
    (function() {

    JavaAppletTest.ProcessComponent = function(component)
    var childCount = 0;
    if ('getComponentCount' in component)
    var childIndex = 0;
    for (childIndex = 0; childIndex < component.getComponentCount(); ++childIndex)
    if ('getComponent' in component)
    var childComp = component.getComponent(childIndex);
    var childrenCount = this.ProcessComponent(childComp);
    childCount = childCount + childrenCount;
    return childCount;

    JavaAppletTest.ProcessJavaApplet = function (applet) {
    return this.ProcessComponent(applet);


    // Java Script function to process an applet multiple times using iteration.
    function RunJavaScript() {
    // Process Applet 5000 times.
    var i = 0;
    for (i = 0; i < 5000; i++)
    // In the statement below "document.applet[2] refers to third applet on the page."
    console.log("Interval: " + i + " " + "Result: " + JavaAppletTest.ProcessJavaApplet(document.applets[2]));

    6. The above statement should define the JavaAppletTest global variable and also the RunJavaScript function
    7. Now on the console tab call the RunJavaScript function

    This should run the defined Java script function "RunJavaScript." This function supplies the third applet to the ProcessJavaApplet function of the JavaAppletTest global variable. The ProcessJavaApplet function recursively goes through the children of the applet and counts how many are there in the applet.

    The above test is just small example of a small part of our development task which has issues as Java applet or JVM crashes.

    Let me know how i can resolve this issue.

    Thank you.

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Madgaon, Goa, India
    Rep Power

    Default Re: IE8-9: Executing Java Script repeatedly causes Java Applet or JVM to crash

    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Java Crash Linux
    By Plysken in forum Advanced Java
    Replies: 11
    Last Post: 03-16-2012, 09:33 AM
  2. does applet size causes a browser to crash.
    By sagngh8 in forum Java Applets
    Replies: 1
    Last Post: 05-31-2011, 03:13 PM
  3. Crash in Java generate Process_Shut_Down_java.exe
    By Kiril in forum Advanced Java
    Replies: 1
    Last Post: 03-25-2011, 10:31 PM
  4. Java Applet Shell script
    By karthikm897 in forum Java Applets
    Replies: 5
    Last Post: 08-18-2009, 04:42 AM
  5. Replies: 3
    Last Post: 07-23-2008, 08:07 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts