> When I start Apache up, about 18MB of memory is used.  Then as I run
> servlets (which I presume is then being loaded into memory), the memory
> usage increases to about 50MB.  Then as I recompile and reload the servlets,
> the memory usage keeps on going up until its starts paging out to swap
> disks.  The paging activity becomes quite intense and it doesn't seem as
> though any memory is being released.
> 


Can you break down the memory usage by process?  Is it the Apache httpds
using all of the memory, or is it the java interpreter process?


> I am assuming that this is because the Garbage Collector doesn't kick in.
> Therefore the following 2 questions:
> 
> 1.  Since this would affect performance, should I be concerned, or is it
> normal?
> 


I usually end up getting OutOfMemoryErrors whenever I do something crazy
with memory.  Does it just keep paging, or does the VM ever give up and
start throwing Exceptions?



> 2.  Is there a way to tell the Garbage Collector that it should start
> operating when memory usage reaches 70 or 80 MB?  I recall having read
> somewhere that one can tell the JVM how much the upper memory limit should
> be.  I can't remember where I saw it.
> 

You can use the -ms and -mx command line arguments to specify how large
the java interpreter heap size should be at startup and at maximum,
respectively.  You can pass these to JServ by adding:

ServletBinaryBargument -mx32m

to the httpd.conf file.  This sets the max heap size to 32MB.  Are you
doing anything fishy when you start up the JVM right now that would
affect the way garbage collection?  Command line args like -noasyncgc
and -noclassgc can affect the way that the garbage collector will
function.  In you code, you can use:

System.gc ( )

to synchronously run the garbage collector.  You might try this in a
servlet and look at the results.  Whenever I have memory problems with
my servlets, I use something like:

Runtime::freeMemory ( )
and
Runtime::totalMemory ( )

inside of a threaded servlet to watch the memory status of the system
over time.

Hope this can be of some help...



Dan

-- 
_________________________________________________________
Dan Cornell                           Phone: 210.805.8607
Atension,Inc.                           Fax: 210.805.8517
112 E. Pecan, Suite 750         <http://www.atension.com>
San Antonio, TX  78205                 <[EMAIL PROTECTED]>
_________________________________________________________


-- --------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
READ THE FAQ!!!!     <http://java.apache.org/faq/>
Archives and Other:  <http://java.apache.org/main/mail.html/>
Problems?:           [EMAIL PROTECTED]

Reply via email to