You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Marco Pöhler <li...@poehlerpoehler.de> on 2004/03/21 13:53:54 UTC
java.lang.OutOfMemoryError
Hi,
I'm running tomcat 5.0.19 & J2SDK1.4.2_03 on a suse linux 8.1. I wrote a
really simple application, just one servlet and a few jsp pages, using
dbcp/jndi. Nevertheless I got an OutOfMemoryError every 2 days and I have to
restart the tomcat to fix the problem. Here is the log entry:
2004-03-21 10:41:04 StandardWrapperValve[mapperServlet]: Servlet.service()
for servlet mapperServlet threw exception
java.lang.OutOfMemoryError
Okay, I've investigated my source code for some kind of memory leak, but
without any success. How can I found what the problem is ? Are there tools
which can help me ?
thanks in advance
Marco Poehler
---
http://www.poehlerpoehler.de
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: java.lang.OutOfMemoryError
Posted by Joerg Baumgaertel <jb...@jb2works.com>.
Forgot to mention that I have a lot of stuff
about Memory Leaks generally online:
FAQ
http://jb2works.com/memoryleak/index.html
and
Why do we have a Data Cancer
The Top Five to avoid it
http://jb2works.com/memoryleak/topfive.html
Best regards,
Joerg
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: java.lang.OutOfMemoryError
Posted by Joerg Baumgaertel <jb...@jb2works.com>.
Hi Marco
Give 'The Reference Scanner' a try and make heap snapshots
and check the diff between snapshots.
I just published the tomcat-howto.
You find the Software here http://jb2works.com/
If you need more help, you reach me via mail.
Best regards,
Joerg
Marco Pöhler wrote:
> Hi,
>
> I'm running tomcat 5.0.19 & J2SDK1.4.2_03 on a suse linux 8.1. I wrote a
> really simple application, just one servlet and a few jsp pages, using
> dbcp/jndi. Nevertheless I got an OutOfMemoryError every 2 days and I have to
> restart the tomcat to fix the problem. Here is the log entry:
>
> 2004-03-21 10:41:04 StandardWrapperValve[mapperServlet]: Servlet.service()
> for servlet mapperServlet threw exception
> java.lang.OutOfMemoryError
>
> Okay, I've investigated my source code for some kind of memory leak, but
> without any success. How can I found what the problem is ? Are there tools
> which can help me ?
>
> thanks in advance
>
> Marco Poehler
>
> ---
> http://www.poehlerpoehler.de
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: java.lang.OutOfMemoryError
Posted by Joseph Shraibman <jk...@selectacast.net>.
Sounds like the same memory leak problem I've been having. The problem
is when new threads are created to handle concurrent connections.
Marco Pöhler wrote:
> Hi,
>
> I'm running tomcat 5.0.19 & J2SDK1.4.2_03 on a suse linux 8.1. I wrote a
> really simple application, just one servlet and a few jsp pages, using
> dbcp/jndi. Nevertheless I got an OutOfMemoryError every 2 days and I have to
> restart the tomcat to fix the problem. Here is the log entry:
>
> 2004-03-21 10:41:04 StandardWrapperValve[mapperServlet]: Servlet.service()
> for servlet mapperServlet threw exception
> java.lang.OutOfMemoryError
>
> Okay, I've investigated my source code for some kind of memory leak, but
> without any success. How can I found what the problem is ? Are there tools
> which can help me ?
>
> thanks in advance
>
> Marco Poehler
>
> ---
> http://www.poehlerpoehler.de
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
SV: method="post" but doGet() called
Posted by Uwe Kubosch <do...@crusaders.no>.
> When Tomcat sees a request for 'http://localhost:8080/mycontext' it sends
> back a response to redirect to
> 'http://localhost:8080/mycontext/'. This is
> so that relative links to things like images and stylesheets work
> correctly.
> If the browser conformed to the HTTP/1.1 RFC, it would re-request the new
> URL with a POST, but I don't know of any browsers that do this.
Thank's a million. So I shouldn't spend more time trying to fix it? Rather
I should add the trailing "/" myself to avoid the redirect?
donV
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
RE: method="post" but doGet() called -> external redirects
Posted by Liviu Ionescu <il...@livius.net>.
> When Tomcat sees a request for
> 'http://localhost:8080/mycontext' it sends back a response to
> redirect to 'http://localhost:8080/mycontext/'. This is so
> that relative links to things like images and stylesheets
> work correctly. If the browser conformed to the HTTP/1.1 RFC,
> it would re-request the new URL with a POST, but I don't know
> of any browsers that do this.
would it be possible to add a configuration parameter to certain contexts so
that the external redirects are replaced by internal forwardings?
I have a m2m application where the clients are not browsers, but simple
dedicated devices that do not implement redirects, and their standard way of
accessing the server is .../mycontext?x=a, so without a trailing '/'.
Since I could not find a url rewrite mechanism, like in Apache, I had to use
a dirty trick, I renamed my context to mycontext-app and I wrote a servlet
in the root context to forward requests from "/mycontext" to
"/mycontext-app/" (beware that .forward() is usually called in the current
context, if another context is needed it should be retrieved first)
having the rewrite done directly by Tomcat (is the DefaultServlet handling
this?) would be a more appropriate solution, imho.
regards,
Liviu
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: method="post" but doGet() called
Posted by Bill Barker <wb...@wilshire.com>.
When Tomcat sees a request for 'http://localhost:8080/mycontext' it sends
back a response to redirect to 'http://localhost:8080/mycontext/'. This is
so that relative links to things like images and stylesheets work correctly.
If the browser conformed to the HTTP/1.1 RFC, it would re-request the new
URL with a POST, but I don't know of any browsers that do this.
"Uwe Kubosch" <do...@crusaders.no> wrote in message
news:CHECLDNPGHELOIINBBLECEOKGJAA.donv@crusaders.no...
> Hi all!
>
> I have a form (included below) where I set method="post", but for for a
> specific action URL, it arrived in the doGet method instead of the doPost
> method.
>
> I have a seervlet-mapping that pics up _all_ resquests to the context:
>
> <url-pattern>/</url-pattern>
>
> The unexpected behaviour comes when there is nothing after the context in
> the action URL:
>
> http://localhost:8080/mycontext
>
> This arrives in doGet.
>
> Putting something after the context works:
>
> http://localhost:8080/mycontext/stuff
>
> This arrives in doPost.
>
> Is this correct behaviour? I am using Opera as browser. Should this make
a
> difference?
>
>
> <html>
> <head>
> <title>Access Denied</title>
> </head>
> <body>
> <h1 align=center>Access denied!</h1>
> <div align="center">
>
>
>
> </div>
> <!-- Begin BOX 'Login'-->
> <table border="2" align="center" width="1"><tr><td align="left">
> <div align="left">
> <h3>Login</h3>
> </div>
>
> <div align="center" border="1" width="1">
> <form name="loginForm" method="post" enctype="multipart/form-data"
> action="http://localhost:8080/espresso">
> <input type="hidden" name="formObjectID" value="-4">
> <input type="hidden" name="tab" value="General">
> <input type="hidden" name="defcmd" value="Login">
> <table cellspacing="0" cellpadding="0">
> <tr><td class="EspressoLogin">Login</td><td><input class="EspressoLogin"
> type="text" name="EspressoUID" value="root" size="10"></td>
> <tr><td class="EspressoLogin">Password</td><td><input
class="EspressoLogin"
> type="password" name="EspressoPWD" value="" size="10"
> nonChange='document.loginForm.submit()'></td>
> <tr><td colspan="2" align="center" nowrap><input class="EspressoLogin"
> type="submit" name="cmd" value="Login">
> </td>
> </tr></table></form><script type="text/JavaScript">if
> (document.loginForm.EspressoUID.value.length == 0)
> {document.loginForm.EspressoUID.focus();} else
> {document.loginForm.EspressoPWD.focus();}</script>
> </div></td></tr></table><!-- End BOX -->
> </body>
> </html>
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
AW: java.lang.OutOfMemoryError
Posted by Marco Pöhler <li...@poehlerpoehler.de>.
Hi Neal,
I increased the JVM Memory with -Xmx300m - that seem to work. I checked the
heap status using the manager application and the memory usage after 2 days
is now up to 90 MB. But the growth has stopped. That seem to work.
Thanks !
Marco
---
http://www.lenses-price-comparison.com
http://www.optik-preisvergleich.de
> -----Ursprüngliche Nachricht-----
> Von: Neal [mailto:nealcabage@yahoo.com]
> Gesendet: Sonntag, 21. März 2004 21:33
> An: 'Tomcat Users List'
> Betreff: RE: java.lang.OutOfMemoryError
>
>
> I was having a similar problem with a similar configuration but was
> having to restart every day. For some reason the exact same JDK/tomcat
> install on my windows dev box performed just fine under stress testing
> and reclaimed memory just fine whereas my Linux production box had
> serious issues. I increased the memory from the default 64mb to 128mb
> on my linux server and now it is behaving just as the prod server does -
> its reclaiming memory in a similar healthy pattern. So, just try
> increasing the heap size to 128mb first and see if you're still having
> the same issue. It seems to work some magic.
>
> Cheers.
> Neal
>
> -----Original Message-----
> From: Marco Pöhler [mailto:lists@poehlerpoehler.de]
> Sent: Sunday, March 21, 2004 4:54 AM
> To: tomcat-user
> Subject: java.lang.OutOfMemoryError
>
> Hi,
>
> I'm running tomcat 5.0.19 & J2SDK1.4.2_03 on a suse linux 8.1. I wrote a
> really simple application, just one servlet and a few jsp pages, using
> dbcp/jndi. Nevertheless I got an OutOfMemoryError every 2 days and I
> have to
> restart the tomcat to fix the problem. Here is the log entry:
>
> 2004-03-21 10:41:04 StandardWrapperValve[mapperServlet]:
> Servlet.service()
> for servlet mapperServlet threw exception
> java.lang.OutOfMemoryError
>
> Okay, I've investigated my source code for some kind of memory leak, but
> without any success. How can I found what the problem is ? Are there
> tools
> which can help me ?
>
> thanks in advance
>
> Marco Poehler
>
> ---
> http://www.poehlerpoehler.de
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
RE: java.lang.OutOfMemoryError
Posted by Neal <ne...@yahoo.com>.
I was having a similar problem with a similar configuration but was
having to restart every day. For some reason the exact same JDK/tomcat
install on my windows dev box performed just fine under stress testing
and reclaimed memory just fine whereas my Linux production box had
serious issues. I increased the memory from the default 64mb to 128mb
on my linux server and now it is behaving just as the prod server does -
its reclaiming memory in a similar healthy pattern. So, just try
increasing the heap size to 128mb first and see if you're still having
the same issue. It seems to work some magic.
Cheers.
Neal
-----Original Message-----
From: Marco Pöhler [mailto:lists@poehlerpoehler.de]
Sent: Sunday, March 21, 2004 4:54 AM
To: tomcat-user
Subject: java.lang.OutOfMemoryError
Hi,
I'm running tomcat 5.0.19 & J2SDK1.4.2_03 on a suse linux 8.1. I wrote a
really simple application, just one servlet and a few jsp pages, using
dbcp/jndi. Nevertheless I got an OutOfMemoryError every 2 days and I
have to
restart the tomcat to fix the problem. Here is the log entry:
2004-03-21 10:41:04 StandardWrapperValve[mapperServlet]:
Servlet.service()
for servlet mapperServlet threw exception
java.lang.OutOfMemoryError
Okay, I've investigated my source code for some kind of memory leak, but
without any success. How can I found what the problem is ? Are there
tools
which can help me ?
thanks in advance
Marco Poehler
---
http://www.poehlerpoehler.de
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: java.lang.OutOfMemoryError
Posted by Jacob Kjome <ho...@visi.com>.
How much information do you put in servlet sessions? How long do sessions
last? How many active user sessions do you have at any given time? Do you
start the VM up without providing -Xmx512m or something like that? If so,
you are starting a VM with a maximum of 64meg of memory available to
everything running within it. That includes the appserver itself plus any
apps. It is easy to use more than this, especially if your load is high
and/or you store lots of info in the sessions. Keep in mind that a little
bit of data in the session can go a long way if you have lots of
users. Less than 1meg per/user plus, let's say, 64 users with active
sessions (not necessarily making concurrent requests) would easily use up
the default memory maximum of the VM.
Jake
At 01:53 PM 3/21/2004 +0100, you wrote:
>Hi,
>
>I'm running tomcat 5.0.19 & J2SDK1.4.2_03 on a suse linux 8.1. I wrote a
>really simple application, just one servlet and a few jsp pages, using
>dbcp/jndi. Nevertheless I got an OutOfMemoryError every 2 days and I have to
>restart the tomcat to fix the problem. Here is the log entry:
>
>2004-03-21 10:41:04 StandardWrapperValve[mapperServlet]: Servlet.service()
>for servlet mapperServlet threw exception
>java.lang.OutOfMemoryError
>
>Okay, I've investigated my source code for some kind of memory leak, but
>without any success. How can I found what the problem is ? Are there tools
>which can help me ?
>
>thanks in advance
>
>Marco Poehler
>
>---
>http://www.poehlerpoehler.de
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
method="post" but doGet() called
Posted by Uwe Kubosch <do...@crusaders.no>.
Hi all!
I have a form (included below) where I set method="post", but for for a
specific action URL, it arrived in the doGet method instead of the doPost
method.
I have a seervlet-mapping that pics up _all_ resquests to the context:
<url-pattern>/</url-pattern>
The unexpected behaviour comes when there is nothing after the context in
the action URL:
http://localhost:8080/mycontext
This arrives in doGet.
Putting something after the context works:
http://localhost:8080/mycontext/stuff
This arrives in doPost.
Is this correct behaviour? I am using Opera as browser. Should this make a
difference?
<html>
<head>
<title>Access Denied</title>
</head>
<body>
<h1 align=center>Access denied!</h1>
<div align="center">
</div>
<!-- Begin BOX 'Login'-->
<table border="2" align="center" width="1"><tr><td align="left">
<div align="left">
<h3>Login</h3>
</div>
<div align="center" border="1" width="1">
<form name="loginForm" method="post" enctype="multipart/form-data"
action="http://localhost:8080/espresso">
<input type="hidden" name="formObjectID" value="-4">
<input type="hidden" name="tab" value="General">
<input type="hidden" name="defcmd" value="Login">
<table cellspacing="0" cellpadding="0">
<tr><td class="EspressoLogin">Login</td><td><input class="EspressoLogin"
type="text" name="EspressoUID" value="root" size="10"></td>
<tr><td class="EspressoLogin">Password</td><td><input class="EspressoLogin"
type="password" name="EspressoPWD" value="" size="10"
nonChange='document.loginForm.submit()'></td>
<tr><td colspan="2" align="center" nowrap><input class="EspressoLogin"
type="submit" name="cmd" value="Login">
</td>
</tr></table></form><script type="text/JavaScript">if
(document.loginForm.EspressoUID.value.length == 0)
{document.loginForm.EspressoUID.focus();} else
{document.loginForm.EspressoPWD.focus();}</script>
</div></td></tr></table><!-- End BOX -->
</body>
</html>
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org