4 Replies Latest reply: Aug 18, 2010 3:53 AM by 807580 RSS

    Java applets issue on JVM life time

    807580
      hi All,

      We are having an application which is big rich ui application, built using awt and Swing components.

      We are loading that applet in to the web browser. Then browser creates a JVM, loads the necessary jar files and makes the JVM live till we are in the same page.

      If I move to other pages on the same application, the JVM created by the browser is closing in approximately one minute. If I come back to the applet page before on minute, it is taking very less time to load the applet.

      If I come back to the page after the JVM closed which is created by the browser, it will take the long time as good as first time loading.

      My requirement is Can we increase the time of JVM closing by browser from 1 minute to 20 to30 minutes. Is there any jvm_args for this.

      Java we are using to load the applet is Java 1.6.0 update16.
      we are using memory setting like -Xmx512m -Dweblogic.MaxMessageSize=2000000000 as runtime setting in control panel. So same is there any setting for the JVM to live for specified amount of time, as it is taking lot of time to load if it closes.

      Any help on this appreciated

      Regards,
      bala
        • 1. Re: Java applets issue on JVM life time
          807580
          Have you considered just loading the applet in a window that stays open for the lifetime of the project?

          Or use Java Web Start and not embed the application in a browser window at all?
          • 2. Re: Java applets issue on JVM life time
            807580
            Thanks for the reply,


            No I cannot use java web start as per my requirement. It is a big application and used by so many clients. Just for this we can not use just java webstart instead of browser.


            I need a setting by which I can make JVM loaded by the browser to stay for more time, even though after leaving the page. I am not closing the browser, just I am leaving to other modules on the same page, not event another browser tab(It is in same tab of browser.

            For your question, I am more interested to load applet in browser (IE).


            Thanks
            Bala
            • 3. Re: Java applets issue on JVM life time
              793415
              BalaKrishnaKonduri wrote:
              ..No I cannot use java web start as per my requirement. ..
              According to the following requirements, JWS *(<- link)* is the best option.
              .. It is a big application..
              JWS excels at this.
              - It provides progress bars automatically when downloading.
              - It updates Jars automatically when needed.

              Splitting the app. into a number of Jars has great benefit as well:
              - Automatic updates only of Jars that have changed (and you can specify whether at start-up or in the background).
              - Jars containing functionality that is rarely used can be deployed as 'lazy' & only the users who need them, get them.

              All of this happens automatically, and is effectively invisible to the end user.
              ..and used by so many clients. ..
              Applets can deploy from a private network or the internet. So obviously they can be used by many clients. OTOH JWS launched apps. are also launched from a private network or the internet.

              Since JWS can cut down on the network traffic between the server and the end users, it has the capacity to deliver the application to more users than an embedded applet.

              Since JWS works in more end clients than an embedded applet (fewer applet/browser/JRE interaction bugs), the JWS based app. can provide the functionality to more users with less maintenance than the applet.
              ..Just for this we can not use just java webstart instead of browser.
              It seems the stated requirements suggest the opposite. You cannot afford to use an applet embedded in a browser.  Instead launch the app. using JWS.
              For your question, I am more interested to load applet in browser (IE).
              The real question should be about "How to deliver the app. easiest to most people?" - which is a very different goal to what you are doing.

              Edited by: AndrewThompson64 on Aug 7, 2010 6:06 PM
              • 4. Re: Java applets issue on JVM life time
                807580
                Thanks for the reply,

                I am more of looking into the setting where we can mention, so that JVM can still alive which is started by the browser, even though I have go to other pages from the applet page.


                Our application is having different modules in it, some of the modules are done by Simple JSP pages(just like struts application), and some modules are applet based and we move to and fro from JSP pages to applet pages and applet to JSP. When we are moving from applet to JSP, the JVM is killing by browser, after some seconds.


                Can we set the time till ,browser will not kill the JVM which is loaded by the browser when loading the applet.?


                I need more of a setting:---- like for memory, In Java run time parameters, we can put -Xmx512m -Dweblogic.MaxMessageSize=2000000000+, so like this for JVM life time is There any setting?

                Please let me know

                Edited by: BalaKrishnaKonduri on Aug 18, 2010 8:52 AM