Results 1 to 3 of 3
  1. #1
    mr_empty is offline Member
    Join Date
    Mar 2008
    Posts
    15
    Rep Power
    0

    Default free memory of bufferedimage problem

    hi all,

    i have the following code.

    BufferedImage img=new BufferedImage(29342,450,BufferedImage.TYPE_INT_RGB );

    Graphics2D g2d=img.createGraphics();
    g2d.drawImage(r.getAsBufferedImage(), 0, 0, null);
    g2d.finalize();
    g2d.dispose();

    img.flush();
    img=null;

    but i cannot free img object all uts memory since i know there is the reference to it, but for this problem how to solve it? thanks.

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    25

    Default

    Cross-posted: Java 2D - free memory of bufferedimage problem

    mr empty: cross-posting can frustrate anyone who tries to help you only to find out later that the same answer was given hours ago in a cross-posted thread. No one likes wasting their time, especially a volunteer. The polite thing to do would be to not do this, but if you feel that you absolutely must, to at least provide links in both cross-posts to each other.
    __________________

  3. #3
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    25

    Default

    This is one argument for using variables in the most restricted scope possible. I'm not sure what else you are looking for here.

    Oh, and please look at my signature regarding code tags here (and elsewhere).

Similar Threads

  1. image processing memory problem
    By mr_empty in forum Java 2D
    Replies: 7
    Last Post: 12-16-2009, 11:03 AM
  2. Memory leakage problem
    By sankarguru in forum Advanced Java
    Replies: 3
    Last Post: 03-26-2009, 08:52 PM
  3. Replies: 2
    Last Post: 08-21-2008, 07:33 PM
  4. Memory leakage problem
    By Amali_Prem in forum New To Java
    Replies: 0
    Last Post: 01-17-2008, 10:45 AM
  5. How Can I get free memory ?
    By sathish_2111 in forum Networking
    Replies: 2
    Last Post: 07-19-2007, 04:29 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •