tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "alexis" <>
Subject Re: storing images
Date Fri, 06 May 2011 14:52:50 GMT
I understand, but i have top 12 images of 35kbytes, no more.

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. 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.

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

Enviado desde blackberry

-----Original Message-----
From: Christopher Schultz <>
Date: Fri, 06 May 2011 09:48:45 
To: Tomcat Users List<>
Reply-To: "Tomcat Users List" <>
Subject: Re: storing images

Hash: SHA1


On 5/5/2011 8:19 PM, alexis wrote:
> Im storing the images as servletcontext attribute.

Uh... in memory? That's a bad idea IMO for two reasons:

1. Large memory requirements

2. Likely repeated encoding into a file format like JPEG, PNG, etc.

If you store the files on the disk, you can stream them as often as
you'd like. If you get a request for an image that already exists, you
can serve it up, otherwise, you can create it.

You can even create a hash of lock objects or something so that you can
"lock" the file as it's being written so that the file is only written
once even if multiple clients are requesting it.

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


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

View raw message