• Post Reply Bookmark Topic Watch Topic
  • New Topic

OutOfMemory exception while receiving image

 
naved momin
Ranch Hand
Posts: 692
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
while i was sending bufferedImage across network using socket' outputstream but i get OutOfMemory exception while receiving this bufferedimage code and the strange thing is , the exception is thrown just after receiving the first image
this is client side code for receiving bufferedimage


server code for sending image
timer invoke this method in every 40ms

i have also set the -Xms 1048m
 
Carey Brown
Bartender
Posts: 2239
27
Eclipse IDE Firefox Browser Java MySQL Database VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure how this is related to the OutOfMemoryException, but

public static BufferedImage read(ImageInputStream stream)
throws IOException

Returns a BufferedImage as the result of decoding a supplied ImageInputStream with an ImageReader chosen automatically from among those currently registered. If no registered ImageReader claims to be able to read the stream, null is returned.

Unlike most other methods in this class, this method does close the provided ImageInputStream after the read operation has completed, unless null is returned, in which case this method does not close the stream.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!