Results 1 to 2 of 2
  1. #1
    mame is offline Member
    Join Date
    Jan 2011
    Rep Power

    Unhappy screen captured image@client save@Server BufferedImage OutOfMemoryError:JavaHeapSpace

    I have client server program that the client send a screen captured image continuously to the server warping the BufferedImage to ImageIcon and then the client will read the ImageIcon and save it to a file via ImageIO.write using BufferedImage. Now the problem is for ever received image a new BufferedImage will be created in the while loop, after 6 fream there will be “OutOfMemoryError: Java heap space” error even if I increase the memory allocation for the project it wont work for more than 30 image.
    Any help is appreciated.

    Code snip where error occur
    ImageIcon imageIcon = (ImageIcon) objectInputStream.readObject();
    BufferedImage buffered = new BufferedImage(

    On each loop a new BufferedImage will be created and I don’t think the previous is freed from memory? So is there a manual freeing method like C++? Or just let it crash ever 6 frame…

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Madgaon, Goa, India
    Rep Power

Similar Threads

  1. Replies: 1
    Last Post: 01-27-2011, 09:08 AM
  2. Server socket - send image to client
    By Hinty in forum Networking
    Replies: 2
    Last Post: 03-14-2009, 08:39 AM
  3. Save a jpg image on server
    By yadavjpr in forum Java Servlet
    Replies: 1
    Last Post: 11-21-2008, 02:49 PM
  4. Replies: 0
    Last Post: 08-13-2008, 10:46 PM
  5. Replies: 13
    Last Post: 04-28-2008, 09:57 AM

Tags for this Thread

Posting Permissions

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