Re: Exception in thread ""http-bio-8080"-exec-9" java.lang.OutOfMemoryError: Java heap space
By the way, in addition to the details below, you may want to also indicate with what Heap size you are running Tomcat. I suppose that the IBM Heap analyser you are using would tell you that. Otherwise, if you are running Tomcat as a Windows Service, use the GUI application (tomcat7w.exe) to examine the Java JVM options tab. Note also that running out of Heap space does not necessarily mean that your classes have leaks. It can also mean that they are just using memory to a point where your allocated Heap space is simply not sufficient. Starting Tomcat with a Heap of 64M and starting 1000 request threads simultaneously would do it nicely also. Looking at the stack trace below, I find it unlikely that the code itself in org.apache.tomcat.util.http.FastHttpDateFormat.getCurrentDate , by itself, would use up the Heap. However, if by the time it is called, the Heap is already 99% full, it just might. André Warnier wrote: Well maybe then you should have posted that stack trace and the comments below to the list, and maybe someone would then have taken a closer look. I apologise (a little bit) for my original answer, but you must admit that with the information you posted before, it was hard to make the difference between that, and someone posting : "Tomcat doesn't work. Can you help ?" sunil.sheva...@wipro.com wrote: Hi Andre, I am not kidding. My application has only 8 to 10 classes. I checked the heap using IBM heap analyser and my objects are not leaking memory. I am guessing that this is a bug in tomcat 7. Let me know in case you can make any sense out of the trace. === Exception in thread ""http-bio-8080"-exec-12" java.lang.OutOfMemoryError: Java heap space at java.util.LinkedHashMap.createEntry(Unknown Source) at java.util.LinkedHashMap.addEntry(Unknown Source) at java.util.HashMap.put(Unknown Source) at sun.util.resources.OpenListResourceBundle.loadLookup(Unknown Source) at sun.util.resources.OpenListResourceBundle.loadLookupTablesIfNecessary(Unknown Source) at sun.util.resources.OpenListResourceBundle.handleGetObject(Unknown Source) at sun.util.resources.TimeZoneNamesBundle.handleGetObject(Unknown Source) at java.util.ResourceBundle.getObject(Unknown Source) at java.util.ResourceBundle.getObject(Unknown Source) at java.util.ResourceBundle.getStringArray(Unknown Source) at sun.util.TimeZoneNameUtility.retrieveDisplayNames(Unknown Source) at sun.util.TimeZoneNameUtility.retrieveDisplayNames(Unknown Source) at java.util.TimeZone.getDisplayNames(Unknown Source) at java.util.TimeZone.getDisplayName(Unknown Source) at java.text.SimpleDateFormat.subFormat(Unknown Source) at java.text.SimpleDateFormat.format(Unknown Source) at java.text.SimpleDateFormat.format(Unknown Source) at java.text.DateFormat.format(Unknown Source) at org.apache.tomcat.util.http.FastHttpDateFormat.getCurrentDate(FastHttpDateFormat.java:115) at org.apache.coyote.http11.AbstractHttp11Processor.prepareResponse(AbstractHttp11Processor.java:926) at org.apache.coyote.http11.AbstractHttp11Processor.action(AbstractHttp11Processor.java:739) at org.apache.coyote.Response.action(Response.java:170) at org.apache.coyote.Response.sendHeaders(Response.java:350) at org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:308) at org.apache.catalina.connector.OutputBuffer.close(OutputBuffer.java:275) at org.apache.catalina.connector.Response.finishResponse(Response.java:501) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:409) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:243) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:188) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:166) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:288) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) Exception in thread "ContainerBackgroundProcessor[StandardEngine[Catalina]]" java.lang.OutOfMemoryError: Java heap space at java.lang.reflect.Array.newArray(Native Method) at java.lang.reflect.Array.newInstance(Unknown Source) at java.util.AbstractCollection.toArray(Unknown Source) at org.apache.catalina.session.ManagerBase.findSessions(ManagerBase.java:705) at org.apache.catalina.session.ManagerBase.processExpires(ManagerBase.java:527) at org.apache.catalina.session.ManagerBase.backgroundProcess(ManagerBase.java:518) at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBa
RE: Exception in thread ""http-bio-8080"-exec-9" java.lang.OutOfMemoryError: Java heap space
> From: André Warnier [mailto:a...@ice-sa.com] > Subject: Re: Exception in thread ""http-bio-8080"-exec-9" > java.lang.OutOfMemoryError: Java heap space > I apologise (a little bit) for my original answer You shouldn't apologize; the OP has still not provided any useful information (just denial of responsibility), and has violated mailing list protocol by replying directly to you rather than to the list. He's nil-for-two at this point; how many wickets do we give him? - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Exception in thread ""http-bio-8080"-exec-9" java.lang.OutOfMemoryError: Java heap space
Well maybe then you should have posted that stack trace and the comments below to the list, and maybe someone would then have taken a closer look. I apologise (a little bit) for my original answer, but you must admit that with the information you posted before, it was hard to make the difference between that, and someone posting : "Tomcat doesn't work. Can you help ?" sunil.sheva...@wipro.com wrote: Hi Andre, I am not kidding. My application has only 8 to 10 classes. I checked the heap using IBM heap analyser and my objects are not leaking memory. I am guessing that this is a bug in tomcat 7. Let me know in case you can make any sense out of the trace. === Exception in thread ""http-bio-8080"-exec-12" java.lang.OutOfMemoryError: Java heap space at java.util.LinkedHashMap.createEntry(Unknown Source) at java.util.LinkedHashMap.addEntry(Unknown Source) at java.util.HashMap.put(Unknown Source) at sun.util.resources.OpenListResourceBundle.loadLookup(Unknown Source) at sun.util.resources.OpenListResourceBundle.loadLookupTablesIfNecessary(Unknown Source) at sun.util.resources.OpenListResourceBundle.handleGetObject(Unknown Source) at sun.util.resources.TimeZoneNamesBundle.handleGetObject(Unknown Source) at java.util.ResourceBundle.getObject(Unknown Source) at java.util.ResourceBundle.getObject(Unknown Source) at java.util.ResourceBundle.getStringArray(Unknown Source) at sun.util.TimeZoneNameUtility.retrieveDisplayNames(Unknown Source) at sun.util.TimeZoneNameUtility.retrieveDisplayNames(Unknown Source) at java.util.TimeZone.getDisplayNames(Unknown Source) at java.util.TimeZone.getDisplayName(Unknown Source) at java.text.SimpleDateFormat.subFormat(Unknown Source) at java.text.SimpleDateFormat.format(Unknown Source) at java.text.SimpleDateFormat.format(Unknown Source) at java.text.DateFormat.format(Unknown Source) at org.apache.tomcat.util.http.FastHttpDateFormat.getCurrentDate(FastHttpDateFormat.java:115) at org.apache.coyote.http11.AbstractHttp11Processor.prepareResponse(AbstractHttp11Processor.java:926) at org.apache.coyote.http11.AbstractHttp11Processor.action(AbstractHttp11Processor.java:739) at org.apache.coyote.Response.action(Response.java:170) at org.apache.coyote.Response.sendHeaders(Response.java:350) at org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:308) at org.apache.catalina.connector.OutputBuffer.close(OutputBuffer.java:275) at org.apache.catalina.connector.Response.finishResponse(Response.java:501) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:409) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:243) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:188) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:166) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:288) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) Exception in thread "ContainerBackgroundProcessor[StandardEngine[Catalina]]" java.lang.OutOfMemoryError: Java heap space at java.lang.reflect.Array.newArray(Native Method) at java.lang.reflect.Array.newInstance(Unknown Source) at java.util.AbstractCollection.toArray(Unknown Source) at org.apache.catalina.session.ManagerBase.findSessions(ManagerBase.java:705) at org.apache.catalina.session.ManagerBase.processExpires(ManagerBase.java:527) at org.apache.catalina.session.ManagerBase.backgroundProcess(ManagerBase.java:518) at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1214) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1393) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1403) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1403) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1382) at java.lang.Thread.run(Unknown Source) === Thanks, Sunil. -Original Message- From: André Warnier [mailto:a...@ice-sa.com] Sent: Monday, May 30, 2011 7:25 PM To: Tomcat Users List Subject: Re: Exception in thread ""http-bio-8080"-exec-9" java.lang.OutOfMemoryError: Java heap space You are kidding us, right ? But just in case you are not, what is the part which you do not understand in "j
Re: Exception in thread ""http-bio-8080"-exec-9" java.lang.OutOfMemoryError: Java heap space
You are kidding us, right ? But just in case you are not, what is the part which you do not understand in "java.lang.OutOfMemoryError: Java heap space". ? http://lmgtfy.com/?q=java.lang.OutOfMemoryError:%20Java%20heap%20space sunil.sheva...@wipro.com wrote: Hi, I am getting an error as follows "Exception in thread ""http-bio-8080"-exec-9" java.lang.OutOfMemoryError: Java heap space". I am running my jsp application on a windows machine with Tomcat 7.0.8 Any pointers? - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Exception in thread ""http-bio-8080"-exec-9" java.lang.OutOfMemoryError: Java heap space
Hi, I am getting an error as follows "Exception in thread ""http-bio-8080"-exec-9" java.lang.OutOfMemoryError: Java heap space". I am running my jsp application on a windows machine with Tomcat 7.0.8 Any pointers? Thanks in advance, Sunil. Please do not print this email unless it is absolutely necessary. The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com
tomcat 6.0.33?
Hi, while (true) { sleep(some weeks); askForTomcat(version + 1); } I know, I know. This question returns, now and then. But is there a possibility for the Tomcat developers to start a vote about 6.0.33? I would like to use it, because there are some bugs fixed, which I'm seeing. I read the archives of tomcat-dev, and didn't see any showstoppers for 6 yet. Or is there another reason not to make a release? Thanks in advance, if this is possible. Ronald.
Re: Weird problerm accessing request headers from tomcat
Hi Andre, see below. You are not going to hear me slapping my face, but definitely doing "a!" :-) Cheers Martin -- Martin Knoblauch email: k n o b i AT knobisoft DOT de www: http://www.knobisoft.de - Original Message > From: André Warnier > To: Tomcat Users List > Sent: Fri, May 27, 2011 6:01:28 PM > Subject: Re: Weird problerm accessing request headers from tomcat > > Hi. > > I believe that you are making the often-made confusion between "environment >values" (or variables), and HTTP headers content. > In particular, here : > seems you are right. > >> Apache1 inserts the following variables into the requests it forwards to >Apache1 (I suppose you meant Apache2 here) > > No. It does not do that. It adds some HTTP headers. This is different, see >below. > > . Apache1 (I suppose you meant Apache2 here) can see them, I have checked > that >using cgi-bin/printenv (some > >> values anonymized): > >> > >> HTTP_X_FORWARDED_FOR="aa.bb.cc.dd" > >> HTTP_X_FORWARDED_HOST="xxx.yyy.net" > >> HTTP_X_FORWARDED_PORT="443" > >> HTTP_X_FORWARDED_PROTOCOL="https" > >> HTTP_X_FORWARDED_SERVER="aaa.bbb.ccc" > >> > Your check does not show that at all. It shows something that is just >confusing enough to get you confused as to what you are seeing. ;-) > > But you have excuses for your confusion, because the Apache documentation >itself is very confusing as to "environment variables". > Indeed, the documentation leaves this pretty diffuse. > What the cgi-bin script sees, are indeed "environment values". > These are set by the Apache process (Apache2), just before it executes the >cgi-bin script. So the cgi-bin script sees them in its environment when it >runs. > (like with $ENV{'HTTP_X_FORWARDED_PORT'}) > > But there is no one-to-one relationship between what Apache finds in HTTP >request headers, and the environment values which it sets for the cgi-bin >scripts that it runs. > Apache does "convert" some of the request HTTP header values into cgi-bin >environment variables, but : > - the name of the environment variable may be different from the > corresponding >HTTP header label (you see this yourself above : a HTTP header named >"X-forwarded-for:" has been passed to the cgi-bin script as the environment >value named "HTTP_X_FORWARDED_FOR") > - not all HTTP headers are converted and passed that way > - some environment values passed to the cgi-bin script are not, and never >were, HTTP headers of the request (for example, the cgi-bin environment >values >"QUERY_STRING", or "SCRIPT_FILENAME") > Ok, that definitely explains what I am seeing. > On the other hand : > > When a HTTP proxy server forwards a HTTP request to another HTTP server via >the HTTP protocol, it forwards *all* the request headers and request content >to >this other server, as a HTTP request (otherwise, it would not be a valid HTTP >proxy server). But it cannot forward "environment values", because there is >no >defined way of doing this over the HTTP protocol. (*) > > > But now I see your second post, and your problem is in fact much simpler. > > By doing this : > h:outputText style="font: bold 14px sans-serif;" > > value="X_FORWARDED_HOST: #{header['X_FORWARDED_HOST']}" /> > > what you are actually trying to retrieve, is the content of the HTTP request > >header > "X_FORWARDED_HOST:" (I guess), but this HTTP header does not exist in the >request. > What you are giving as a HTTP header name, is actually what the cgi-bin >environment value name was for your cgi-bin. > Which, as I try to explain at long length above, is not the same thing. > > So you get back a null, and you think that the header was not there. > But it is there, only under its real HTTP header name. > Try something like >value="X_FORWARDED_HOST: #{header['X-Forwarded-for']}" />" > instead. > Yup, using "X-Forewarded-Host" works as expected. Thanks a big lot. > (Noise of self-slap on face ?). > As I said above: no self slapping. Just amazement on how much there is still to learn after all these years :-) > > > (*) However, when the proxy protocol used is AJP (as it is between Apache > and >Tomcat when using the mod_jk connector, or the mod_proxy_ajp connector), >/then/ >some additional values /can/ be passed along with the request (because the >AJP >protocol allows that). On the Tomcat side, these then appear as "request >attributes" which the webapp can retrieve (via request.getAttribute(name)), >but >not as "environment values" of the Tomcat process for example. > > - > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org > > - To unsubscribe, e-mail: users-unsu
Re: Monitoring memory usage of JVM
Hi all, I don't know if this is useful but apart from utilities/commands already mentioned, I use the following to monitor the GC of the particular generations in JVM: /usr/jdk/jdk1.5.0_12/bin/jstat -gc $TOMCAT_PID 5000 10 Of course you need to substitute the appropriate JDK installed on your system and the time interval the stats should be printed. Cheers, Igor On Fri, May 27, 2011 at 6:07 PM, Mikolaj Rydzewski wrote: > On Fri, 27 May 2011 09:50:06 +0200, André Warnier wrote: > > Searching the WWW, I am finding (too) many interpretations of the >> output of "-verbose:gc" (or "-verbosegc", none of them starting from >> exactly the format above. >> I can kind of guess what the above means, but where can I find an >> "authoritative" interpretation for Sun/Oracle Java 1.6 ? >> >> Also, does anyone know if there is a way to specify that instead of >> the unreadable leading timestamp above, one can get a nicely-formatted >> one ? >> (-XX:+PrintGCTimeStamps ?) >> > > I use the following options: > > -Xloggc:gc.log -XX:+PrintGCDetails -XX:+PrintGCTimeStamps > > We use nice tool from HP (HPJmeter) at work. It parses GC logfile and > produces various graphs. I guess you can download it for free from > www.hp.com/go/java > > -- > Mikolaj Rydzewski > > > - > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org > >