Hi Steve,

The real decision you need to make is how common are the "common parts" of
your JSPs, and how much content is within the JSPs.

If most of your JSPs are simply blocks of content surrounded by the same
"boiler plate" JSP code, then perhaps it is worth while to make those JSPs a
single JSP that then loads the different content at runtime based upon the
request.

But the real consideration is simply the amount of content that you're
delivering within the JSPs.

Consider this: If you have 500 JSP's that each have 20K of text (which is
quite a bit of text if you think about it), then that's only 20MB of memory
for the content. The calculation is 500 files x 20,000 characters x 2 for
unicode (unicode characters, which Java uses, are 2 bytes).

So, using brute force, back-of-napkin calculations, 512MB of memory would
store 25000 of those documents.

Also, if your document count is mostly static from day to day, i.e. you
aren't adding large numbers of new documents each day, then you can easily
pre-compute your overall memory burden simply for the documents, and scale
appropriately.

So, I doubt the JSPs alone are causing your memory problems, it's probably
something else.

Hope this was helpful,

Regards,

Will Hartung
([EMAIL PROTECTED])


----- Original Message -----
From: "Turoff, Steve" <[EMAIL PROTECTED]>
To: "Will Hartung" <[EMAIL PROTECTED]>
Sent: Tuesday, January 14, 2003 10:07 AM
Subject: RE: Memory Usage and Garbage Collection


Will,

I too am experiencing memory problems and I think your explanation below
might apply to me. I'm using Tomcat 4.1 on RedHat Linux. Over the course of
a few days, I notice, (using top) that the amount of physical memory used by
the java processes continually increases until it exceeds the maximum that
I've set (-Xmx512m) and then will generate an java.lang.OutOfMemoryError in
$CATALINA_HOME/logs/localhost_log.YYYY-MM-DD.txt. I believe the problem is
that my JSPs are dynamic, but I'm not sure exactly what differentiates a
static JSP from a dynamic JSP.




--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to