----- Original Message -----
From: "DIGLLOYD INC" <[EMAIL PROTECTED]>
To: "Tomcat Users List" <users@tomcat.apache.org>
Sent: Friday, September 26, 2008 8:07 PM
Subject: Re: tomcat won't download large files -- out of memory error
Thanks to multiple people responding to this!
My site diglloyd.com serves almost entirely static content, with many
large JPEG files.
I have set:
CATALINA_OPTS=-Xmx1024M
That's limiting the JVM to 1GB of memory. And in tomcat/conf/ context.xml,
I set:
<Context cacheMaxSize="1500000" cacheTTL="60000" cachingAllowed="true" >
Therein presumably lies the problem. I'll change CATALINA_OPTS to be 2GB
or so and retry.
Mark, it would be helpful to be able to say "don't cache anything larger
the N kilobytes/megabytes". I'd probably use a setting of 2MB or so for
that.
Lloyd
Ah I see what you up to... memory management is trick... theres a tool
called VisualGC that you may be able to get running on Apple, just for
interest sake.
The memory management is quite complex and is split into aging heaps... so
you dont really get that clump of memory, its pro rata'd out...
There are advanced settings if you read up on it... but you also need to see
it... to see what the JRE is actually up to...
Thats just of interest... but u into serious media so maybe you should try
something like this...
Make a servlet, read the files from disk yourself.... its not hard...
something like this... but google for more
http://greatwebguy.com/programming/java/java-image-resizer-servlet/
can also do interesting stuff like this
http://greatwebguy.com/programming/java/java-image-resizer-servlet/
So its pretty cool having your own servlet...
but heres what you can try and it will give you alot of control...
Map the servlet to say.... *.jpg
So... that means your servlet overrides the Default servlet
but now do this...
.... look at that size of the file... if its huge... you do it... and send
it...
if its "normal static content"... forward it to the Default servlet...
Its a kind of filter... and it will give you the ability to use TC's caching
and that very smart default servlet... or bypass it...
I think something like that will give you all the control you need...
It seems on Apple you dont really have too many choices when it comes to
JRE's... the machine model is more or less going to determine when you on 64
bit...
... but I think you can play a little and make it work efficiently anyway...
possibly just letting thumb nails cache... and you can control the browser
side caching to the nth degree as well.... by making a fronting servlet
.... maybe... have fun ;)
---------------------------------------------------------------------------
HARBOR : http://www.kewlstuff.co.za/index.htm
The most powerful application server on earth.
The only real POJO Application Server.
See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm
---------------------------------------------------------------------------
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]