This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes image manipulation Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply Bookmark "image manipulation" Watch "image manipulation" New topic
Author

image manipulation

Dieter Merlin
Greenhorn

Joined: Oct 25, 2005
Posts: 9
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

Joined: Jan 10, 2002
Posts: 56531
    
  14

As the servlet API has no means of image manipulation, this has been moved to the AWT forum.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Dieter Merlin
Greenhorn

Joined: Oct 25, 2005
Posts: 9
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
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: image manipulation
 
Similar Threads
image resizing
Thumbnail
java.awt.Toolkit in linux
Calling of a PHP file in JSP
Thumbnail