Imagent process memory leak

Hi all,
Since using a beta a couple of times I've noticed that imagent has gone nuts and started swapping insanely. I have about 30Gb free on my system drive, and it will chew through it all in a matter of minutes, then bring the whole computer to it's knees.
If I catch it in time and kill the process I loose that diskspace to vmswap files, but will get it back on reboot, and I can keep using the computer. If not, I have to hard reboot.
Using 10.7.3, and the Messages Beta. I have a yahoo, AIM, and iMessage accounts.
Also, since killing off the imagent process and it going nuts, even after a restart of the Messages app, I can't iMessage people.
Anyone else seen any odd behaviour?
Regards,
Alex

I also had Messages fail to deliver after killing imagent, and even after rebooting. Turns out in my case Messages had mysteriously switched to locating my contacts by email address rather than cell number. Switching contacts back to number made Message app resend failed messages successfully.

Similar Messages

  • After 10.8.4....imagent process memory leak

    I upgraded my MBA to 10.8.4.  I started getting messages that my startup memory was full.  I take a peak at Activity monitor and "imagent" is using 6GB of RAM and my HD has dropped in available space almost 100GB!!!
    I force quit the process and reboot to recover the space soaked up by the leak, but it keeps coming back.  As soon as I hear my fans going crazy I look at activity monitor and yep its back again.
    Any one else with this issue after 10.8.4?  I see in the release notes it was supposed to fix the reording of the messages in "imagent" but at this point I'll take the reorder problem over this problem.

    Please read this whole message before doing anything.
    This procedure is a diagnostic test. It’s unlikely to solve your problem. Don’t be disappointed when you find that nothing has changed after you complete it.
    The purpose of the test is to determine whether the problem is caused by third-party software that loads automatically at startup or login, or by a peripheral device. 
    Disconnect all wired peripherals except those needed for the test, and remove all aftermarket expansion cards. Boot in safe mode and log in to the account with the problem. Note: If FileVault is enabled, or if a firmware password is set, or if the boot volume is a software RAID, you can’t do this. Ask for further instructions.
    Safe mode is much slower to boot and run than normal, and some things won’t work at all, including Wi-Fi on certain iMacs. The next normal boot may also be somewhat slow.
    The login screen appears even if you usually log in automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin. Test while in safe mode. Same problem? After testing, reboot as usual (i.e., not in safe mode) and verify that you still have the problem. Post the results of the test.

  • Process memory leak issue  solaris 10

    I have a process which has a memory leak issue. I ran this process on solaris 9 as well as solaris 10. When i run prstat command i get a different output for two. Funny thing is that memory leak noted in solaris 10 is much more than that in solaris 9 e.g if it is 1 MB in solaris 9 then its 4 MB in solaris 10.
    What can be possibly causing this ? Is this related to kernel implementation on diff solaris ?

    I have a process which has a memory leak issue. I ran this process on solaris 9 as well as solaris 10. When i run prstat command i get a different output for two. Funny thing is that memory leak noted in solaris 10 is much more than that in solaris 9 e.g if it is 1 MB in solaris 9 then its 4 MB in solaris 10.
    What can be possibly causing this ? Is this related to kernel implementation on diff solaris ?

  • Safari web process - memory leak?

    Mac Pro seemed to have slowed to a crawl.
    Safari 5.1.2 on SL 10.6.8
    Activity Monitor showed I was low on memory - over 7GB was being used by 'safari web process' - slowly close all open pages until only left with two - one was simply the 'bing' home page, the other a page that had failed to load.
    Anyone else had this kind of thing recently?

    Safari has a known memory leak. Open teh Activity Monitor, sort the list of apps by Real Memory column. You will find one called Safari Web Content. This is the cause. If you are running an safari extensions, they use SWafari Web Content to run, you can try turning off your extensions to see if that helps. About the only know fix now, is to close safari regularly. 5.1.2 was suppose to close some leaks but has not. There are reports you can run safari in 32bit mode but I haven't confirmed if this helps or not.

  • Finding Process Memory Leak?

    I have been tracking down memory leaks in a Java server-based application. I recently ran the application for several hours, and monitored memory usage with both JConsole and the Unix �top� command. I encountered some behaviors that I don�t understand.
    With JConsole, I observed that the heap memory usage was fairly constant over time. The Code Cache space, however, gradually increased in size over the life of the test. I expected some increase as additional methods in the application were executed, but it seems that eventually the rate of increase would level out. It did not. Any ideas why that might happen?
    The resident memory (as reported by top) increased significantly over the life of the test. Using pmap and jmap, I was able to determine that the heap space was increasing (even though JConsole reported that the heap was constant.) So, it seems as though the heap usage of the application is constant, but the heap usage of the process is still growing? I am using Java HotSpot VM for Solaris (1.6.0-b105).
    Any suggestions or insight would be appreciated.

    I'm not sure exactly what you're saying, but it sounds like this:
    A tool that's monitoring the VM says the memory used by your objects is not increasing, but other tools say the memory the VM has taken from the OS is increasing.
    Is that the case? If not, nevermind--I've misunderstood.
    If that is the case, then it's totally expected. The VM doesn't usually give memory back to the OS. If it hasn't used up the amount specified by -Xmx (or the default if you didn't specify -Xmx), it's free to just keep grabbing memory from the OS, rather than running a full GC to reclaim memory that it has used for objects but that is no longer reachable.

  • Secd Process Memory Leak

    Finding the secd process using 13GB of RAM was a bit of a shock. Watching its RAM consumption continue to increase, indicates a memory leak. Is this something anyone else has noticed? And any possible solutions?

    Thanks - I think this helped, but will give it a day or two to see what happens.
    My secd was over 32 GB the other day and the iMac wasn't quite its usual self. After restarting, secd's memory usage dropped away, but has been steadily creeping up over the last couple of days and was over 5GB this morning. So I tried dragging the Keychains folder to the trash and restarting.
    The thing about dragging your keychain to the trash and restarting is, on logging back in you may be asked for a pile of passwords to all your mail accounts and your keychain will be empty!
    I filled out all the requests for icloud passwords, but for the keychain to update properly, this took a while. I think what saved me from panicking about losing all my passwords, was going into System Preferences and signing into iCloud there. I was also requested to verify my iCloud login from another device (e.g., iPAD). I think this is what restored my keychain from the cloud.
    Once the keychain had updated itself, I restarted the iMac again, and Mail returned to normal (no more requests for mail account passwords).
    The only thing that wasn't restored after restarting was automatic keychain access to my time machine. I had to enter the password and save it to the keychain.

  • Loading External Images Causes Memory Leak

    I have been working on an Actionscript 2.0 project that basically loads external images.
    Everytime i load and unload a new image, memory increases to 1 or 2 MBs
    If all the images are in cache, then it increased to 4 or 8 KBs
    In the unloading of images, I have removed loader and the container of the image.
    Any thoughts why it is behaving like that?
    Please find the sample code snippet below.
    btn_load.onRelease = function()
    loadImage();
    btn_unLoad.onRelease = function()
    unLoadImage();
    var mcListener:Object = new Object();
    var container1:MovieClip;
    var mcLoader:MovieClipLoader;
    var loader_reference = this;
    var n=0;
    function loadImage(){
    var image_arr = ["http://xyz.com/image1.png","http://xyz.com/image2.png","http://xyz.com/image3.png","http:/ /xyz.com/image4.png","http://xyz.com/image5.png"];
    var image_url = image_arr[n];
    if(n==image_arr.length-1) {
      n=0;
    }else{ 
      n++;
    container1 = loader_reference.createEmptyMovieClip("container1", loader_reference.getNextHighestDepth());
    mcLoader = new MovieClipLoader();
    mcLoader.removeListener(mcListener);
    mcLoader.addListener(mcListener);
    mcListener.onLoadComplete = function(target_mc:MovieClip, httpStatus:Number):Void {
    mcListener.onLoadInit = function(target_mc:MovieClip):Void {
      target_mc._x = 300;
      target_mc._y = 200;
      target_mc._width = 300;
      target_mc._height = 250;
    mcLoader.loadClip(image_url, container1);
    function unLoadImage(){
      mcLoader.unloadClip(container1);
      mcLoader = null;
      container1 = null;
      removeMovieClip(loader_reference.container1);
    Thanks in advance.

    that code should only execute once.  fix that.

  • Memory leak in image rings on Linux

    Hello all,
    I have a very serious problem I didn't have in previous version of my soft and one of the only addition I've made recently is to use image rings. The soft uses 6Mb more every minute. If I remove the rings, it stops. It could be a wrong lead, so I'm trying to write a test case, but is there a list of identified memory leaks somewhere ?
    THanks.
    Solved!
    Go to Solution.

    OK guys, there's a very serious leak on Linux, confirmed by the code below. Every time you change the value of a picture ring, either by clicking on the arrow of the picture ring or right-click on it (callback to SetCtrlVal), it uses 1 extra Mb of mem for a 512x512 pixel image !!!
    Here's a sample code:
    // Right-click the ring to cause memory leak
    #include <stdio.h>
    #include <stdlib.h>
    #include <cvirte.h>
    #include <userint.h>
    #define RND_COLOR (((rand()<<16) ^ (rand()<<8) ^ rand()) & 0xFFFFFF)
    // (int)((double)(0xFFFFFF)*rand()/RAND_MAX)
    static int Pnl=0,
    Text, Ring, // Controls
    NbVals=16, // Number of images in the ring
    Width=512, Height=512; // Of the Canvas and image ring
    // Returns memory used by process in 4Kb page:
    // TotalSize Resident Share Text Lib Data Dirty
    // See "man proc" section statm
    static char* ReadOffMemoryStatus(void) {
    static char statm[80];
    statm[0]='\0';
    #ifdef _NI_linux_
    FILE *f = fopen("/proc/self/statm","r");
    if (f)
    fgets (statm, 79, f),
    fclose(f);
    #endif
    return statm;
    static void Prepare(const int Nb) {
    Point polyPoints[10]={{0,0}};
    char Str[10];
    int i, Bitmap;
    int Canvas=NewCtrl(Pnl, CTRL_CANVAS, "", 0, 0);
    SetCtrlAttribute(Pnl, Canvas, ATTR_DRAW_POLICY, VAL_UPDATE_IMMEDIATELY);
    SetCtrlAttribute(Pnl, Canvas, ATTR_WIDTH, Width);
    SetCtrlAttribute(Pnl, Canvas, ATTR_HEIGHT, Height);
    // SetCtrlAttribute(Pnl, Canvas, ATTR_ENABLE_ANTI_ALIASING, 1); // No compile on Linux
    SetCtrlAttribute(Pnl, Canvas, ATTR_PICT_BGCOLOR, RND_COLOR /*VAL_TRANSPARENT*/);
    SetCtrlAttribute(Pnl, Canvas, ATTR_PEN_FILL_COLOR, RND_COLOR);
    SetCtrlAttribute(Pnl, Canvas, ATTR_PEN_COLOR, RND_COLOR);
    SetCtrlAttribute(Pnl, Canvas, ATTR_PEN_WIDTH, 7);
    for (i=0; i<10; i++)
    polyPoints[i].x=(Width*rand()/RAND_MAX),
    polyPoints[i].y=(Height*rand()/RAND_MAX);
    sprintf(Str, "%d", Nb);
    // CanvasStartBatchDraw(Pnl, Canvas);
    // This sometimes doesn't work on Linux
    CanvasDrawPoly (Pnl, Canvas, 10, polyPoints, 1, VAL_DRAW_FRAME_AND_INTERIOR);
    CanvasDrawLine (Pnl, Canvas, MakePoint(Width-1,0), MakePoint(0, Height-1));
    SetCtrlAttribute(Pnl, Canvas, ATTR_PEN_COLOR, VAL_BLACK);
    SetCtrlAttribute(Pnl, Canvas, ATTR_PEN_FILL_COLOR, VAL_WHITE);
    CanvasDrawText(Pnl, Canvas, Str, VAL_APP_META_FONT,
    MakeRect (2, 2, VAL_KEEP_SAME_SIZE, VAL_KEEP_SAME_SIZE), VAL_UPPER_LEFT);
    // CanvasEndBatchDraw(Pnl, Canvas);
    GetCtrlBitmap(Pnl, Canvas, 0, &Bitmap);
    DiscardCtrl (Pnl, Canvas);
    InsertListItem(Pnl, Ring, Nb, NULL, Nb); // The value is the color, so remember which one you use
    SetCtrlBitmap (Pnl, Ring, Nb, Bitmap);
    DiscardBitmap (Bitmap);
    int CVICALLBACK cb_Change(int panel, int control, int event,
    void *callbackData, int eventData1, int eventData2) {
    static int i=0;
    switch (event) {
    case EVENT_RIGHT_CLICK:
    case EVENT_RIGHT_DOUBLE_CLICK:
    SetCtrlVal(Pnl, Ring, i=(i+1)%NbVals);
    // No break;
    case EVENT_COMMIT:
    SetCtrlVal(Pnl, Text, ReadOffMemoryStatus());
    break;
    return 0;
    int CVICALLBACK cb_Quit(int panel, int control, int event,
    void *callbackData, int eventData1, int eventData2) {
    switch (event) {
    case EVENT_COMMIT: QuitUserInterface (0); break;
    return 0;
    int main (int argc, char *argv[]) {
    int i, Quit;
    if (InitCVIRTE (0, argv, 0) == 0) return -1;
    Pnl = NewPanel (0, "Test image ring", 20, 20, Height+20, Width);
    Text = NewCtrl (Pnl, CTRL_STRING_LS, "Memory use (in 4Kb pages)", 0, 0);
    Ring = NewCtrl (Pnl, CTRL_PICTURE_RING, "", 20, 0);
    Quit = NewCtrl (Pnl, CTRL_SQUARE_BUTTON_LS, "", 50, 50);
    SetCtrlAttribute(Pnl, Ring, ATTR_HEIGHT, Height);
    SetCtrlAttribute(Pnl, Ring, ATTR_WIDTH, Width);
    SetCtrlAttribute (Pnl, Ring, ATTR_CTRL_MODE, VAL_HOT);
    SetCtrlAttribute(Pnl, Ring, ATTR_CALLBACK_FUNCTION_POINTER, cb_Change);
    for (i=0; i<NbVals; i++) Prepare(i);
    SetCtrlAttribute(Pnl, Text, ATTR_WIDTH, 250);
    SetCtrlAttribute(Pnl, Text, ATTR_LABEL_LEFT, 250);
    SetCtrlAttribute(Pnl, Text, ATTR_LABEL_TOP, 0);
    SetCtrlAttribute(Pnl, Quit, ATTR_CALLBACK_FUNCTION_POINTER, cb_Quit);
    SetCtrlAttribute(Pnl, Quit, ATTR_VISIBLE, 0);
    SetCtrlAttribute(Pnl, Quit, ATTR_SHORTCUT_KEY, VAL_ESC_VKEY);
    SetPanelAttribute(Pnl, ATTR_CLOSE_CTRL, Quit);
    DisplayPanel (Pnl);
    RunUserInterface ();
    return 0;
    There are other issues as well:
     - CanvasDrawPoly sometimes doesn't work.
     - The anti-aliasing on a canvas doesn't compile.
    Is there anything more recent than CVI 2010 for Linux ?!?

  • Applescript Image Events appears to have memory leak (or I don't know what I am doing)

    Using Image Events to create images and thumbnails for a website. The following code results in very large memory leaks in Image Event process. I have documented results of test runs in the comments.
    The leak (or poor coding on my part) results in a total system halt if I attempt to process more than about 400 images at a time. Basically, I run out ot physical memory. I am running a new model 13" MBP with 8GM RAM.  I have to manually stop Image Events to reclaim the memory (or reboot of course).
    Any help/suggestions would be appreciated.
    (* test memory leak in Image Events *)
              tests with 58 photos selected in iPhoto
              5.7 MB left in Image Events after run with only open and close
              22.0 MB left in Image Events after run with open, save and close
              45.9 MB left in Image Events after run with open, scale, save and close
              A run with 382 photos selected used OVER 3.8 GB (gigabytes) and the
              mac ran out of physical memory so I had to stop the test.
    tell application "Finder"
              set imageFolder to folder "test" of home as alias
    end tell
    tell application "iPhoto"
              set currPhotoList to the selection
              repeat with currPhoto in currPhotoList
                        log name of currPhoto as string
                        set theImagePath to image path of currPhoto
                        tell application "Image Events"
      launch
                                  set theImage to open theImagePath
      scale theImage to size 128
      save theImage in imageFolder as JPEG with icon
      close theImage
                        end tell
              end repeat
    end tell
    --- end of code example

    Does the following code do any difference? Most likely no I guess… but better try than nothing.
    tell application "Finder"
        set imageFolder to folder "test" of home as text -- instead of “as alias” (see theTargetPath below)
    end tell
    set theImagePaths to {}
    set theImagePathsRef to a reference to theImagePaths -- faster with big lists
    tell application "iPhoto"
        set currPhotoList to the selection
        repeat with currPhoto in currPhotoList
            log name of currPhoto as string
            get POSIX file (image path of currPhoto) as alias -- faster ?
            copy result to the end of theImagePathsRef
        end repeat
    end tell
    tell application "Image Events"
        launch
        repeat with theImagePath in theImagePaths
            set theImage to open theImagePath
            scale theImage to size 128
            set theTargetPath to (imageFolder & name of theImagePath)
            save theImage in theTargetPath as JPEG with icon
            close theImage
        end repeat
    end tell

  • OBVIOUS MEMORY LEAK  iTunes about:10.6.3.25  (upgraded from 32 to 64)  but iTunes*32 process is in memory. clicking on a song to play or right clicking it adds 5MB.  Did 32 have this problem and didn't uninstall correctly or is 64 broken too.

    OBVIOUS MEMORY LEAK
    iTunes about:10.6.3.25
    windows 64 bit Home on AMD64 HP G60 laptop
    downloaded and installed "iTunes32Setup.exe"
    saw the problem and uninstalled it
    downloaded and installed "iTunes64Setup.exe"
    iTunes about:10.6.3.25
    now i see process "iTunes.exe*32
    it is ok when it play song list
    but ***** UP MEMORY when i click on another song to play. apparently it doesn't release previous player thread
    OR,
    if you right click on a song, the memory will blow up antother 6MB and won't release it...can do it all day long
    -- until run out of memory and iTunes freezes...without any of my changes.
    sooooo.. is it the uninstaller or is iTunes64Setup.exe mispackaged or do both have memory problems on AMD 64 ?

    Unfortunately I was able to repeat the memory leak even with turning the Toolbar off.  To replicate the problem, I was able to watch the memory leak each time I actively selected a new song with the iTunes open.  I was able to repeat the leak with and without both Spotify and TuneUp Companion running and not running.  The only thing I noticed is when both Spotify and iTunes were open, the memory leak from iTunes added insult to injure with Spotify which kept trying to sync up with iTunes local library which would crash Spotify as well.  But I can confirm the memory leak is in iTunes 10.6.3.25 (looking forward to 10.6.4 fixing the problem).

  • Memory Leak in edited images?

    I am using Captivate 4.0.1 Build 1658 (this means that the patch from May 2009 is applied) on Windows Vista.
    The following has happened to myself and at least 2 other developers.
    We edit a slide background image in Photoshop...when the  movie plays, a flash of the previously unedited background shows.  I have tried re-editing the background and it does not fix the problem. I have tried eliminating transistions and it does not fix the problem.  I have noticed that this happens when background images are edited in Photoshop as well as within Captivate when bitmaps are pasted onto a slide background and then merged into the background.
    I don't know if the correct term for this is a memory leak, but the closest mention of this problem I could find was here: http://blogs.adobe.com/captivate/2009/05/captvate_4_patch_update.html
    I appreciate any help resolving this.
    Thank you,
    Beth

    The Reset Firefox feature can fix many issues by restoring Firefox to its factory default state while saving your essential information.
    Note: ''This will cause you to lose any Extensions, Open websites, and some Preferences.''
    To Reset Firefox do the following:
    #Go to Firefox > Help > Troubleshooting Information.
    #Click the "Reset Firefox" button.
    #Firefox will close and reset. After Firefox is done, it will show a window with the information that is imported. Click Finish.
    #Firefox will open with all factory defaults applied.
    Further information can be found in the [[Reset Firefox – easily fix most problems]] article.
    Did this fix your problems? Please report back to us!

  • Detecting a memory leak in a process running on Solaris 5.7

    Hi,
    Iam running my application on solaris 5.7 platform.
    I can see clear memory leak in that process.
    Is there any tool or in-built functionality on solaris 5.7 to detect/fix that leak.
    Thanks in advance,
    Avvaru

    Thanks for the reply. I already turned it off in both Safari and Spotlight preferences. However the problem persists. The process still runs, and from time to time it decides to leak all the memory as well. I really can't understand what the reason might be.
    To be clear, in Safari-->Preferences-->Search-->Smart search field-->"Include Spotlight Suggestions" is un-checked. In Spotlight preferences all three "Spotlight Suggestions", "Bookmarks & History" and "Bing Web Searches" are un-checked. Process still runs under Spotlight as can be seen here:
    After the last post I let it run for a while when it happened again, and below is just before i terminated it. Look at the memory usage!

  • Image Memory Leaks in AIR app

    We are implementing an AIR application that loads thumbnails
    from the hard drive and uploads them to a remote server.
    When bringing in large images, for example, when importing
    five 2MB files into Image objects:
    Flex reports that it is using 55MB
    Windows reports using 220 Meg (viewing memory usage of
    adl.exe in task manager)
    After deletion of these image objects, the memory stays
    allocated!! It is released when the application is closed.
    Two issues I see:
    1. Huge memory usage for image objects (I understand that JPG
    files are exploded into BMPs). It limits our ability to load 10's
    or 100's of images.
    2. Bad Memory leak
    OTHER THINGS WE TRIED:
    1. Displaying images as inline html IMG tags.. Same memory
    usage!
    2. Taking a snapshot of the image and displaying that.
    Problem, used way to much CPU
    I hope these issues will be fixed before release time or we
    are hosed.
    PLATFORM: Windows XP Professional, service pack 2

    Hi
    Have you tried the FB3 profiler to investigate why memory is
    not getting deallocated?
    You can use the loitering objects panel to track the back
    references for the objects in memory. If you find that image object
    is not being referenced by anything else. Can you file a bug at
    http://bugs.adobe.com/flex
    with a small test case.
    Also as you know that jpg will be translated into bitmap. The
    amount of memory required will be determined by the pixels in the
    image. Each pixel will be 4K
    Thanks,
    Gaurav Jain
    Flex SDK Team

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

  • Scale Image Memory Leak

    There seems to be a memory leak in the Image.getScaledInstance(...) method when used in the following code:
    if(scanImage.getWidth(this) > scanImage.getHeight(this))
        scanImage =  scanImage.getScaledInstance(300, -1, Image.SCALE_DEFAULT);
    else
        scanImage =  scanImage.getScaledInstance(-1, 300, Image.SCALE_DEFAULT);
    }Any ideas why its leaking, or another way of doing scaling?

    hi
    memory problems with this method seem to be common. here is another way of scaling images:
    Iterator readers = ImageIO.getImageReadersByFormatName("gif");
    ImageReader reader = (ImageReader)readers.next();
    ImageInputStream iis = ImageIO.createImageInputStream(new File(path));               
    reader.setInput(iis, true);
    ImageReadParam param = reader.getDefaultReadParam();
    param.setSourceRenderSize(new Dimension(width, height));
    BufferedImage thumbnail = reader.read(0, param);
    this does not work for jpeg images and you need the sdk 1.4.2 in order to use ImageIO. previous versions do not have this framework.

Maybe you are looking for