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

Similar Messages

  • Applet Memory Leak - Resizing Images

    Hello,
    I'm having an issue with a Java Applet I have written. The applet reads a directory listing, and displays resized thumbnails in a JTable. The problem is, if the user loads a directory with a lot of large images, the memory usage sky rockets, and is not freed after the user shuts down the applet.
    Below is the code which adds the resized image to a custom table model:
        public void leftClick(){
             main.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
            FileSystemView fsv = FileSystemView.getFileSystemView();
            ImageIcon thumbnailIcon = new ImageIcon();
            ImageIcon icon = new ImageIcon();
            File selectedFile = fileTree.getSelectedFile();
            Image scaledImage;
            if(selectedFile!=null){
                if (selectedFile.isDirectory()){
                    File subFiles[] = selectedFile.listFiles();
                    mvtm.clearList();
                    fileTable.removeAll();
                    TableColumn col = fileTable.getColumnModel().getColumn(0);
                    col.setMaxWidth(35);
                    col = fileTable.getColumnModel().getColumn(1);
                    col.setPreferredWidth(200);
                    col = fileTable.getColumnModel().getColumn(3);
                    col.setPreferredWidth(0);
                    col.setMaxWidth(0);          
                    for(int i = 0;i<subFiles.length;i++){
                        if(subFiles.getName().toLowerCase().contains(".jpg")||
    subFiles[i].getName().toLowerCase().contains(".gif")||
    subFiles[i].getName().toLowerCase().contains(".png")||
    subFiles[i].getName().toLowerCase().contains(".bmp")){
    icon = new ImageIcon(subFiles[i].getPath());
    scaledImage = Utils.getScaledImage(icon.getImage(), 30, 30);
    thumbnailIcon = new ImageIcon(scaledImage);
    }else{
    icon = (ImageIcon)fsv.getSystemIcon(subFiles[i]);     
    scaledImage = Utils.getScaledImage(icon.getImage(), 30, 30);
    thumbnailIcon = new ImageIcon(scaledImage);
    mvtm.addFileRecord(thumbnailIcon, subFiles[i].getName(),
    Long.toString(subFiles[i].length()), subFiles[i]);
    main.setCursor(null);
    The resize method is here:
        static Image getScaledImage(Image srcImg, int w, int h){
            BufferedImage resizedImg;
            resizedImg = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
            Graphics2D g2 = resizedImg.createGraphics();
            g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
            g2.drawImage(srcImg, 0, 0, w,h, Color.WHITE, null);
            g2.dispose();
            return resizedImg;
        }I have tried to nullify all objects created by overriding the applet destroy method:
        public void destroy(){
            fileTree.getFileTreeListener().clearMvtm();
            addButton = null;
            fileTable = null;
            jLabel1 = null;
            jPanel1 = null;
            jPanel2 = null;
            jProgressBar1 = null;
            jScrollPane1 = null;
            jScrollPane2 = null;
            jScrollPane3 = null;
            messageLabel = null;
            removeButton = null;
            uploadButton = null;
            uploadQueueTable = null;
            fileTree = null;
            fileModel = null;
            uploadQueueModel = null;
            task = null;
            Runtime r = Runtime.getRuntime();
            r.gc();
        }Any help is appreciated.
    Ryan
    Edited by: rthompson2000 on Sep 24, 2008 10:33 AM

    Hi SoulTech,
    thanks for the response. Interesting point I forgot to mention. On my machine, the JVM launches separately, (ie, I get the little Java icon in my task tray on the bottom right of my PC). When I close the applet pop-up, the java icon is still there, and the java.exe process is still running in Task Manager. After about a minute or two, the Java icon disappears, and Java.exe is no longer a running process (ie. the memory is gone, but this takes a minute or two! I want this to stop immediately).
    When I try this in a friends PC, they don't get the JVM icon in their taskbar, and all of the memory is allocated to the ieexplorer.exe process. After they close the applet pop-up window, browsing is very slow since their IEexplorer memory is very high because of the applet.
    can you hook up a profiler?
    I'm just getting familiar with the Netbeans profiler. I am able to see that all of the memory is being allocated in the leftClick() method I posted above. All of the memory is being hogged mainly by type int[] in sun.awt.image.ImageRepresentation.setPixels() and java.awt.image.DataBufferInt
    can you see the vm in the process table?
    See my above explanation. The java.exe process seems to die after a minute or two, but I don't think it frees memory when the VM is running inside the browser (as in the case on my friends PC)
    are you sure destroy is even getting called?
    How can I be sure? You said it didn't need to have anything in it anyways so does it matter?
    are you getting errors?
    No errors.

  • Applet memory leak

    It looks like that with Safari, when Javascript calls an applet function with a parameter, twice the size of the parameter is eated in memory and never released.
    This is a big problem in my HTML page since I send the content of a file so after 3 or 4 calls the function does not have anought memory anymore and produce strange behaviour.
    I use Safari 5.1.7 but the same code works fine with Chrome.
    regards

    OK, solved this by isolating the statement that caused the OutOfMemory error, then adding five, count 'em, five System.gc()'s just prior to the statement. I outputted the free memory after each gc and could see it increase each time.
    The statement in question was instantiating an extension of JViewPort which contained a JLayeredPane, the base layer of which is a pretty large image, but there are other populated layers as well. I'm no expert here, but it seems like a flaw, dare I say even a bug, in the garbage collector that it didn't handle this automatically.

  • 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.

  • 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 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 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/

  • 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...

  • 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 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 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.

  • Applet memory / JVM & IE Configuration

    Hi,
    I created an applet loading some jpeg images and shapefiles
    Plug-in java is set to 350 Mo (-Xmx350m) which seems to be the max size accepted by IE
    Over-350Mo-jvm-size shuts down IE at launch.
    With 350 mo configured, I miss some jpeg images when applets is loaded.
    How can I manage to increase the JVM without shutting down IE.
    Any ideas ?
    Thanks in advance

    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

Maybe you are looking for