How do I release memory when done with a large Image?

I've got a sample program here. Enter a filename of a .jpg file, click the button and it will load and display a thumbnail of it. However memory is not released so repeatedly clicking the button will let you watch the memory use grow and grow. What should be done in the code to release the large original image once the thumbnail is obtained? Here's the class:
import java.awt.*;
import java.awt.event.*;
import java.awt.image.*;
import java.io.*;
import java.util.Iterator;
import javax.imageio.*;
import javax.imageio.stream.*;
import javax.swing.*;
public class ImageMemoryLeak extends JFrame implements ActionListener {
     private JLabel thumbnail = null;
     private JTextField tf = null;
     private JButton button = null;
     public static void main(String[] args) {
          ImageMemoryLeak leaker = new ImageMemoryLeak();
          try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); }
          catch (Exception ex) { }
          leaker.showDialog();
     private void showDialog() {
          setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          setBounds(100,100,200,200);
          setBackground(new Color(255,255,255));
          Container cont = getContentPane();
          cont.setBackground(Color.lightGray);
          cont.setLayout(new FlowLayout());
          thumbnail = new JLabel("thumbnail here");      
          cont.add(thumbnail);
          tf = new JTextField("type filename here");     
          cont.add(tf);
          button = new JButton("Load Image");
          button.addActionListener(this);
          cont.add(button);
          pack();
          setVisible(true);
     public void actionPerformed(ActionEvent e) {
          if (e.getSource() == button) {
               String fname = tf.getText();
               File f = new File(fname);
               if (f.exists()) {                    
                    try {
                         // This is where a file is loaded and thumbnail created
                         Iterator<ImageReader> iter = ImageIO.getImageReadersByFormatName("jpeg");
                         ImageReader imgrdr = iter.next();
                         ImageInputStream iis = ImageIO.createImageInputStream(f);     
                         imgrdr.setInput(iis, true);
                         ImageReadParam param = imgrdr.getDefaultReadParam();
                         BufferedImage fullSizeImage = imgrdr.read(0, param);
                         imgrdr.dispose();     // is this enough?     
                         iis.close();               
                         int thWidth = 150;
                         int thHeight = 150;
                         int w = fullSizeImage.getWidth(null);
                         int h = fullSizeImage.getHeight(null);
                         double ratio = (double)w/(double)h;
                         if (w>h) thHeight = (int)((double)thHeight /ratio);
                         else if (w<h) thWidth = (int)((double)thWidth * ratio);
                         BufferedImage thumbImage = new BufferedImage(thWidth, thHeight, BufferedImage.TYPE_INT_RGB);
                         Graphics2D graphics2D = thumbImage.createGraphics();
                         graphics2D.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
                         RenderingHints.VALUE_INTERPOLATION_BILINEAR);
                         graphics2D.drawImage(fullSizeImage, 0, 0, thWidth, thHeight, null);
                         // done with fullSizeImage now - how to release it though?
                         fullSizeImage.flush();     // doesn't seem to do the trick
                         ImageIcon oldicon = (ImageIcon)thumbnail.getIcon();
                         if (oldicon != null) oldicon.getImage().flush();
                         ImageIcon icon = new ImageIcon(thumbImage);
                         thumbnail.setIcon(icon);
                         thumbnail.setText("");
                         pack();
                    } catch (IOException e1) {
                         e1.printStackTrace();
               else {
                    thumbnail.setText("file not found");
}

lecisco wrote:
AndrewThompson64 wrote:
lecisco wrote:
I don't mind having GC getting to it but it's not doing so now. .. Isn't it? GC is only called when the JRE feels it is necessary. Definitive evidence of a memory leak is generally revealed by an OutOfMemoryError. Does the code throw OOMEs?Excellent point. I tried loading over and over to force an OOME. I found that after the memory footprint grew to about 750mb, it reset down to about 130mb again, so it seems that GC does eventually kick in. Perhaps what I have is fine.
That question brings me to the code sample. Typing an image file name in a text field is soooo 1980s. It would take a long time and much hard work on the part of the person testing it, in order to get to an OOME.In my actual application I'm using drag-and-drop to specify the image. The text field was just to simplify the code sample. How you get the file location is not relevant for the question - it's how the resources are released. If you're saying my code is fine regarding and shouldn't be holding onto any resources, that's great. I'm not saying that. So far I've not looked closely at the code, and am no expert on resource caching in any case.
..I am looking to confirm I'm following best practices regarding image resources.Good show. There is too much rubbish code out there.
..With the code sample, you just have to specify one .jpg file and repeatedly click the button to see the memory grow, so there's no burden to type a new file each time.Oh right, my bad. I had presumed it required a different image each time. Still (grumbles) a file chooser to select the image file would not have gone astray - for us lazy types. ;)

Similar Messages

  • How to create a pop-up window with a larger image

    Again, I'm looking to do something very simple and can't figure it out. I want users to be able to hover over/click on an image and there pops up a larger version of the image, much like you see on online catalogs and shopping sites. I've looked into Lightbox and jQuery but don't understand how to incorporate the code into my pages. Is there a simpler way using DW CS4?
    Thanks,
    Gail

    Select the thumbnail image and link it to the larger image file.
    Use DW Behaviors Panel and hit the plus + sign.
    Choose Open Browser Window.  This will invoke another panel for adjusting the size and other attributes of your pop-up window.
    Hit OK.
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists 
    http://alt-web.com/
    http://twitter.com/altweb

  • How do u close the apps when done with them to save power with iOS 7

    How do u close the apps when done with them to save power with iOS 7

    To close out apps, simply double click the home button and instead of holding down the app icons and clicking on the X mark in older versions, you have to swipe the app window up and away.
    Also you can save on battery by turning of background app refresh from settings .... See this article for details , http://nyacomputing.com/how-to-close-out-background-apps-in-ios-7-and-save-on-ba ttery/

  • PS Touch Android does not release memory when closed.

    I have to force closure with Task Manager on my Samsung Note 2 running JB 4.1. Why and when will it be fixed?

    Hi Ignacio,
    Sorry for the lack of information - I had typed more complete description, but had trouble posting it.
    The app is installed on a Samsung Galaxy Note 2 phone that is running Jellybean 4.1.1.
    The only way I can see to exit the application is by using the "back" soft key under the screen on the right. Some apps have an "exit" choice under the "menu" soft key, but that key is not active with PSTouch.
    I see the same issue with Google Chrome. The menu key is active with this app, but it does not have an "exit" choice.
    With both these apps, I have to go to the "Active Apps" tab of the Task Manager to release memory.
    There is one difference with PS Touch. Google Chrome always starts the same way whether or not I release it's memory. With PS Touch, if I release memory after closing with the back key, the next time I start it I get an initial royal blue screen with the PS Touch icon in the middle followed by a second screen with a menu in the middle titled "New Project From". If I exit at that point, it takes two presses of the back key to first close the menu and then exit the program and return to a home screen. If I do not release memory, the next time I start PS Touch, it goes directly to the second screen, but without the "New Project From" menu.
    I hope this gives you the information you need.
                      Pete

  • How do I convert old work done with iMovie HD 6 to view/work with iMovie 11 on my new iMac?

    How do I convert old work done with iMovie HD 6 to view and work with in iMovie 11 on my new iMac?

    If you still have your iMovie 6 project, you can import it using FILE/IMPORT/iMovieHD Project.
    If all you have is the finished movie, you can FILE/IMPORT MOVIE.
    If your movie is in DV Stream format, it is advisable to convert it to QuickTime MOV container containing DV codec. Otherwise, the import will be chronological by the date and time the clip was shot, rather than in edited order.

  • How do I create Equal Height Columns with my Background Images?

    Hi there,
    here is my page http://www.allthingsprintuk.co.uk/ATPHome.html
    My problem is that the side bar HTML list is coming off the page in IE. & also the html  in the header can look awful due to browser settings.
    My question is how do I create Equal Height Columns with my Background Images so that they fit with the HTML text? Is there a good link you can point me to, or a tutorial?
    The only way I can see by doing it is slicing my images up into 3 (top middle & bottom) & then setting the middle to repeat y????
    Or does anyone know of a way to create rounded corners WITH drop shadows in CSS that will work on all browsers?
    Thanks in advance
    Louisa

    Try these http://www.pixelan.com/

  • How to get exact match when working with Oracle Text?

    Hi,
    I'm running Oracle9i Database R2.
    I would like to know how do I get exact match when working with Oracle Text.
    DROP TABLE T_TEST_1;
    CREATE TABLE T_TEST_1 (text VARCHAR2(30));
    INSERT INTO T_TEST_1 VALUES('Management');
    INSERT INTO T_TEST_1 VALUES('Busines Management Practice');
    INSERT INTO T_TEST_1 VALUES('Human Resource Management');
    COMMIT;
    DROP INDEX T_TEST_1;
    CREATE INDEX T_TEST_1_IDX ON T_TEST_1(text) INDEXTYPE IS CTXSYS.CONTEXT;
    SELECT * FROM T_TEST_1 WHERE CONTAINS(text, 'Management')>0;
    The above query will return 3 rows. How do I make Oracle Text to return me only the first row - which is exact match because sometimes my users need to look for exact match term.
    Please advise.
    Regards,
    Jap.

    But I would like to utilize the Oracle Text index. Don't know your db version, but if you slightly redefine your index you can achieve this (at least on my 11g instance) :
    SQL> create table t_test_1 (text varchar2(30))
      2  /
    Table created.
    SQL> insert into t_test_1 values ('Management')
      2  /
    1 row created.
    SQL> insert into t_test_1 values ('Busines Management Practice')
      2  /
    1 row created.
    SQL> insert into t_test_1 values ('Human Resource Management')
      2  /
    1 row created.
    SQL>
    SQL> create index t_test_1_idx on t_test_1(text) indextype is ctxsys.context filter by text
      2  /
    Index created.
    SQL> set autotrace on explain
    SQL>
    SQL> select text, score (1)
      2    from t_test_1
      3   where contains (text, 'Management and sdata(text="Management")', 1) > 0
      4  /
    TEXT                             SCORE(1)
    Management                              3
    Execution Plan
    Plan hash value: 4163886076
    | Id  | Operation                   | Name         | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT            |              |     1 |    29 |     4   (0)| 00:00:01 |
    |   1 |  TABLE ACCESS BY INDEX ROWID| T_TEST_1     |     1 |    29 |     4   (0)| 00:00:01 |
    |*  2 |   DOMAIN INDEX              | T_TEST_1_IDX |       |       |     4   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       2 - access("CTXSYS"."CONTAINS"("TEXT",'Management and
                  sdata(text="Management")',1)>0)
    Note
       - dynamic sampling used for this statementJust read that you indeed mentioned your db version in your first post.
    Not sure though if above method is already available in 9i ...
    Message was edited by:
    michaels

  • Firefox is not releasing memory when I close tabs ands really slows my computer down. Also it doesn't close most of the time when I close it-I have to stop the process in task manager to get it to close. Please Help!!!

    firefox uses 429,992/1108 memory right now with only 3 basic tabs open-no graphics

    If you mean you are asked when finishing, I've not had a problem, .
    In any case you should be able to open your Previous Windown through the History Menu, and then also from there all your previous windows (might be 5 total)
    More detail in item #31 (#tabslost) in ...
    You can make Firefox '''Firefox 5.0''' look like Firefox 3.6.18, see numbered items 1-10 in the following topic [http://dmcritchie.mvps.org/firefox/firefox-problems.htm#fx4interface Fix Firefox 4.0 toolbar user interface, problems (Make Firefox 5.0, or 4.0.1, look like 3.6)].

  • How can I control dpi when importing with Image Capture?

    This is not really an iPhoto question, but there is no forum for Image Capture - and I am hoping some iPhoto user has discovered a solution.
    I usually import my digital camera images into a folder using Image Capture, apply Photoshop corrections, THEN move the adjusted and re-named images to iPhoto for organization and storage.
    When I open the images for the first time in Photoshop, the Image Size box always shows the resolution as 72 dpi. I can easily convert this to 300 dpi in Photoshop, but I would prefer to avoid the extra step for every photo.
    So far, I have not been able to find any setting in either my camera menus or Image Capture to change the default from 72 dpi to 300 dpi - any suggestions?
    I am using Image Capture v3.0.3, Mac OS v10.4.11 and iPhoto v7.1.5
    thanks,
    -gw

    Old Toad said: "If these services printed your files at 72 dpi you would end up with very large prints."
    Obviously - which is exactly what I want to avoid!
    In fact Photoshop tries to do that, warning me: "The image is larger than the paper's area, some clipping will occur."
    Terence Delvin said: "When you print the density of those pixels will determine the quality of the print. So, change the density and the dimensions change. Change the dimensions and the density changes. See the relationship?"
    Yes, I understand all that perfectly.
    I guess my real question should have been:
    "Are there any print services or page-layout-type software applications that honor the exif data and try to print or re-size using a print resolution of 72 dpi without making the user re-define the density to something more print friendly?
    For example:
    I have a 3936x2624 pixel image for which Photoshop's Get Info shows the print resolution as 72 dpi. If I drag that image into a Microsoft Word document, then Word does some kind of magic resizing to fit the image on the width of my 8.5x11" document. With margins, the image is now about 4x6". Looks good on my screen (but then even a 72 dpi image would, wouldn't it).
    Obviously, MS Word downsized the image, but I can't find any way to make Word show me what print resolution it is choosing to assign to the resized image. It looks fine when printed, so I'm pretty sure that, in this case, something higher than 72 dpi was used.
    If ALL software of this type (word processing and page layout) automatically ignores the 72 dpi print resolution in the EXIF data when resizing, then it's a non-issue, as you suggest. Lacking, much real world experience with print-based projects, I wasn't sure if it was something to worry about - apparently not?
    Thanks,
    -gw

  • In an iPhoto slideshow how do I get it to start with the first image?

    It seems as if the slideshow starts with a ramdom image.
    Is there any way to have an i:Photo slieshow start with the first one in an album?

    When playing a slideshow directly from an album the show will start with the first photo in the album unless another photo is selected.  In that case the slideshow will begin with the selected photo.
    There's also an setting pane for the album slideshow with an option to randomize the photos with each playing.
    Make sure the Shuffle checkbox is not selected.

  • Bridge CS4 with very large image archves

    I have just catalogued 420,000 images from 3TB of my photographic collection. For those interested, the master cache files became quite large and took about 9 days of continuous processing:
    cache size: 140 gb
    file count: 991,000
    folder count: 3000
    All cache files were also exported to the disk directories.
    My primary intent was to use the exported cache files as a "quick" browsing mechanism with bridge. Of course, "quick" is a rather optimistic word, however is is very significantly faster than having bridge rebuild caches as needed.
    I am now trying to decide if it is worth keeping the master bridge cache because of the limitations of the bridge implementation which is not very flexible as to where and when the master cache adds new temporary cache entries.
    Any suggestions as to the value of keeping the master cache would be appreciated. I don't really need key word or other rating systems since I presently use a simple external data base for this type for image location.
    I am also interested in knowing if the "500,000" entry cache limitation is real - or if more than 500,000 images can be stored in the master cache since I will be exceeding this image count next year.

    I have a bridge 5 cache system with 600,000 images over 8 TB of networded disk.  I too use this to "speed up" the browsing process and rely primarily on key word processing to group images.  The metadata indexing is, for practical purposes, totally useless (it never ceases to amaze me about why Adobe things it useful for me to know how many images were taken with a lens focal length of 73mm - or some other equally useless statistic).  The only thing I can think of that is are serious missing keyword indexing feature is the ability to have a key word associated with a directory.  For example, I have shot many dozens of dance, theatre, music and sports productions - it would be much more useful to cataloge a directory that has the key words "Theatre" and "Romeo and Juliette" than attempt to key-word each individual image.   It is, of course, possible to work around the restrictions but that is very unclean and certainly less than desireable.   Key-wording a project (i.e. a directory) is a totally different kettle of fish than key-wording an image.  I also find the concept of the "collection" is very useful and well implemented.
    I do maintain a complete cache build of my system.  It is spread over two master caches, one for the first 400,000 images and a second for the next 400,000 (I want to stay within the 500,000 cache size limit - it is probabley associated with the MYSQL component of Bridge and I think may have problems if you exceed the limit by a substantial amount.  With Bridge on CS3, when the limit was exceeded , the cache system self-distructed and I had to rebuild).
    The only thing I can think of (and that seems to be part of Adobe's design) is that Bridge will rebuild the master cache for a working directory "for no apparent reason" such as when certain (unknown) changes are made to ACR,   Other automatic rebuilds have been reported by others however Adobe does not comment upon when or what casuses a rebuild.  Of course, this has serious impact upon getting work done - it is a bloody pain to have bridge suddenly process 1500 thumbs and preview extracts simply to keep the master cache completely and perfectly synchronized (in terms of image quality) with what might be displayed if you happen if you want to load a raw image into photoshop.  This strategy is IMHO completely out of step with how (at least I) use the browsing features of bridge.
    It may be of concern that Adobe may, for design reasons, change the format of the directory cache files and you will have to completely rebuild all master and directory caches yet again - which is a real problem if you have many hundreds of thousands of images.  This happened when the cache system changed from CS3 to CS4 - and Adobe did not provide conversion programme to migrate the old to new format.  This significantly adds to the rebuild time since each raw image must be completely reprocessed.  My current rebuild of the master cache has taken over two elapsed weeks of contunuous running.
    It would be nice if Adobe would allow some control over what is recorded in the master cache - for example, "do you wish meta data to be indexed".
    (( as an aside, adobe does not comment upon why, when using Bridge to import images from a CF card, results in the building a .xmp file with nothing but meta data for each raw file.  I am at a loss to speculate what really useful thing results other than maybe speeding up the processing of the (IMHO useless) aspects of meta data ))
    To answer your quiestion, I do think the master cache is worth keeping - and we can pray that Adobe puts more though process into why the master cache exists and who uses the present type of information indexed within the cache.

  • Final_cut_pro-"Error: out of memory" when rendering with hidef clips

    I keep getting this notice when rendering "error: out of memory." Both my external drive and internal drive have plenty of memory; 1.8TB and 101GB respectively. It makes no difference if I am rendering at full resolution or draft. I solved it for a while by clearing out some memory on my internal harddrive,
    but now it is back. What is going on. This didn't happen when I was working with regular definition clips but now I am working with high def. What to do?

    Drives don't have 'memory' in this context, they are storage containers.
    Check my answer to your other thread and give us more info about your rig...Hardware/Software (models/versions), how everything's connected, exact specifications of the media you're working with and sequence settings.
    K

  • How to read the memory/memdbg log with regards to an OOM?

    We're trying to migrate from Sun JVM 1.5.0_14 to JRockit R27.5.0 running WebLogic 9.2.2 on Sun Solaris 10 on T2000 boxes (8 cores and 32G of memory). When specifying an pausetime target of 200ms (-server -Xms1g -Xmx1g -XgcPrio:pausetime -Xpausetarget=200ms -XXgcThreads:4 -XXoptThreads:4 -XXnoSystemGC -XXallocPrefetch) we're running in OOMs like
    <17.03.2008 18.17 Uhr CET> <Notice> <Log Management> <BEA-170027> <The server initialized the domain log broadcaster successfully. Log messages will now be broadcasted to the domain log.>
    Exception in thread "Dispatcher-Thread-19" java.lang.OutOfMemoryError: allocLargeObjectOrArray - Object size: 7057136, Num elements: 3528560
         at java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:99)
         at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:393)
         at java.lang.StringBuilder.append(StringBuilder.java:120)
         at java.lang.Thread.run(Thread.java:595)
    <17.03.2008 18.17 Uhr CET> <Notice> <Cluster> <BEA-000138> <Listening for announcements from cluster PT_VK_Cluster on 239.255.255.22:7001.> From the corresponding memory/memdbg log:
    [memory ][Mon Mar 17 17:45:30 2008][15174] Running with 32 bit heap and compressed references.
    [memdbg ][Mon Mar 17 17:45:30 2008][15174] Memory layout after heap allocation:
    [memdbg ][Mon Mar 17 17:45:30 2008][15174] ' ' - free, '-' - OS reserved range, 'r' - reserved,  'x' - committed,
    [memdbg ][Mon Mar 17 17:45:30 2008][15174] '+' - committed/read, 'e' - committed/executable
    [memdbg ][Mon Mar 17 17:45:30 2008][15174] 'J' - java heap, 'j' - java heap data structures
    [memdbg ][Mon Mar 17 17:45:30 2008][15174] 00 0.00Gb -jjjjjjjj+jJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ
    [memdbg ][Mon Mar 17 17:45:30 2008][15174] 10 0.25Gb JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ
    [memdbg ][Mon Mar 17 17:45:30 2008][15174] 20 0.50Gb JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ
    [memdbg ][Mon Mar 17 17:45:30 2008][15174] 30 0.75Gb JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ
    [memdbg ][Mon Mar 17 17:45:30 2008][15174] 40 1.00Gb JJJJJJJJJJJ                                                    
    [memdbg ][Mon Mar 17 17:45:30 2008][15174] 50 1.25Gb                                                                
    [memdbg ][Mon Mar 17 17:45:30 2008][15174] 60 1.50Gb                                                                
    [memdbg ][Mon Mar 17 17:45:30 2008][15174] 70 1.75Gb                                                                
    [memdbg ][Mon Mar 17 17:45:30 2008][15174] 80 2.00Gb                                                                
    [memdbg ][Mon Mar 17 17:45:30 2008][15174] 90 2.25Gb                                                                
    [memdbg ][Mon Mar 17 17:45:30 2008][15174] a0 2.50Gb                                                                
    [memdbg ][Mon Mar 17 17:45:30 2008][15174] b0 2.75Gb                                                                
    [memdbg ][Mon Mar 17 17:45:30 2008][15174] c0 3.00Gb                                                                
    [memdbg ][Mon Mar 17 17:45:30 2008][15174] d0 3.25Gb                                                                
    [memdbg ][Mon Mar 17 17:45:30 2008][15174] e0 3.50Gb                                                                
    [memdbg ][Mon Mar 17 17:45:30 2008][15174] f0 3.75Gb                                                                
    [memdbg ][Mon Mar 17 17:45:30 2008][15174] Minimum TLA size is 2048 bytes
    [memdbg ][Mon Mar 17 17:45:30 2008][15174] Preferred TLA size is 40960 bytes
    [memdbg ][Mon Mar 17 17:45:30 2008][15174] Large object limit is 2048 bytes
    [memdbg ][Mon Mar 17 17:45:30 2008][15174] Minimal blocksize on the freelist is 2048 bytes
    [memdbg ][Mon Mar 17 17:45:30 2008][15174] Initial and maximum number of gc threads: 4, of which 4 parallel threads, 4 concurrent threads, and 4 yc threads.
    [memdbg ][Mon Mar 17 17:45:30 2008][15174] Maximum nursery percentage of free heap is: 95.
    [memdbg ][Mon Mar 17 17:45:30 2008][15174] Prefetch distance in balanced tree: 4
    [compact][Mon Mar 17 17:45:30 2008][15174] Compactset limit: 299900, Using matrixes: 1, Static: 0
    [memory ][Mon Mar 17 17:45:30 2008][15174] GC mode: Garbage collection optimized for short pausetimes, initial strategy: Concurrent Mark & Sweep
    [memory ][Mon Mar 17 17:45:30 2008][15174] heap size: 1048576K, maximal heap size: 1048576K
    [memory ][Mon Mar 17 17:45:30 2008][15174] < s>-<end>: GC <before>K-><after>K (<heap>K), <pause> ms
    [memory ][Mon Mar 17 17:45:30 2008][15174] <s/start> - start time of collection (seconds since jvm start)
    [memory ][Mon Mar 17 17:45:30 2008][15174] <end>     - end time of collection (seconds since jvm start)
    [memory ][Mon Mar 17 17:45:30 2008][15174] <before>  - memory used by objects before collection (KB)
    [memory ][Mon Mar 17 17:45:30 2008][15174] <after>   - memory used by objects after collection (KB)
    [memory ][Mon Mar 17 17:45:30 2008][15174] <heap>    - size of heap after collection (KB)
    [memory ][Mon Mar 17 17:45:30 2008][15174] <pause>   - total sum of pauses during collection (milliseconds)
    [memory ][Mon Mar 17 17:45:30 2008][15174]             run with -Xverbose:gcpause to see individual pauses
    [memdbg ][Mon Mar 17 17:45:30 2008][15174] Using prefetch linesize: 16 bytes  chunks: 512 bytes pf_dist: 128 bytes
    [gcpause][Mon Mar 17 18:17:38 2008][15174] Thread "Dispatcher-Thread-19" id=79 idx=0x138 tid=78 was in object alloc 3524.102 ms from 1924.890 s
    [memdbg ][Mon Mar 17 18:17:38 2008][15174] GC reason: Large object allocation failed (7057136 bytes), cause: Alloc Queue
    [memdbg ][Mon Mar 17 18:17:38 2008][15174] Stopping of javathreads took 19.615 ms
    [memdbg ][Mon Mar 17 18:17:38 2008][15174] old collection 181 started
    [memdbg ][Mon Mar 17 18:17:38 2008][15174] Alloc Queue size before GC: 7057136, tlas: 0, oldest: 0
    [memdbg ][Mon Mar 17 18:17:38 2008][15174] Compacting 8 heap parts at index 24 (type external) (exceptional false)
    [compact][Mon Mar 17 18:17:38 2008][15174] OC 181: 8 parts (max 512), index 24. Type external, (exceptional false)
    [compact][Mon Mar 17 18:17:38 2008][15174] Area start: 0x5b00000, end: 0x6b00000
    [memdbg ][Mon Mar 17 18:17:38 2008][15174] Starting initial marking phase (OC1).
    [nursery][Mon Mar 17 18:17:38 2008][15174] KeepAreaStart: 0x150a5378 KeepAreaEnd: 0x1aeb8918
    [nursery][Mon Mar 17 18:17:38 2008][15174] Young collection started. This YC is a part of OC#181 initial marking.
    [nursery][Mon Mar 17 18:17:38 2008][15174] Setting mmNurseryMarker[0] to 0xf803880
    [nursery][Mon Mar 17 18:17:38 2008][15174] Setting mmNurseryMarker[1] to 0x150a5378
    [memdbg ][Mon Mar 17 18:17:38 2008][15174] Initial marking phase promoted 2 objects (0K)
    [gcpause][Mon Mar 17 18:17:38 2008][15174] old collection phase 1 pause time: 124.798376 ms, (start time: 1928.495 s)
    [memdbg ][Mon Mar 17 18:17:38 2008][15174] Restarting of javathreads took 0.643 ms
    [memdbg ][Mon Mar 17 18:17:38 2008][15174] Starting concurrent marking phase (OC2).
    [memdbg ][Mon Mar 17 18:17:41 2008][15174] Starting precleaning phase (OC3).
    [memdbg ][Mon Mar 17 18:17:41 2008][15174] Stopping of javathreads took 19.442 ms
    [memdbg ][Mon Mar 17 18:17:41 2008][15174] Starting final marking phase (OC4).
    [nursery][Mon Mar 17 18:17:41 2008][15174] KeepAreaStart: 0x0 KeepAreaEnd: 0x0
    [nursery][Mon Mar 17 18:17:41 2008][15174] Young collection started. This YC is a part of OC#181 final marking.
    [memdbg ][Mon Mar 17 18:17:41 2008][15174] Final marking phase promoted 75597 objects (2829K)
    [memdbg ][Mon Mar 17 18:17:41 2008][15174] Removing 20 permanent work packets from pool, now 376 packets
    [memdbg ][Mon Mar 17 18:17:41 2008][15174] total concurrent mark time: 3261.573 ms
    [memdbg ][Mon Mar 17 18:17:41 2008][15174] ending marking phase
    [memdbg ][Mon Mar 17 18:17:41 2008][15174] current error: -236.220931
    [memdbg ][Mon Mar 17 18:17:41 2008][15174] Requesting to run parallel sweep since Alloc Queue is non-empty.
    [memdbg ][Mon Mar 17 18:17:41 2008][15174] Will use parallel sweep instead of concurrent sweep due to request.
    [memdbg ][Mon Mar 17 18:17:41 2008][15174] starting parallel sweeping phase
    [compact][Mon Mar 17 18:17:41 2008][15174] Evacuation added 1473472 bytes to the freelist
    [compact][Mon Mar 17 18:17:41 2008][15174] Evacuation added 318008 bytes to the freelist
    [compact][Mon Mar 17 18:17:41 2008][15174] Evacuation added 60896 bytes to the freelist
    [compact][Mon Mar 17 18:17:41 2008][15174] Evacuation added 129984 bytes to the freelist
    [compact][Mon Mar 17 18:17:41 2008][15174] Evacuation added 1230896 bytes to the freelist
    [compact][Mon Mar 17 18:17:41 2008][15174] Evacuation added 1881216 bytes to the freelist
    [compact][Mon Mar 17 18:17:41 2008][15174] Evacuation added 262360 bytes to the freelist
    [compact][Mon Mar 17 18:17:41 2008][15174] Evacuation added 1293112 bytes to the freelist
    [compact][Mon Mar 17 18:17:41 2008][15174] Evacuation added 1031088 bytes to the freelist
    [compact][Mon Mar 17 18:17:41 2008][15174] Evacuation added 3392344 bytes to the freelist
    [compact][Mon Mar 17 18:17:41 2008][15174] Evacuation added 520800 bytes to the freelist
    [compact][Mon Mar 17 18:17:41 2008][15174] Evacuation added 94160 bytes to the freelist
    [compact][Mon Mar 17 18:17:41 2008][15174] Evacuation added 391624 bytes to the freelist
    [compact][Mon Mar 17 18:17:41 2008][15174] Evacuation added 2152 bytes to the freelist
    [compact][Mon Mar 17 18:17:41 2008][15174] Evacuation added 13144 bytes to the freelist
    [compact][Mon Mar 17 18:17:41 2008][15174] Evacuation added 1560688 bytes to the freelist
    [compact][Mon Mar 17 18:17:41 2008][15174] Evacuation added 3968 bytes to the freelist
    [compact][Mon Mar 17 18:17:41 2008][15174] Evacuation added 280952 bytes to the freelist
    [compact][Mon Mar 17 18:17:41 2008][15174] Evacuation added 232952 bytes to the freelist
    [compact][Mon Mar 17 18:17:41 2008][15174] Evacuation added 838880 bytes to the freelist
    [compact][Mon Mar 17 18:17:41 2008][15174] Evacuation added 142616 bytes to the freelist
    [compact][Mon Mar 17 18:17:41 2008][15174] Evacuation added 18656 bytes to the freelist
    [compact][Mon Mar 17 18:17:41 2008][15174] Evacuation added 103312 bytes to the freelist
    [compact][Mon Mar 17 18:17:41 2008][15174] Evacuation added 35496 bytes to the freelist
    [compact][Mon Mar 17 18:17:41 2008][15174] Evacuation added 374760 bytes to the freelist
    [compact][Mon Mar 17 18:17:41 2008][15174] Evacuation added 4216 bytes to the freelist
    [compact][Mon Mar 17 18:17:41 2008][15174] Evacuation added 1081256 bytes to the freelist
    [compact][Mon Mar 17 18:17:41 2008][15174] Evacuation found 9621 objects and moved 9587 objects
    [memdbg ][Mon Mar 17 18:17:41 2008][15174] total sweep time: 57.433 ms
    [memdbg ][Mon Mar 17 18:17:41 2008][15174] ending sweeping phase
    [nursery][Mon Mar 17 18:17:41 2008][15174] Setting mmNurseryMarker[0] to 0xf77a8c8
    [nursery][Mon Mar 17 18:17:41 2008][15174] Setting mmNurseryMarker[1] to 0x1501a790
    [nursery][Mon Mar 17 18:17:41 2008][15174] Nursery size increased from 0kb to 327680kb. Parts: 1177
    [gcpause][Mon Mar 17 18:17:41 2008][15174] Threads waited for memory 3398.495 ms starting at 1928.426 s
    [memdbg ][Mon Mar 17 18:17:41 2008][15174] Alloc Queue size after GC: 7057136, tlas: 0, oldest: 1
    [compact][Mon Mar 17 18:17:41 2008][15174] Average compact time ratio: 0.953058
    [compact][Mon Mar 17 18:17:41 2008][15174] Compaction pause: 36.552 (target 127.074), update ref pause: 2.080 (target 6.259)
    [compact][Mon Mar 17 18:17:41 2008][15174] Updated 16423 refs (limit: 54054).
    [compact][Mon Mar 17 18:17:41 2008][15174] Compaction ended at index 31, object end address 0x69f8058.
    [compact][Mon Mar 17 18:17:41 2008][15174] Summary: 181;24;31;8;2;0;36.552;127.074;2.080;6.259;16423;54054
    [compact][Mon Mar 17 18:17:41 2008][15174] External default parts to compact set to 16
    [compact][Mon Mar 17 18:17:41 2008][15174] Compaction too short, increasing compact ratio.
    [memdbg ][Mon Mar 17 18:17:41 2008][15174] gc-trigger is 12.339 %
    [memdbg ][Mon Mar 17 18:17:41 2008][15174] Nursery size after OC: 335544320
    [gcpause][Mon Mar 17 18:17:41 2008][15174] old collection phase 4-0 pause time: 250.697868 ms, (start time: 1931.576 s)
    [gcpause][Mon Mar 17 18:17:41 2008][15174] (pause includes compaction: 36.552 ms (external), update ref: 2.080 ms)
    [memory ][Mon Mar 17 18:17:41 2008][15174] 1928.495-1931.826: GC 169061K->164649K (1048576K), sum of pauses 375.496 ms
    [memdbg ][Mon Mar 17 18:17:41 2008][15174] Page faults before GC: 4527, page faults after GC: 4527, pages in heap: 131072
    [finaliz][Mon Mar 17 18:17:41 2008][15174] (OC) Pending finalizers 0->2
    [memdbg ][Mon Mar 17 18:17:41 2008][15174] Restarting of javathreads took 0.726 ms
    [memdbg ][Mon Mar 17 18:17:41 2008][15174] GC reason: Large object allocation failed (7057136 bytes), cause: Alloc Queue
    [memdbg ][Mon Mar 17 18:17:41 2008][15174] Stopping of javathreads took 19.403 ms
    [memdbg ][Mon Mar 17 18:17:41 2008][15174] old collection 182 started
    [memdbg ][Mon Mar 17 18:17:41 2008][15174] Alloc Queue size before GC: 7057136, tlas: 0, oldest: 1
    [memdbg ][Mon Mar 17 18:17:41 2008][15174] Exceptional compaction at end of heap ordered. Requesting to run parallel sweep.
    [memdbg ][Mon Mar 17 18:17:41 2008][15174] Compacting 16 heap parts at index 496 (type external) (exceptional true)
    [compact][Mon Mar 17 18:17:41 2008][15174] OC 182: 16 parts (max 512), index 496. Type external, (exceptional true)
    [compact][Mon Mar 17 18:17:41 2008][15174] Area start: 0x40b00000, end: 0x42b00000
    [memdbg ][Mon Mar 17 18:17:41 2008][15174] Starting initial marking phase (OC1).
    [nursery][Mon Mar 17 18:17:41 2008][15174] KeepAreaStart: 0x1501a790 KeepAreaEnd: 0x1aabc2d0
    [nursery][Mon Mar 17 18:17:41 2008][15174] Young collection started. This YC is a part of OC#182 initial marking.
    [nursery][Mon Mar 17 18:17:41 2008][15174] Setting mmNurseryMarker[0] to 0xf77a8c8
    [nursery][Mon Mar 17 18:17:41 2008][15174] Setting mmNurseryMarker[1] to 0x1501a790
    [memdbg ][Mon Mar 17 18:17:41 2008][15174] Initial marking phase promoted 2351 objects (94K)
    [gcpause][Mon Mar 17 18:17:41 2008][15174] old collection phase 1 pause time: 126.584439 ms, (start time: 1931.874 s)
    [memdbg ][Mon Mar 17 18:17:41 2008][15174] Restarting of javathreads took 0.547 ms
    [memdbg ][Mon Mar 17 18:17:41 2008][15174] Starting concurrent marking phase (OC2).
    [compact][Mon Mar 17 18:17:42 2008][15174] Pointermatrix for thread '(GC Main Thread)' failed to extend beyond 43378 elements.
    [memdbg ][Mon Mar 17 18:17:42 2008][15174] Too many pointers, compaction aborted
    [memdbg ][Mon Mar 17 18:17:44 2008][15174] Starting precleaning phase (OC3).
    [memdbg ][Mon Mar 17 18:17:44 2008][15174] Stopping of javathreads took 19.425 ms
    [memdbg ][Mon Mar 17 18:17:44 2008][15174] Starting final marking phase (OC4).
    [nursery][Mon Mar 17 18:17:44 2008][15174] KeepAreaStart: 0x0 KeepAreaEnd: 0x0
    [nursery][Mon Mar 17 18:17:44 2008][15174] Young collection started. This YC is a part of OC#182 final marking.
    [memdbg ][Mon Mar 17 18:17:44 2008][15174] Final marking phase promoted 72379 objects (2561K)
    [memdbg ][Mon Mar 17 18:17:44 2008][15174] Removing 19 permanent work packets from pool, now 357 packets
    [memdbg ][Mon Mar 17 18:17:44 2008][15174] total concurrent mark time: 3161.521 ms
    [memdbg ][Mon Mar 17 18:17:44 2008][15174] ending marking phase
    [memdbg ][Mon Mar 17 18:17:44 2008][15174] current error: -175.496244
    [memdbg ][Mon Mar 17 18:17:44 2008][15174] Requesting to run parallel sweep since Alloc Queue is non-empty.
    [memdbg ][Mon Mar 17 18:17:44 2008][15174] Will use parallel sweep instead of concurrent sweep due to request.
    [memdbg ][Mon Mar 17 18:17:44 2008][15174] starting parallel sweeping phase
    [memdbg ][Mon Mar 17 18:17:44 2008][15174] total sweep time: 18.785 ms
    [memdbg ][Mon Mar 17 18:17:44 2008][15174] ending sweeping phase
    [nursery][Mon Mar 17 18:17:44 2008][15174] Setting mmNurseryMarker[0] to 0xf77aa98
    [nursery][Mon Mar 17 18:17:44 2008][15174] Setting mmNurseryMarker[1] to 0x14e0c8f0
    [nursery][Mon Mar 17 18:17:44 2008][15174] Nursery size increased from 0kb to 327680kb. Parts: 1263
    [memdbg ][Mon Mar 17 18:17:44 2008][15174] Alloc Queue size after GC: 7057136, tlas: 0, oldest: 2
    [compact][Mon Mar 17 18:17:44 2008][15174] Compaction pause: 0.000 (target 127.074), update ref pause: 0.000 (target 6.259)
    [compact][Mon Mar 17 18:17:44 2008][15174] Updated 43378 refs (limit: 54054).
    [compact][Mon Mar 17 18:17:44 2008][15174] Compaction ended at index 31, object end address 0x69f8058.
    [compact][Mon Mar 17 18:17:44 2008][15174] Summary: 182;24;31;16;0;1;0.000;127.074;0.000;6.259;43378;54054
    [compact][Mon Mar 17 18:17:44 2008][15174] Exceptional compaction size requested by allocator, not adjusting compact ratio.
    [memdbg ][Mon Mar 17 18:17:44 2008][15174] gc-trigger is 12.339 %
    [memdbg ][Mon Mar 17 18:17:44 2008][15174] Nursery size after OC: 335544320
    [gcpause][Mon Mar 17 18:17:44 2008][15174] old collection phase 4-0 pause time: 235.501725 ms, (start time: 1934.832 s)
    [gcpause][Mon Mar 17 18:17:44 2008][15174] (pause includes compaction: 0.000 ms (no compaction), update ref: 0.000 ms)
    [memory ][Mon Mar 17 18:17:44 2008][15174] 1931.874-1935.068: GC 168649K->163056K (1048576K), sum of pauses 362.086 ms
    [memdbg ][Mon Mar 17 18:17:44 2008][15174] Page faults before GC: 4527, page faults after GC: 4527, pages in heap: 131072
    [finaliz][Mon Mar 17 18:17:44 2008][15174] (OC) Pending finalizers 0->2
    [memdbg ][Mon Mar 17 18:17:44 2008][15174] Restarting of javathreads took 0.667 ms
    [memdbg ][Mon Mar 17 18:17:44 2008][15174] GC reason: Large object allocation failed (7057136 bytes), cause: Alloc Queue
    [memdbg ][Mon Mar 17 18:17:44 2008][15174] Stopping of javathreads took 20.308 ms
    [memdbg ][Mon Mar 17 18:17:44 2008][15174] old collection 183 started
    [memdbg ][Mon Mar 17 18:17:44 2008][15174] Alloc Queue size before GC: 7057136, tlas: 0, oldest: 2
    [memdbg ][Mon Mar 17 18:17:44 2008][15174] Compacting 512 heap parts at index 0 (type internal) (exceptional true)
    [compact][Mon Mar 17 18:17:44 2008][15174] OC 183: 512 parts (max 512), index 0. Type internal, (exceptional true)
    [compact][Mon Mar 17 18:17:44 2008][15174] Area start: 0x2b00000, end: 0x42b00000
    [memdbg ][Mon Mar 17 18:17:44 2008][15174] Starting initial marking phase (OC1).
    [nursery][Mon Mar 17 18:17:44 2008][15174] KeepAreaStart: 0x14e0c8f0 KeepAreaEnd: 0x1a85bc48
    [nursery][Mon Mar 17 18:17:44 2008][15174] Young collection started. This YC is a part of OC#183 initial marking.
    [nursery][Mon Mar 17 18:17:44 2008][15174] Setting mmNurseryMarker[0] to 0xf77aa98
    [nursery][Mon Mar 17 18:17:44 2008][15174] Setting mmNurseryMarker[1] to 0x14e0c8f0
    [memdbg ][Mon Mar 17 18:17:44 2008][15174] Initial marking phase promoted 632 objects (18K)
    [gcpause][Mon Mar 17 18:17:44 2008][15174] old collection phase 1 pause time: 133.589550 ms, (start time: 1935.151 s)
    [memdbg ][Mon Mar 17 18:17:44 2008][15174] Restarting of javathreads took 0.465 ms
    [memdbg ][Mon Mar 17 18:17:44 2008][15174] Starting concurrent marking phase (OC2).
    [memdbg ][Mon Mar 17 18:17:48 2008][15174] Starting precleaning phase (OC3).
    [memdbg ][Mon Mar 17 18:17:48 2008][15174] Stopping of javathreads took 19.590 ms
    [memdbg ][Mon Mar 17 18:17:48 2008][15174] Starting final marking phase (OC4).
    [nursery][Mon Mar 17 18:17:48 2008][15174] KeepAreaStart: 0x0 KeepAreaEnd: 0x0
    [nursery][Mon Mar 17 18:17:48 2008][15174] Young collection started. This YC is a part of OC#183 final marking.
    [compact][Mon Mar 17 18:17:48 2008][15174] Pointermatrix for thread '(GC Worker Thread 3)' failed to extend beyond 25391 elements.
    [memdbg ][Mon Mar 17 18:17:48 2008][15174] Too many pointers, compaction aborted
    [memdbg ][Mon Mar 17 18:17:49 2008][15174] Final marking phase promoted 126119 objects (4396K)
    [memdbg ][Mon Mar 17 18:17:49 2008][15174] Removing 18 permanent work packets from pool, now 339 packets
    [memdbg ][Mon Mar 17 18:17:49 2008][15174] total concurrent mark time: 4378.189 ms
    [memdbg ][Mon Mar 17 18:17:49 2008][15174] ending marking phase
    [memdbg ][Mon Mar 17 18:17:49 2008][15174] current error: -162.086164
    [memdbg ][Mon Mar 17 18:17:49 2008][15174] Requesting to run parallel sweep since Alloc Queue is non-empty.
    [memdbg ][Mon Mar 17 18:17:49 2008][15174] Will use parallel sweep instead of concurrent sweep due to request.
    [memdbg ][Mon Mar 17 18:17:49 2008][15174] starting parallel sweeping phase
    [memdbg ][Mon Mar 17 18:17:49 2008][15174] total sweep time: 18.297 ms
    [memdbg ][Mon Mar 17 18:17:49 2008][15174] ending sweeping phase
    [nursery][Mon Mar 17 18:17:49 2008][15174] Setting mmNurseryMarker[0] to 0xf75c4e8
    [nursery][Mon Mar 17 18:17:49 2008][15174] Setting mmNurseryMarker[1] to 0x14dd6788
    [nursery][Mon Mar 17 18:17:49 2008][15174] Nursery size increased from 0kb to 327680kb. Parts: 1307
    [memdbg ][Mon Mar 17 18:17:49 2008][15174] Alloc Queue size after GC: 0, tlas: 0, oldest: 0
    [compact][Mon Mar 17 18:17:49 2008][15174] Compaction pause: 0.000 (target 127.074), update ref pause: 0.000 (target 6.259)
    [compact][Mon Mar 17 18:17:49 2008][15174] Updated 55716 refs: 0 inside compaction area, and 55716 outside (limit: 54054).
    [compact][Mon Mar 17 18:17:49 2008][15174] Compaction ended at index 31, object end address 0x69f8058.
    [compact][Mon Mar 17 18:17:49 2008][15174] Summary: 183;24;31;512;0;1;0.000;127.074;0.000;6.259;55716;54054
    [compact][Mon Mar 17 18:17:49 2008][15174] Exceptional compaction size requested by allocator, not adjusting compact ratio.
    [memdbg ][Mon Mar 17 18:17:49 2008][15174] gc-trigger is 12.339 %
    [memdbg ][Mon Mar 17 18:17:49 2008][15174] Nursery size after OC: 335544320
    [gcpause][Mon Mar 17 18:17:49 2008][15174] old collection phase 4-0 pause time: 301.755262 ms, (start time: 1939.257 s)
    [gcpause][Mon Mar 17 18:17:49 2008][15174] (pause includes compaction: 0.000 ms (no compaction), update ref: 0.000 ms)
    [memory ][Mon Mar 17 18:17:49 2008][15174] 1935.151-1939.559: GC 226936K->166214K (1048576K), sum of pauses 435.345 ms
    [memdbg ][Mon Mar 17 18:17:49 2008][15174] Page faults before GC: 4527, page faults after GC: 4529, pages in heap: 131072
    [finaliz][Mon Mar 17 18:17:49 2008][15174] (OC) Pending finalizers 0->24
    [memdbg ][Mon Mar 17 18:17:49 2008][15174] Restarting of javathreads took 0.928 ms
    [gcpause][Mon Mar 17 18:17:49 2008][15174] Thread "Dispatcher-Thread-19" id=79 idx=0x138 tid=78 was in object alloc 11134.471 ms from 1928.426 s
    [memory ][Mon Mar 17 18:17:49 2008][15174] Throwing OutOfMemory: allocLargeObjectOrArray - Object size: 7057136, Num elements: 3528560Why was the thread "Dispatcher-Thread-19" not able to allocate 7057136 bytes within 11134.471 ms?
    Cheers,
    Torsten

    Is it expected by your application to create StringBuilders with more than 3 million characters in them?Yes. Our application (which runs happily for years now on Sun's JVM) is producing and consuming large data streams (mostly XML). So a StringBuilder producing a string of 3 million characters ist very common. Some XML data streams consumed from database clobs have up to 10 million characters. As I said, with Sun's JVM we have no problems with fragmentation or aborted compactions with a similar sized heap (-server -Xms1g -Xmx1g -Xmn256m -XX:MaxPermSize=256m -XX:SurvivorRatio=8 -XX:TargetSurvivorRatio=95 -XX:MaxTenuringThreshold=31 -XX:+UseParNewGC -XX:ParallelGCThreads=4 -XX:-BindGCTaskThreadsToCPUs -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:+DisableExplicitGC).
    Cheers,
    Torsten

  • How do you free memory when applet ends?

    I have an applet that uses 4 jframes. Any of the frames are set to call both stop() and destroy() whenever user clicks "Exit" or "X" in upper right corner of a frame.
    The applet destroy() method does the following:
    myAOS32001Frame = null;
    myAOS32002Frame = null;
    myAOS32003Frame = null;
    myAOS32004Frame = null;
    myMemoryChangeThread.stop();
    try {
    URL endedURL = new URL(this.getCodeBase(), "AOS320acEnded.html");
    this.getAppletContext().showDocument(endedURL);
    } // try
    catch (MalformedURLException urlexc) {
    urlexc.printStackTrace();
    } // catch
    This doesn't free up any memory at all. Only when the user closes the browser altogether does the memory free up.
    Do I have to set EVERY object (those within frames) to null? How do I set the main applet object (the JApplet class instance) to null (not just its child frames)? Should the garbage collector be run one last time? In what order should all these things occur?
    If every object needs to be set to null, anybody have a nice tidbit of code that loops through array of components (and properties) or something and sets them to null?
    Thanks.

    Thank you both for the tips. They were helpful.
    Now my mission is to make the applet as small as possible. It appears the base JVM occupies about 18MB of memory initially, and then my applet uses 12MB more (at times), and the JVM "reserves" about 10MB more.
    The only part under my control is the 12MB, it appears, and I'd be interested in general tips to make that as small as possible (maybe by using certain variable types instead of ones currently used, etc.). But I'll ask that in a different thread.

  • How to free up resources when working with MOVIES ??

    Hi.
    I work with movies lots and they slow my whole system down so much. Is there anyway to solve this, such as offloading the video and its processing to another laptop or something? Sometimes, just moving back or forward one bar takes 10 secs as the movie is SO cpu intensive. . .
    Thanks, Ben

    Ben,
    have your editor export a smaller, compressed QT file, and have her/him worry about how long it takes to compress - that's not your job. Put it on an external drive, open logic and import the video file. Don't save the QT file in your Logic folder, which hopefully is on your recording drive and not your system drive. I don't record or stream anything from my system drive.
    In other words, record your project on an audio / recording drive, stream your QT file from an external and have your samples on a third drive (I realize this is kind'a tricky with G5, but you'll figure it out). Grand total: four drives and everthing works great.
    I hope that helps.
    Good luck,
    H.

Maybe you are looking for

  • Save Data in ALV Report .

    Hello, Given below is my code *& Report  ZALV_TEST_SA                                                * REPORT  ZALV_TEST_SA NO STANDARD PAGE HEADING. *----------------------TYPE POOL OF ALV--------------------------------* TYPE-POOLS: SLIS. *--------

  • Value mapping with some return values

    Hi Experts,     I  am facing value mapping problem. My requirment was My source elemnet having 4 value mapping(Key and Values)  and also if not passing that 4 keys also it will  display same thing in my reciver.     Can Anybody please suggest me how

  • Some field details in my alv report

    Sales Org > only one selection field Division > only one selection field Channel > from u2013 to fields Sales Office Channel > from u2013 to fields Sales Rep Channel > from u2013 to fields User ID of the CSR Channel > from u2013 to fields Customer Ch

  • How do I delete apps on iCloud?

    I want to erase the apps from iCloud.

  • Audition CS6 hangs on startup.

    I have seen solutions in the past for this and wonder with the CC upgrade due out today if the problem will be solved. MacPro Intel, latest ML and CS6, did a nice project in PPCS^ and sent it to Audtion CS6. Multitrack, fixed all the audio that neede