tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <>
Subject Re: storing images
Date Wed, 11 May 2011 19:05:30 GMT
Hash: SHA1


On 5/6/2011 10:52 AM, alexis wrote:
> I understand, but i have top 12 images of 35kbytes, no more.

Fair enough.

> Encoding load is an issue yes, but the images are reflecting
> callcenters call queues and some stuff related so the need to refresh
> and rebuild the images is a requirement.

You might consider going all the way down to the byte-level encoding and
store the raw bytes of the JPEG or PNG that you want to use. You didn't
say what you were doing, but it's certainly possible to store a
java.awt.Image in memory and re-encode it for every request. You may as
well encode it once and serve the bytes directly with those requests.

> What im thinking is to avoid the generation upon servlet calls
> (servlet only reads and presents the image to callers) and start a
> different thread with a listener in charge to periodically rebuild
> images.

I think you're better-off doing lazy up-to-date checking, but that's
just me... it depends on what your requirements truly are. I always hate
having background threads running in a webapp.

> Do you believe regarding memory it can cause a big issue? In worst
> case it's 450kbytes when all images are created and stored.

Just be sure to test your caching algorithm and make sure the purge is
working you expect. Image data can take up memory in a hurry if you have
a bug in there.

- -chris
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla -


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message