I have experienced this problem on many occasions.  I have increased the
memory that jrun starts with to 200Mb with the -ms200M parameter.  This has
greatly reduced the frequency of when the garbage collector runs which seems
to have helped (or masked) the problem for now.

My servlets are quite simple in nature and do not allocate memory outside of
the doGet() routine.  While I have not checked the code with any tool
(waiting for OptimizeIt to come out on the DEC platform (long wait ahead))
static analysis does not show where memory is allocated on a per thread
basis that would generate static references.  Thus all memory should all be
cleared up upon the thread exiting, but it appears that that was not
happening when starting with the default heap size.

I wrote the following innerclass and added it to my servlet.

    class checkGC
    {
        public checkGC()
        {
            j = ii++;
        }

        public void finalize()
        {
            System.out.println("I've been collected --> " + j);
        }
        private long j;
    }

and added a static variable ii to the servlet.

Declare a new checkGC at the start of your doGet or doPost.  This will allow
you to see when the garbage collector is executed.

Good luck.

-- Gary

> -----Original Message-----
> From: A mailing list for discussion about Sun Microsystem's Java Servlet
> API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of Kevin
> Mukhar
> Sent: Monday, July 17, 2000 2:31 PM
> To: [EMAIL PROTECTED]
> Subject: Re: JRUN
>
>
> "Chankapure, Nagsen" wrote:
> >
> > I m  experiencing run away Jrun process frequently. And the
> problem is that
> > JRun is hung because of OutOfMemoryError and eating up 95% of CPU. What
> > options do I have for resolving this problem.  This has been an urgent
> > production problem  for some time now and I need to get it
> resolved.  Any
> > advice would be greatly appreciated.
>
> The best solution would be to determine why the OutOfMemoryError
> occurs, and fix
> that problem. If you have a tool that can show memory usage in
> your classes, use
> that to determine which objects are using all the memory. If you
> don't have a
> tool, put try-catch blocks around the code to catch the
> OutOfMemoryError. Once
> you've determined the cause of the memory consumption,
> re-engineer your classes
> to use less memory.
>
> K Mukhar
>
> __________________________________________________________________
> _________
> To unsubscribe, send email to [EMAIL PROTECTED] and include
> in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to