You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Bang, Steinar" <St...@tandbergtv.com> on 2001/10/25 10:31:54 UTC

Re: Questions on tomcat heap usage and garbage collection (avoidi ng OutOfMemoryError exceptions)

Craig R. McClanahan [mailto:craigmcc@apache.org] writes:

> The most important task in a situation like this is
> to find out why memory is being consumed in the first
> place.  Generally, this is caused by one of the
> following types of factors:

> * Creating lots and lots of session attributes in your
>   applications (which causes the objects to stay
>   allocated until the session times out or is
>   invalidated)

Ah, OK.  That probably accounts for the increase
in size I see in the processes.

> * Creating a new session on every request from your
>   stress test tool, which causes a new session object
>   to be created each time.

Yes, this is probably what happens.

> The latter case is pretty insidious for doing stress 
> testings, because JSP pages are session-aware by
> default (unless you tell them not to).  This
> behavior is not typical of real users, howevever,
> because they will be returning the same session id
> (and therefore accessing the same session)
> throughout their interaction with the server.

> You should investigate whether httperf (or other
> tool) can let you remember the session id that was
> assigned in the first place and then reuse it on the
> subsequent requests,

It looks like the --session-cookie and --wsess arguments
to httperf may be doing what you suggest.  And using
this argument may give a more realistic test (I'm
running one right now).

But it doesn't address my real worry at the moment:
that a script kiddie armed with nothing more than
the httperf testing tool can bring my tomcat to 
crash.

> and/or whether your test JSP page can temporarily be
> set to not use sessions so that this doesn't happen.

Hm... yes, but our actual application (not the test
page I've done the current tests on), will be Struts
based, and I don't think Struts will work without
sessions...?

Thanx!


- Steinar























This email, its content and any attachments is PRIVATE AND CONFIDENTIAL to
TANDBERG Television. If received in error please notify the sender and
destroy the original message and attachments.