Memory leak on applets

I have a problem with a applet. My applet produces a memory leak with the plugging 1.5.0_08 and i can't fix it. With 1.5.0_07 plugging or older i don't have this problem. But the problem is not only in my applet, i did make a little applet to test the memory and the problem stayed.
The example is in this URL :
http://148.245.60.225/matematicas/bugs/JRE_memory_leak.html
I don't know what i did do wrong. Can help me somebody?

Yes - there is at least one serious memory leak in 08:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6462383
Update 08 has been pulled and is not available on the Java pages anymore except for developers. I assume this was a real lemon.
I had an issue with it because it changed the meaning of the EST time zone...

Similar Messages

  • Memory Leak in Applet

    Hello Good people,
    I am facing a troubling memory problem in my applet.
    Apparently, it suffers from some major memory leaks and every time I reload my applet the memory is consumed with additional 5Mb. I am looking for ways to work around this (or better yet to completely solve it) - I've noticed that the JVM is still alive when the applet is disposed and destroyed, it is not being killed until I close the parent IE windows. Because of this, the heap of the JVM is never totally cleaned and after several applet invocations I get to the heap's limit and everything is stuck.
    I am looking for ways to control the JVM - is there a way to manually reset its memory or even kill it through javascript after the applet is disposed?
    Thanks a lot!
    Tal

    Hi Andrew,
    I appreciate your help but I remember that in the research I did when I just started the project I have found that the web start technology is not suitable to me because it always open a new window and I need my applet to be embeded in an exisitng window.
    Do you know differently?
    Thanks,
    Tal

  • Memory Leak on Applet Refresh in IE

    Hi All,
    This is really strange, if you have launched an java applet in IE and hit refresh, the the memory consumed by IE increses.Ideally speaking the consumed memory in task manager by IE with applet should show same if you hit refresh.But it grows.There is a memory leak.
    There was a bug [http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4894522] filed and claims to be fixed in 1.4..well i dont see it fixed in 1.6 either.
    Any thoughts..??
    Ex: First launch 45MB is being by applet ..hit refresh it goes to 80MB...and this goes untill a point and the incrementation of memory consumed becomes smaller and control becomes very slow.
    Thanks,
    Ranjitha

    More likely a bug in your applet. Not that there's not bugs, but more often than not, the fault is yours, not Java's.
    That's a whole lot of memory usage. That suggests that you are loading up a bunch of stuff, then holding onto it in the applet reference, maybe some static fields, then creating a whole new set of objects the second time.
    Static fields are not discarded, nor are classes unloaded (or technically because classes are not unloaded), when the browser is refreshed. So if you don't dispose of things, they may linger.
    Of course, resetting a static field should make the old objects go out of scope and eligible for GC.
    So maybe some explanation of what you're doing in your applet would go a long way towards figuring it out.

  • Memory leak with 1.6.0_07 in applet using Swing

    Java Plug-in 1.6.0_07
    Using JRE version 1.6.0_07 Java HotSpot(TM) Client VM
    Windows XP - SP2
    I have a commercial application that has developed a memory leak with the introduction of the latest plugin. The applets chew up memory and eventually freeze. They did not before. Using jvisualm I see a build up of native arrays, primarily int[][] and char[]. I'm still investigating. Anyone have a similar experience?
    The Applet uses a swing interface, uses buffered images and swing timers, and regularly performs http connections to the server which result in actions via the SwingUtil.invokeLater() method.

    I am Using Internet Explorer Browser Version 6.0.Huge security hole.
    Its not throwing Error / Exception Wrap a try/catch at the highest level possible.
    Catch 'Throwable'. And log/display it somewhere.

  • Applet memory leak in IE 6.0?

    Hi :
    I am using the following tag to declare an applet, but when I load the page in IE each time I refresh the page, IE memory goes up by ~10MB!! And finally after 5-6 refreshes Microsoft's cunning browser crashes :-)). Any clues?
    -Sanjay.
    <OBJECT classid="com.hexidec.ekit.EkitApplet.class" NAME="Ekit" WIDTH="600" HEIGHT="400"></XMP>
         <PARAM NAME="code" VALUE="com.hexidec.ekit.EkitApplet.class">
         <PARAM NAME="type" VALUE="application/x-java-applet;version=1.3">
         <PARAM NAME="scriptable" VALUE="true">
         <PARAM NAME="DOCUMENT" VALUE="Welcome to the rich text document editor.">
         <PARAM NAME="STYLESHEET" VALUE="ekit.css">
         <PARAM NAME="LANGCODE" VALUE="en">
         <PARAM NAME="LANGCOUNTRY" VALUE="US">
         <PARAM NAME="TOOLBAR" VALUE="true">
         <PARAM NAME="SOURCEVIEW" VALUE="false">
         <PARAM NAME="EXCLUSIVE" VALUE="true">
         <PARAM NAME="MENUICONS" VALUE="true">
         <PARAM NAME="archive" VALUE="eKit.jar">
         <PARAM NAME="cache_option" VALUE="Plugin">
         <PARAM NAME="cache_archive" VALUE="eKit.jar"></OBJECT>

    Hello Sanjaya,
    I am facing a very similar problem and my project is in danger - I was wondering if you have found a way to deal with that memory leak?
    Please let me know.
    Thanks.
    Tal

  • Memory Leak in Sun's Demo Applets

    After banging my head over some memory leak errors in an applet I wrote, I decided to try out one of Sun's applets to see if it too leaks memory. I loaded \j2sdk1.4.2_03\demo\applets\Animator\example1.html in IE6 (WinXP, JRE 1.4.2_03) and just left it running with the focus. At 11:45am the task manager showed IE to be using 13,100KB and over the past hour and a half that amount steadily increased to 16,424KB and keeps rising (now it's 16,452KB.) The problem I've run into in my applet (which does a lot of painting like this demo applet) is that it eventually just consumes more and more memory until it locks up.
    So I was wondering what advice people have. I've used JProfiler and I can't find any leaks in my code. I'm debating on making my applet a java application, but I'm just not sure if it will suffer from the same memory leaks. Thanks for any help.

    Well off hand with out seeing any code, check that you are not instantiating any object repeatedly...
    (creating new objects over and over and never getting rid of the old ones by still keeping referenced to it)
    something like this...
    public class MemoryEater
       MemoryEater()
          MemoryEater eater = new MemoryEater();
    public void doSomeThing()
       MemoryEater eater = new MemoryEater();
       eater.doSomeThing();
    }now this is a exaggerated example, but it might help you locate your memory leak...
    and memory usage varies depending on application and OS states... 1mb is not much of a rise, but then again overtime it makes a difference... Try other applets and see if you get the same results... I am currently running the same applet, and for a short bit the usage steadily climbed maybe about 2mb overall but then started to level off...
    Running the same applet, I got the initial memory usage increase,
    then a slow steady climb for about another meg and now it fluctuates between 36.5 and 37.5 mb...
    Note: I also have other Internet Explorer windows open, so naturally my overall memory usage is going to be higher...
    If it is still a problem, you can try re-installing the JVM...
    I hope this was helpful...
    - MaxxDmg...
    - ' He who never sleeps... '

  • Memory Leak Java Plugin with Swing Applet

    Hi
    I experience the following problem and desperately need help on this. The Java Plugin (I use Version 1.3.1_02) seems to have a problem in printing Swing Applets.
    The problem can easily be reproduced (at least with NT):
    1) Start Internet Explorer or Netscape (I used 5.5/4.07)
    2) Launch the following demo swing applet
    http://java.sun.com/products/plugin/1.3.1_01a/demos/jfc/SwingSet2/SwingSet2Plugin.html
    3) Print the applet and observe (using task manager) the memory used by the browser process (the memory used by the process will increase every time you hit the print button but never decrease unless you shut down the browser)
    4) Print a couple of times (you may want to pause your print queue) and you will be able to crash your computer
    This seems to be the same bug reported with 4638742. However it says "in progress" for quite some time and I was wondering if some genious might know a work around for this.
    Cheers

    You might want to read an article about memory leaks in Java:
    http://www-106.ibm.com/developerworks/library/j-leaks/

  • Applet calling javascript function causing memory leak

    Hi,
    I'm troubleshooting one memory leak issue in my application and to do that I created one simple Java applet and HTML + javascript function to locate the problem.
    Basically it's an applet calling a javascript function using a timer. The javascript function simply does nothing.
    I tested in IE 8.0 and JRE 1.6.0_23-b05 and memory of IE keeps increasing.
    I saw this bug http://bugs.sun.com/view_bug.do?bug_id=6857340 which seems related with my issue, but if I understand correctly from the page, the issue should have been fixed.
    I posted this message to find out if others also find same issue and if there's a solution for this. If I comment out window.call("dummy", null); , memory will not climb up.
    Java code
    +public class Main extends Applet implements Runnable  {+
    public Applet currentApplet= this ;
    +     public JSObject window = null;+
    +public void run(){+
    +          System.out.println("run..");+
    +     }+
    +public void start(){+
    window = JSObject.getWindow(this);
    int delay = 300; //milliseconds
    +ActionListener taskPerformer = new ActionListener() {+
    +public void actionPerformed(ActionEvent evt) {+
    window.call("dummy", null);
    +}+
    +};+
    new Timer(delay, taskPerformer).start();
    +     }+
    +public static void main(String[] args) {+
    +          System.out.println("start...");+
    +          Main main = new Main();+
    +     main.start();+
    +     }+
    +}+
    Javascript source code
    +<html>+
    +<head>+
    +<script>+
    +function dummy() {+
    +     +
    +}+
    +</script>+
    +</head>+
    +<body>+
    +<applet .... >+
    +...+
    +</html>+

    Try this url:
    http://www.inquiry.com/techtips/java_pro/10MinuteSolutions/callingJavaScript.asp
    It also provides some examples.

  • Applet load and memory leak

    what are some methods to load an applet faster that is on the local machine? also, are there any applications to test for memory leaks? and are there ways to invoke garbage collection with code? thanx in advance.

    Applet on the local machine will load faster because file is already there
    use System.gc() to do a garbage collection

  • Memory leak in Promise S/W?

    We have 2 systems running with a KT4U MB. Both systems use 2 SATA disks in mirror (RAID-0), W2K Pro. Approx. once a week both systems lockup en have te be rebooted. After rebooting the eventlog shows event 2019 (possible memory leak). I've found out that the msgagt.exe service (Promise Message Agent) is the most probable cause of this. I this service is stopped, then the pool nonpaged memory is stable, when the service is running, the pool keeps increasing. The version of msgagt.exe is 3.2.0.2. There should be a newer version on the MSI site, bit this one only contains the Promise driver'.
    Anyone has any suggestions?

    Well off hand with out seeing any code, check that you are not instantiating any object repeatedly...
    (creating new objects over and over and never getting rid of the old ones by still keeping referenced to it)
    something like this...
    public class MemoryEater
       MemoryEater()
          MemoryEater eater = new MemoryEater();
    public void doSomeThing()
       MemoryEater eater = new MemoryEater();
       eater.doSomeThing();
    }now this is a exaggerated example, but it might help you locate your memory leak...
    and memory usage varies depending on application and OS states... 1mb is not much of a rise, but then again overtime it makes a difference... Try other applets and see if you get the same results... I am currently running the same applet, and for a short bit the usage steadily climbed maybe about 2mb overall but then started to level off...
    Running the same applet, I got the initial memory usage increase,
    then a slow steady climb for about another meg and now it fluctuates between 36.5 and 37.5 mb...
    Note: I also have other Internet Explorer windows open, so naturally my overall memory usage is going to be higher...
    If it is still a problem, you can try re-installing the JVM...
    I hope this was helpful...
    - MaxxDmg...
    - ' He who never sleeps... '

  • Memory leak when redirecting to a remote XFree86 server

    Hi,
    I'm running a Java application, which controlls our network equipment.
    The application is written by our development team. It installs a graphical
    user frontend in order to allow interoperation with the network administrators.
    The application is run using the following environments:
    * Windows NT 4.0
    * Sun Solaris 8, local Xsun X11 server
    * Sun Solaris 8, XFree86 X11 server located on a linux host
    * Sun Solaris 8, CygWin/XFree86 X11 server running on a Windows NT host
    It turns out, that the application runs fine, if the application and the GUI either
    run both on a Windows NT host or the Sun workstation. However, if the application
    is launched on a Sun workstation and the X display is redirected to any XFree86
    X11 server, each change of the GUI focus - either forced by a mouse-click, or
    an canvas being changed by the application itsself - consumes an amount of
    3 MB of memory and never releases this again.
    So I suppose any memory leak in the Swing/X11 interface ...
    I've already searched SunSolve and installed all patches addressing memory leaks
    in Solaris 8 and Xsun ...
    Also our development team already has profiled the application using tools
    like OptimizeIt without being able to locate any memory leak.
    Has anyboday seen this before? Is there any bugfix/workaround available?
    Thx in advance,
    Jens Hamisch

    We just noticed the same problem for our Swing Applet using JDK 1.4 on Solaris 8 displayed to any remote X server running on Windows 2000 or Linux. If we let the applet run long enough (the plot in the applet updated every second), we could easily use up 500-600 Mb. Again, on the local console on Solaris or Windows 2000 the memory was stable at around 70 Mb.

  • 5.0.2 still MEMORY LEAKS with Java on multiple tabs/windows

    same problem with last update.
    Memory Leaks (upto 2.5 GB) when Java applets load
    in multiple windows/tab.
    Someone also have this problem?
    My other post prior of last update:
    http://discussions.apple.com/message.jspa?messageID=12204453#12204453
    Message was edited by: fascox

    If you want to report this issue to Apple's engineering, send a bug report or an enhancement request via its Bug Reporter system. To do this, join the Mac Developer Program—it's free and available for all Mac users and gets you a look at some development software. Since you already have an Apple username/ID, use that. Once a member, go to Apple BugReporter and file your bug report or enhancement request. The nice thing with this procedure is that you get a response and a follow-up number; thus, starting a dialog with engineering.

  • Memory Leak? (Update)

    Thanks for all the responses for this problem. Here is what I've come
    up with so far. I believe I have found the culprit.
    1) First, I used the LabVIEW VI profiler with memory tracking enabled.
    This didn't show what VI was hogging the memory, so it didn't help. It
    reported only 10M of memory was being used, when Windows NT reported
    110M in use by LabVIEW.
    2) VI references had been mentioned as the possible culprit if the
    references had not been closed. I then opened a VI reference at the
    beginning of the program, used these references throughout the loop, and
    then closed them at the end of the loop. Result: still had a memory
    leak.
    3) After some troubleshooting, I started deleting some sub-VIs out of
    my program to see when
    the memory was freed. I thought I could isolate
    which VI was hogging the memory. This seemed to have worked, because
    I've done it twice, deleting different VIs up to a point, and when I
    delete one of them out of the diagram, the memory is freed. This is
    what I'll explain below.
    Every iteration of the loop, the front panel is converted to a .png file
    and saved to the drive for output across the network to any browser
    which has connected. Using the LabVIEW/vi.lib/utility/printvi.llb/Get
    Panel Image.VI, the front panel can be changed into a .png format. The
    next step is where the problem lies. A Java applet is looking for a png
    file to download to a browser when a request is made. Therefore, the
    panel image which has just been made needs to be saved to a file. The
    Graphics & Sound -> Graphics Formats -> Write PNG file.VI is used for
    this. This is the VI which is causing the problem. Upon looking at the
    VI, it just calls a CIN. Therefore, I'm not sure how to find out why it
    is
    hogging the memory. If I delete this VI, and I don't save the front
    panel to a png file (but I do convert it to png format), I don't have
    the memory leak.
    Any ideas?
    Mark
    Sent via Deja.com http://www.deja.com/
    Before you buy.

    I wish I could update to LV 6i, but I can't now. I'm stuck with 5.1.1
    for now. I don't know how I could "legally" get the .dll and png write
    VI from 6.
    Mark
    In article <[email protected]>,
    "news.t-online.de" wrote:
    > Hi Mark,
    >
    > you are right. It looks like lvpng.dll is causing the problem.
    >
    > Are you able to switch to LabVIEW6? The lvpng.dll has been changed
    > and I didn't see the memory leak here. You can also try to use only
    the
    > Write PNG File.VI and/or lvpng.dll shipped with labview 6 instead of
    > porting the complete application to labview 6.
    >
    > Martin
    >
    > --
    > Martin Henz Systemtechnik
    > Dipl. Ing. (FH) Martin Henz
    > Walchensee Str. 3
    > 70378 Stuttgart
    > Tel. ++49-711-5302605
    > Fax ++49-711-5058649
    > http://www.mhst.de
    > schrieb im Newsbeitrag
    news:[email protected]...
    > > Thanks for all the responses for this problem. Here is what I've
    come
    > > up with so far. I believe I have found the culprit.
    > >
    > > 1) First, I used the LabVIEW VI profiler with memory tracking
    enabled.
    > > This didn't show what VI was hogging the memory, so it didn't help.
    It
    > > reported only 10M of memory was being used, when Windows NT reported
    > > 110M in use by LabVIEW.
    > >
    > > 2) VI references had been mentioned as the possible culprit if the
    > > references had not been closed. I then opened a VI reference at the
    > > beginning of the program, used these references throughout the loop,
    and
    > > then closed them at the end of the loop. Result: still had a memory
    > > leak.
    > >
    > > 3) After some troubleshooting, I started deleting some sub-VIs out
    of
    > > my program to see when the memory was freed. I thought I could
    isolate
    > > which VI was hogging the memory. This seemed to have worked,
    because
    > > I've done it twice, deleting different VIs up to a point, and when I
    > > delete one of them out of the diagram, the memory is freed. This is
    > > what I'll explain below.
    > >
    > > Every iteration of the loop, the front panel is converted to a .png
    file
    > > and saved to the drive for output across the network to any browser
    > > which has connected. Using the
    LabVIEW/vi.lib/utility/printvi.llb/Get
    > > Panel Image.VI, the front panel can be changed into a .png format.
    The
    > > next step is where the problem lies. A Java applet is looking for a
    png
    > > file to download to a browser when a request is made. Therefore,
    the
    > > panel image which has just been made needs to be saved to a file.
    The
    > > Graphics & Sound -> Graphics Formats -> Write PNG file.VI is used
    for
    > > this. This is the VI which is causing the problem. Upon looking at
    the
    > > VI, it just calls a CIN. Therefore, I'm not sure how to find out
    why it
    > > is hogging the memory. If I delete this VI, and I don't save the
    front
    > > panel to a png file (but I do convert it to png format), I don't
    have
    > > the memory leak.
    > >
    > > Any ideas?
    > >
    > > Mark
    > >
    > >
    > > Sent via Deja.com http://www.deja.com/
    > > Before you buy.
    >
    >
    Sent via Deja.com http://www.deja.com/
    Before you buy.

  • Memory leak 2

    i have a super simple java test applet. it does nothing but generate a memory leak. maybe im doning something wrong.
    the interesting thing is that i only have to comment out the code that adds the JScrollPane object to the contentPane of the JApplet. and this class will then finalize.
    here is the test applet
    package com.hobart.scale.test;
    import java.awt.*;
    import javax.swing.*;
    public class TestApplet extends JApplet
         /*                             PUBLIC MEMBERS                             */
         public TestApplet()
            System.out.println("TestApplet:constructor ...");
         /*                         APPLET PUBLIC MEMBERS                          */
         //Initialize the applet
         public void init()
            System.out.println("TestApplet:Initializing ...");
             Container cont = getContentPane();                                                            // get the container to hold it all                                                       
             cont.setLayout( new BorderLayout() );                                             // define the layout used for this applet               
              cont.add(new JScrollPane(), "Center" );
         //Start the applet
         public void start()
            System.out.println("TestApplet:Initializing ...");
         //Stop the applet
         public void stop()
            System.out.println("TestApplet:Stopped ...");
         //Destroy the applet
         public void destroy()
              Container cont = getContentPane();
              cont.removeAll();
              removeAll();
            System.out.println("TestApplet:Destroying ...");
        public void finalize() throws Throwable  {
            System.out.println("finalize ListFonts.java");
              super.finalize();
         /*                         PUBLIC STATIC MEMBERS                          */
         public static void main(String[] args)
            System.out.println("TestApplet:main ...");
         /*                      PUBLIC STATIC FINAL MEMBERS                       */
         /*                            PRIVATE MEMBERS                             */
    }

    why should it create a memory leak?

  • How to determine memory leaks?

    I tried in XCODE, the RUN/ Start with Performance TOol / and tried out the various options. I was running my app and looking to see if it would report increasing memory use but it seemed to be looking at my total system (i was running under the simulator). In general what is the recommended procedure for determining memory leaks, which tool to use, and what tracing can i use?
    How does one look at the retain count of an object? are there system routines that have knonw leaks?

    You took the right path. Once instruments comes up select the Leaks tool. Turn off automatic leak detection. In your app, start off at some known state, do something, and come back to the known state and check for leaks. For instance start off in a view, do something that brings up another view then come back to the original view and check for leaks. Leaks will show you if you leaked. Since you took a very deterministic path then checked it should be straight forward to go to the code and find / fix the leaks. Leaks shows you where the code where the leak was generated.

Maybe you are looking for

  • Windows failed to start. Required device inaccessible.

    Windows failed to start. A recent hardware or software change could be the cause. The boot selection failed because a required device is inaccessible . Both hard disk and memory test passed. Please let me know what can be done. I think it's battery i

  • Iphone 3gs will not display or sync in new itunes

    My new i-phone 3gs will not automatically appear in the latest version of itunes, so I cannot sync my music files onto my i-phone. I have reinstalled the itunes, rebooted, turned off and on the i-phone. There is a message saying that internet connect

  • Filename change history available

    Does OS X store a list of modifications done to the filename of a specific file ? For example I created a file named "myfile.ext" (regardless by which application), then change the original name to "myfile2.ext", "differentname.ext" and so on. Is the

  • Partial power cord for MacBook Pro?

    I have a broken power cord on a MacBook Pro 13-inch early 2011 model. Is there a way to buy the part of the cord that attaches to the computer without shelling out $79 for the whole thing with the power block?

  • Background Painting of "Out of focus" tabbed Panel (JTabbedPane) ?

    Hi I would like to add a on going Bar Graph to a JTabbedPane, this works fine if the specific Tab is in Focus, but when the tab is switched, Painting stops! How can i ensure the painting continues in the background! Here is an example which demo's th