• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

image manipulation

 
Dieter Merlin
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have some code to create thumbnails of pictures anddisplay them on a site.
The problem is that we run into an outofmemoryerror every 2 weeks or so. (heap size = 512mb)

The average picture size is +- 1 MB

Here is the current code;





I know that the ImageIcon(byte[] data).getImage() holds a reference to the data but using Toolkit.createImage fails to work (black image)
and using ImageIO.read() doesnt help with the OOM either.

Avoiding the BAOS and writing the thumb directly to the ServletOutputStream causes 100% cpu usage and prevents the picture to be loaded.

I'm a little desperate on this since I cant find anything usefull that would help.

Thanks in advance
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64620
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As the servlet API has no means of image manipulation, this has been moved to the AWT forum.
 
Dieter Merlin
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry, its just because we do it from a servlet in a jboss container that I thought it should be there, that it could have a meaning to it
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic