RE: Removing Ref to YourKit in TC

2012-06-11 Thread Casper Wandahl Schmidt
-Original Message-
From: André Warnier [mailto:a...@ice-sa.com] 
Sent: 10. juni 2012 22:51
To: Tomcat Users List
Subject: Re: Removing Ref to YourKit in TC

André Warnier wrote:
 Jerry Malcolm wrote:
 Thanks, Kostantin, for the pointer.  The fix was trivial.  Open 
 Regedit, search for the dll name which appeared in a Tomcat reg 
 entry, delete the line in the reg key.

 On Sun, Jun 10, 2012 at 1:17 PM, Jerry Malcolm
 2ndgenfi...@gmail.comwrote:

 Andre, I'm not yelling.  I'm looking for help.  telling me to 
 compare every file in the entire installation after downloading and 
 setting up a parallel environment is not exactly the type of 
 information I hoped to get from people that know the internal 
 structure of the program.  As a last resort, I could have figured 
 out to do that myself.  Yes, I installed it.
 And I need help fixing it.  Apparently, this is a 
 figure-it-out-yourself forum.
 
 Well, as you noticed, it isn't.
 But we like people to make a little effort by themselves too.  It's 
 more didactic that way..
 
 You have been told where the problem was, twice.
 And told what to do, twice.
 The two answers even almost matched.
 And all that for an issue that wasn't even strictly Tomcat-related.
 Any further complaints about the service ?
 ;-)


And I should have added that you got all that within a couple of hours of
posting, and on a Sunday afternoon. I find this not bad, for a
figure-it-out-yourself forum.

+1
Perhaps this question should never have been asked here, since it is not a
problem with tomcat but with the profiler not cleaning up after itself on
uninstall. You could have asked the developers of the profiler which
settings they add on install (and you should tell them to clean up properly
anyway so that the next guy doesn't need to do what you had to).

Med venlig hilsen/Kind regards
Casper/Kalle

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: EL Resolver throws InvocationTargetException (char-long conversation)

2012-06-11 Thread Konstantin Kolinko
2012/6/11 burghard.britzke b...@charmides.in-berlin.de:
 with tomcat 7.0.27, primefaces 3.3, myfaces 2.1.17, weld 1.1.8

 for the jsf-source
 Line 56: h:graphicImage
 Line 57:    value=/images/#{personenBean.aktuellePerson.geschlecht eq 'w' ? 
 'fe':''}male.png
 Line 58: /h:graphicImage

 and the bean
 public class Person implements Serializable {
        @Column(name = \geschlecht\, nullable = false, length = 1)
        private char geschlecht;
 ...

 an Exception is thrown

 java.lang.reflect.InvocationTargetException
 Caused by:br/javax.el.ELException - Cannot convert w of type class 
 java.lang.String to class java.lang.Long
 at org.apache.el.lang.ELSupport.coerceToNumber(ELSupport.java:304)
 personen.xhtml at line 57 and column 92    
 value=/images/#{personenBean.aktuellePerson.geschlecht eq 'w' ? 
 'fe':''}male.png

 At MyFaces Discussion us...@myfaces.apache.org they told me this would 
 probably be an issue with tomcat so I downgraded to Tomcat 7.0.25 and the 
 error disappeared.
 What are the next steps to get rid of this exception with Tomacat 7.0.27?


Yes, Tomcat behaviour changed and new behaviour follows the EL
specification more closely. It was because of this bug report:
https://issues.apache.org/bugzilla/show_bug.cgi?id=52666

See EL specification for more details.

According to EL 2.2 ch. 1.18.3 coercion from char to a number is performed as
If A is Character, convert A to new Short((short)a.charValue()) ...

so you have to s/'w'/119/.

There might be other workarounds, such as
a) Add another property to that bean that will return the value as String
b) Use a function such as fn:trim() from JSTL to force conversion of
that value into String.

Best regards,
Konstantin Kolinko

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: EL Resolver throws InvocationTargetException (char-long conversation)

2012-06-11 Thread burghard.britzke
Thank you!
your tip did it. I changed the property type to string because 119 is more 
ambigous than 'w' in this case.

Sincerly,
burghard.britzke

Am 11.06.2012 um 09:58 schrieb Konstantin Kolinko:

 2012/6/11 burghard.britzke b...@charmides.in-berlin.de:
 with tomcat 7.0.27, primefaces 3.3, myfaces 2.1.17, weld 1.1.8
 
 for the jsf-source
 Line 56: h:graphicImage
 Line 57:value=/images/#{personenBean.aktuellePerson.geschlecht eq 'w' ? 
 'fe':''}male.png
 Line 58: /h:graphicImage
 
 and the bean
 public class Person implements Serializable {
@Column(name = \geschlecht\, nullable = false, length = 1)
private char geschlecht;
 ...
 
 an Exception is thrown
 
 java.lang.reflect.InvocationTargetException
 Caused by:br/javax.el.ELException - Cannot convert w of type class 
 java.lang.String to class java.lang.Long
 at org.apache.el.lang.ELSupport.coerceToNumber(ELSupport.java:304)
 personen.xhtml at line 57 and column 92
 value=/images/#{personenBean.aktuellePerson.geschlecht eq 'w' ? 
 'fe':''}male.png
 
 At MyFaces Discussion us...@myfaces.apache.org they told me this would 
 probably be an issue with tomcat so I downgraded to Tomcat 7.0.25 and the 
 error disappeared.
 What are the next steps to get rid of this exception with Tomacat 7.0.27?
 
 
 Yes, Tomcat behaviour changed and new behaviour follows the EL
 specification more closely. It was because of this bug report:
 https://issues.apache.org/bugzilla/show_bug.cgi?id=52666
 
 See EL specification for more details.
 
 According to EL 2.2 ch. 1.18.3 coercion from char to a number is performed as
 If A is Character, convert A to new Short((short)a.charValue()) ...
 
 so you have to s/'w'/119/.
 
 There might be other workarounds, such as
 a) Add another property to that bean that will return the value as String
 b) Use a function such as fn:trim() from JSTL to force conversion of
 that value into String.
 
 Best regards,
 Konstantin Kolinko
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: EL Resolver throws InvocationTargetException (char-long conversation)

2012-06-11 Thread burghard.britzke
But it for in common the El-Resolver should be able to convert the 'w' into a 
java.lang.Long in this case.
May be this is an issue with Tomcat 7.0.27?
Should somebody (may be I) file this at https://issues.apache.org/ ?

Sincerly,
burghard.britzke

Am 11.06.2012 um 11:22 schrieb burghard.britzke:

 Thank you!
 your tip did it. I changed the property type to string because 119 is more 
 ambigous than 'w' in this case.
 
 Sincerly,
 burghard.britzke
 
 Am 11.06.2012 um 09:58 schrieb Konstantin Kolinko:
 
 2012/6/11 burghard.britzke b...@charmides.in-berlin.de:
 with tomcat 7.0.27, primefaces 3.3, myfaces 2.1.17, weld 1.1.8
 
 for the jsf-source
 Line 56: h:graphicImage
 Line 57:value=/images/#{personenBean.aktuellePerson.geschlecht eq 'w' 
 ? 'fe':''}male.png
 Line 58: /h:graphicImage
 
 and the bean
 public class Person implements Serializable {
   @Column(name = \geschlecht\, nullable = false, length = 1)
   private char geschlecht;
 ...
 
 an Exception is thrown
 
 java.lang.reflect.InvocationTargetException
 Caused by:br/javax.el.ELException - Cannot convert w of type class 
 java.lang.String to class java.lang.Long
 at org.apache.el.lang.ELSupport.coerceToNumber(ELSupport.java:304)
 personen.xhtml at line 57 and column 92
 value=/images/#{personenBean.aktuellePerson.geschlecht eq 'w' ? 
 'fe':''}male.png
 
 At MyFaces Discussion us...@myfaces.apache.org they told me this would 
 probably be an issue with tomcat so I downgraded to Tomcat 7.0.25 and the 
 error disappeared.
 What are the next steps to get rid of this exception with Tomacat 7.0.27?
 
 
 Yes, Tomcat behaviour changed and new behaviour follows the EL
 specification more closely. It was because of this bug report:
 https://issues.apache.org/bugzilla/show_bug.cgi?id=52666
 
 See EL specification for more details.
 
 According to EL 2.2 ch. 1.18.3 coercion from char to a number is performed as
 If A is Character, convert A to new Short((short)a.charValue()) ...
 
 so you have to s/'w'/119/.
 
 There might be other workarounds, such as
 a) Add another property to that bean that will return the value as String
 b) Use a function such as fn:trim() from JSTL to force conversion of
 that value into String.
 
 Best regards,
 Konstantin Kolinko
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: EL Resolver throws InvocationTargetException (char-long conversation)

2012-06-11 Thread Mark Thomas
On 11/06/2012 10:31, burghard.britzke wrote:
 But it for in common the El-Resolver should be able to convert the 'w' into a 
 java.lang.Long in this case.
 May be this is an issue with Tomcat 7.0.27?
 Should somebody (may be I) file this at https://issues.apache.org/ ?

No. There is no bug here. You need to read the EL specification more
carefully.

In EL, 'w' is not a char, but a String of length 1.

Mark

 
 Sincerly,
 burghard.britzke
 
 Am 11.06.2012 um 11:22 schrieb burghard.britzke:
 
 Thank you!
 your tip did it. I changed the property type to string because 119 is more 
 ambigous than 'w' in this case.

 Sincerly,
 burghard.britzke

 Am 11.06.2012 um 09:58 schrieb Konstantin Kolinko:

 2012/6/11 burghard.britzke b...@charmides.in-berlin.de:
 with tomcat 7.0.27, primefaces 3.3, myfaces 2.1.17, weld 1.1.8

 for the jsf-source
 Line 56: h:graphicImage
 Line 57:value=/images/#{personenBean.aktuellePerson.geschlecht eq 'w' 
 ? 'fe':''}male.png
 Line 58: /h:graphicImage

 and the bean
 public class Person implements Serializable {
   @Column(name = \geschlecht\, nullable = false, length = 1)
   private char geschlecht;
 ...

 an Exception is thrown

 java.lang.reflect.InvocationTargetException
 Caused by:br/javax.el.ELException - Cannot convert w of type class 
 java.lang.String to class java.lang.Long
 at org.apache.el.lang.ELSupport.coerceToNumber(ELSupport.java:304)
 personen.xhtml at line 57 and column 92
 value=/images/#{personenBean.aktuellePerson.geschlecht eq 'w' ? 
 'fe':''}male.png

 At MyFaces Discussion us...@myfaces.apache.org they told me this would 
 probably be an issue with tomcat so I downgraded to Tomcat 7.0.25 and the 
 error disappeared.
 What are the next steps to get rid of this exception with Tomacat 7.0.27?


 Yes, Tomcat behaviour changed and new behaviour follows the EL
 specification more closely. It was because of this bug report:
 https://issues.apache.org/bugzilla/show_bug.cgi?id=52666

 See EL specification for more details.

 According to EL 2.2 ch. 1.18.3 coercion from char to a number is performed 
 as
 If A is Character, convert A to new Short((short)a.charValue()) ...

 so you have to s/'w'/119/.

 There might be other workarounds, such as
 a) Add another property to that bean that will return the value as String
 b) Use a function such as fn:trim() from JSTL to force conversion of
 that value into String.

 Best regards,
 Konstantin Kolinko

 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org



 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org

 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Tomcat uses 99% of CPU - Something to do with AJP connector

2012-06-11 Thread Dharamshila Khandelwal
Hi,

I use a combination of tomcat (version 6.0.32) and apache (version 2.2.17)
connected by mod_proxy_ajp connector.
The website starts responding slow all of a sudden and I see that tomcat
process uses 99% of the CPU.
At the same time I see the following in apache error_log:

[Sun Jun 10 00:20:36 2012] [error] (70007)The timeout specified has
expired: ajp_ilink_receive() can't receive header
[Sun Jun 10 00:20:36 2012] [error] ajp_read_header: ajp_ilink_receive failed
[Sun Jun 10 00:20:36 2012] [error] (120006)APR does not understand this
error code: proxy: read response failed from 10.128.18.60:9393 (
roplws01.hsn.net)


I looked up for a solution on internet and it recommended me to set the
connectionTimeout property of AJP connector. Currently its set to default
which is eternity.

http://www.automationadventures.com/2009/03/30/tomcat-uses-100-of-cpu/

I can set the timeout, but I am not sure what will happen if AJP doesn't
receive the response within the given timeout period. Will it not serve
that given request?
Please let me know if anyone has any experience in AJP connector.

Thanks,
DS.


Re: Tomcat uses 99% of CPU - Something to do with AJP connector

2012-06-11 Thread Konstantin Kolinko
2012/6/11 Dharamshila Khandelwal dharmshil...@gmail.com:
 Hi,

 I use a combination of tomcat (version 6.0.32) and apache (version 2.2.17)
 connected by mod_proxy_ajp connector.
 The website starts responding slow all of a sudden and I see that tomcat
 process uses 99% of the CPU.
 At the same time I see the following in apache error_log:

 [Sun Jun 10 00:20:36 2012] [error] (70007)The timeout specified has
 expired: ajp_ilink_receive() can't receive header
 [Sun Jun 10 00:20:36 2012] [error] ajp_read_header: ajp_ilink_receive failed
 [Sun Jun 10 00:20:36 2012] [error] (120006)APR does not understand this
 error code: proxy: read response failed from 10.128.18.60:9393 (
 roplws01.hsn.net)


It might be anything.  You have to take a thread dump,  or better
several (3) dumps with small intervals between them to see what is
actually going on.

How to take the thread dumps is mentioned in the FAQ.

Any chance for upgrade to 6.0.35 or to Tomcat 7?

Best regards,
Konstantin Kolinko

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Java process killed by oom-killer in Ubuntu

2012-06-11 Thread Jorge Medina
I'm finding it hard to believe, but all points that the problem was
the -Xms option of the Oracle (Sun) JVM.
I originally set it to the same value as -Xmx, so that all memory for
the heap is allocated when the JVM starts.
This works fine in Solaris, but it is not working in Ubuntu.
After removing that option, the JVM process memory usage seems to keep stable.

I am using Sun JVM 1.6.0.26

-Jorge

On Thu, Jun 7, 2012 at 11:38 PM, Pid * p...@pidster.com wrote:
 On 7 Jun 2012, at 23:03, Daniel Mikusa dmik...@vmware.com wrote:

 - Original Message -
 Only 52 java threads.  It used to fluctuate more (we made some
 changes
 to the app to perform a task in a single thread rather than spawning
 multiple threads, but the crash still occurs) . The number of threads
 is always below 100.

 jstack -F 21370 | grep ^Thread | wc -l
 ps -T -p 21370   (This gives me 63)

 I don't seem to specify the -Xss option:

 In some applications with a large number of threads (particularly when 
 running on 64-bit hardware) this setting can cause a problems.  The default 
 value is pretty large (I think it's 1M on 64-bit systems).  Since most apps 
 don't need that large of a value, an easy performance tuning step is to 
 lower the value of -Xss.

 Since you don't have very many threads, it seems unlikely that this is 
 causing your problem though.

 That being said, you could try explicitly setting a value for the thread 
 stack size.  Finding the right values takes some testing though.  I usually 
 start with something like 192k and run a few application tests.  If I see 
 any stack overflow exceptions then I increase the value and rerun the tests. 
  Repeat until there are no stack overflow exceptions.


 On a different note, what is the specific version of the JVM that you are 
 running?  If it's not the latest, you could always try upgrading to the 
 latest version.

 You need to hook up the VisualVM + Memory Pools plugin.

 This will show you where the memory is being consumed, if it's by the JVM.


 p






 Xms6g -Xmx6g -XX:NewSize=4G -XX:MaxNewSize=4G -XX:SurvivorRatio=6
 -XX:MaxPermSize=512M -XX:-UseConcMarkSweepGC -XX:+UseStringCache
 -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/home/example/logs

 -Jorge






 On Thu, Jun 7, 2012 at 12:07 PM, Daniel Mikusa dmik...@vmware.com
 wrote:
 - Original Message -
 I am using MongoDB through the Java driver allowing up to 100
 connections to the MongoDB server.
 I also use DBCP with a max size of 50 JDBC connections.
 My webapp uses about 150 JAR files.
 There is no native libraries loaded from my webapp as far as I
 know.
 All the app is pure Java code.  (Nevertheless, Tomcat is using the
 Tomcat Native Library)

 Is there a way I can monitor the number of file descriptors in use
 by
 the app?

 I have monitored the number of threads, but I haven't seen
 anything
 unusual.

 How many threads have you observed?  Total threads, not just
 threads for the connector.

 Also, what is the value you are using for thread stack size?  -Xss

 Dan



 (but it could be that the burst is too fast to get catch by
 the monitoring tool)

 -Jorge







 On Thu, Jun 7, 2012 at 11:44 AM, Christopher Schultz
 ch...@christopherschultz.net wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Jorge,

 On 6/6/12 5:33 PM, Jorge Medina wrote:
 The web application uses Spring/Postgres/Mongo.

 Are you using MongoDB in-process or anything weird like that? Or
 are
 you connecting through some socket-based (or other) API?

 It looks like a memory leak in native code, not java code; so
 my
 usual java toolset is not useful.

 If what you are observing is accurate (non-heap memory grows,
 heap
 stays reasonable) then it will definitely be more difficult to
 track-down.

 Tomcat runs behind nginx in a EC2 instance. The application
 uses
 Sun (now Oracle) JDK 1.6.

 Any suggestions on what should I look at?

 What do your Connectors look like? How many JDBC connections
 do
 you
 have in your connection pool (which you are hopefully using!)?
 How
 about the same equivalent for MongoDB?

 Does your webapp keep lots of files open? Do you have an
 unusually-large number of JAR files in your webapp? Do you have
 any
 native libraries in use within your webapp?

 What are all the non-default system properties that you are
 setting
 at
 JVM launch time (you can easily see this from a 'ps' list)?

 Two things that can eat-up native memory fast in a JVM are file
 descriptors and threads, so let's start there.

 - -chris
 -BEGIN PGP SIGNATURE-
 Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
 Comment: GPGTools - http://gpgtools.org
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

 iEYEARECAAYFAk/Q9ooACgkQ9CaO5/Lv0PDPyQCfVtddxMDOgQbjmMGC3gvnK+Qq
 aZMAnjVu67+9Sm2bdYzAd91ZOrYo3DFI
 =r+vl
 -END PGP SIGNATURE-

 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: 

Re: Java process killed by oom-killer in Ubuntu

2012-06-11 Thread Jorge Medina
I found this interesting article about how Linux handles requests for
memory, look at section 9.6 Overcommit and OOM:
http://www.win.tue.nl/~aeb/linux/lk/lk-9.html
I verified that our system runs with overcommit_memory = 0 and
overcommit_ratio = 50. Which are the default values.

This post suggest to change these settings to 2 and 80 respectively, but
we may not be able to start any new processes if we run out of memory (and
therefore we may not be able to connect to the machine).
http://www.hskupin.info/2010/06/17/how-to-fix-the-oom-killer-crashe-under-l
inux/

Since we pre-allocate all the java heap memory (by setting -Xmx and -Xms
to the same value), we accelerate the OOM killing the process.

Therefore, the leak that is causing the problem just occur faster than if
we only set the max value of the heap with -Xmx.
Before I had made the recommendation to run with -Xmx and -Xms equal to
the same value, but I think this works well in Solaris but not in Linux.

Removing the -Xms option may give us just for more time between
the occurrences of running out of memory.

Nevertheless, I am finding that after removing the -Xms option, the
process memory usage stabilizes and stops growing.

-Jorge

On Mon, Jun 11, 2012 at 11:01 AM, Jorge Medina
cerebrotecnolog...@gmail.com wrote:
 I'm finding it hard to believe, but all points that the problem was
 the -Xms option of the Oracle (Sun) JVM.
 I originally set it to the same value as -Xmx, so that all memory for
 the heap is allocated when the JVM starts.
 This works fine in Solaris, but it is not working in Ubuntu.
 After removing that option, the JVM process memory usage seems to keep stable.

 I am using Sun JVM 1.6.0.26

 -Jorge

 On Thu, Jun 7, 2012 at 11:38 PM, Pid * p...@pidster.com wrote:
 On 7 Jun 2012, at 23:03, Daniel Mikusa dmik...@vmware.com wrote:

 - Original Message -
 Only 52 java threads.  It used to fluctuate more (we made some
 changes
 to the app to perform a task in a single thread rather than spawning
 multiple threads, but the crash still occurs) . The number of threads
 is always below 100.

 jstack -F 21370 | grep ^Thread | wc -l
 ps -T -p 21370   (This gives me 63)

 I don't seem to specify the -Xss option:

 In some applications with a large number of threads (particularly when 
 running on 64-bit hardware) this setting can cause a problems.  The default 
 value is pretty large (I think it's 1M on 64-bit systems).  Since most apps 
 don't need that large of a value, an easy performance tuning step is to 
 lower the value of -Xss.

 Since you don't have very many threads, it seems unlikely that this is 
 causing your problem though.

 That being said, you could try explicitly setting a value for the thread 
 stack size.  Finding the right values takes some testing though.  I usually 
 start with something like 192k and run a few application tests.  If I see 
 any stack overflow exceptions then I increase the value and rerun the 
 tests.  Repeat until there are no stack overflow exceptions.


 On a different note, what is the specific version of the JVM that you are 
 running?  If it's not the latest, you could always try upgrading to the 
 latest version.

 You need to hook up the VisualVM + Memory Pools plugin.

 This will show you where the memory is being consumed, if it's by the JVM.


 p






 Xms6g -Xmx6g -XX:NewSize=4G -XX:MaxNewSize=4G -XX:SurvivorRatio=6
 -XX:MaxPermSize=512M -XX:-UseConcMarkSweepGC -XX:+UseStringCache
 -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/home/example/logs

 -Jorge






 On Thu, Jun 7, 2012 at 12:07 PM, Daniel Mikusa dmik...@vmware.com
 wrote:
 - Original Message -
 I am using MongoDB through the Java driver allowing up to 100
 connections to the MongoDB server.
 I also use DBCP with a max size of 50 JDBC connections.
 My webapp uses about 150 JAR files.
 There is no native libraries loaded from my webapp as far as I
 know.
 All the app is pure Java code.  (Nevertheless, Tomcat is using the
 Tomcat Native Library)

 Is there a way I can monitor the number of file descriptors in use
 by
 the app?

 I have monitored the number of threads, but I haven't seen
 anything
 unusual.

 How many threads have you observed?  Total threads, not just
 threads for the connector.

 Also, what is the value you are using for thread stack size?  -Xss

 Dan



 (but it could be that the burst is too fast to get catch by
 the monitoring tool)

 -Jorge







 On Thu, Jun 7, 2012 at 11:44 AM, Christopher Schultz
 ch...@christopherschultz.net wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Jorge,

 On 6/6/12 5:33 PM, Jorge Medina wrote:
 The web application uses Spring/Postgres/Mongo.

 Are you using MongoDB in-process or anything weird like that? Or
 are
 you connecting through some socket-based (or other) API?

 It looks like a memory leak in native code, not java code; so
 my
 usual java toolset is not useful.

 If what you are observing is accurate (non-heap memory grows,
 heap
 stays 

RE: Java process killed by oom-killer in Ubuntu

2012-06-11 Thread Caldarale, Charles R
 From: Jorge Medina [mailto:cerebrotecnolog...@gmail.com] 
 Subject: Re: Java process killed by oom-killer in Ubuntu

 Nevertheless, I am finding that after removing the -Xms option, the
 process memory usage stabilizes and stops growing.

That would seem to indicate that your -Xmx value is simply too large for the 
system you're running in.

 - 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: Java process killed by oom-killer in Ubuntu

2012-06-11 Thread Jorge Medina
The machine has 16 GB of memory with no swap space.
The JVM was being started with -Xms and -Xmx equal to 6 GB, so I think
10GB extra would be enough for anything else.

-Jorge

On Mon, Jun 11, 2012 at 11:15 AM, Caldarale, Charles R
chuck.caldar...@unisys.com wrote:
 From: Jorge Medina [mailto:cerebrotecnolog...@gmail.com]
 Subject: Re: Java process killed by oom-killer in Ubuntu

 Nevertheless, I am finding that after removing the -Xms option, the
 process memory usage stabilizes and stops growing.

 That would seem to indicate that your -Xmx value is simply too large for the 
 system you're running in.

  - 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


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Java process killed by oom-killer in Ubuntu

2012-06-11 Thread David kerber


On 6/11/2012 2:30 PM, Jorge Medina wrote:

The machine has 16 GB of memory with no swap space.
The JVM was being started with -Xms and -Xmx equal to 6 GB, so I think
10GB extra would be enough for anything else.


Does Xms/Xmx memory need to be contiguous?  If so, maybe it just can't 
find a big-enough chunk?





-Jorge

On Mon, Jun 11, 2012 at 11:15 AM, Caldarale, Charles R
chuck.caldar...@unisys.com  wrote:

From: Jorge Medina [mailto:cerebrotecnolog...@gmail.com]
Subject: Re: Java process killed by oom-killer in Ubuntu



Nevertheless, I am finding that after removing the -Xms option, the
process memory usage stabilizes and stops growing.


That would seem to indicate that your -Xmx value is simply too large for the 
system you're running in.

  - 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



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org





-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Java process killed by oom-killer in Ubuntu

2012-06-11 Thread Caldarale, Charles R
 From: David kerber [mailto:dcker...@verizon.net] 
 Subject: Re: Java process killed by oom-killer in Ubuntu

 On 6/11/2012 2:30 PM, Jorge Medina wrote:
  The machine has 16 GB of memory with no swap space.
  The JVM was being started with -Xms and -Xmx equal to 6 GB, so I think
  10GB extra would be enough for anything else.

 Does Xms/Xmx memory need to be contiguous?  If so, maybe it just can't 
 find a big-enough chunk?

It needs to be contiguous in the virtual space of the process, not in RAM.  The 
Xmx size of heap virtual space is allocated during JVM initialization, so if it 
gets past initialization, it's not a problem.  The OOM killer only gets in the 
game when the real memory requirements of all processes combined exceed the 
amount of RAM plus swapfile.  Again, it sure looks like -Xmx=6G is too large 
for the system, when combined with everything else going on in that process and 
the rest of the system.

 - 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: Java process killed by oom-killer in Ubuntu

2012-06-11 Thread Jorge Medina
There is not much running in the machine other than Tomcat.
The JVM actually starts fine, using about 8GB (6GB of heap, + code +
threads etc) but it keeps growing. In about 2 days it runs out of
memory. (The JVM process has reached more than 15GB).

-Jorge

On Mon, Jun 11, 2012 at 11:40 AM, Caldarale, Charles R
chuck.caldar...@unisys.com wrote:
 From: David kerber [mailto:dcker...@verizon.net]
 Subject: Re: Java process killed by oom-killer in Ubuntu

 On 6/11/2012 2:30 PM, Jorge Medina wrote:
  The machine has 16 GB of memory with no swap space.
  The JVM was being started with -Xms and -Xmx equal to 6 GB, so I think
  10GB extra would be enough for anything else.

 Does Xms/Xmx memory need to be contiguous?  If so, maybe it just can't
 find a big-enough chunk?

 It needs to be contiguous in the virtual space of the process, not in RAM.  
 The Xmx size of heap virtual space is allocated during JVM initialization, so 
 if it gets past initialization, it's not a problem.  The OOM killer only gets 
 in the game when the real memory requirements of all processes combined 
 exceed the amount of RAM plus swapfile.  Again, it sure looks like -Xmx=6G is 
 too large for the system, when combined with everything else going on in that 
 process and the rest of the system.

  - 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


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Java process killed by oom-killer in Ubuntu

2012-06-11 Thread Caldarale, Charles R
 From: Jorge Medina [mailto:cerebrotecnolog...@gmail.com] 
 Subject: Re: Java process killed by oom-killer in Ubuntu

 The JVM actually starts fine, using about 8GB (6GB of heap, + code +
 threads etc) but it keeps growing. In about 2 days it runs out of
 memory. (The JVM process has reached more than 15GB).

Now I remember this thread - it's the non-heap memory leak that you need track 
down and eliminate.  Reducing either Xms or Xmx is simply postponing the 
eventual decapitation by the OOM killer.

 - 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: Java process killed by oom-killer in Ubuntu

2012-06-11 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Jorge,

On 6/11/12 3:01 PM, Jorge Medina wrote:
 There is not much running in the machine other than Tomcat. The JVM
 actually starts fine, using about 8GB (6GB of heap, + code + 
 threads etc) but it keeps growing. In about 2 days it runs out of 
 memory. (The JVM process has reached more than 15GB).

I would be very interested in seeing where all that memory is going.
It sounds like it's not going to the heap, otherwise you'd be getting
OOME and crashing in a different way.

Any luck using lsof?

Also, your previously-posted configuration seems a little insane:

 Xms6g -Xmx6g -XX:NewSize=4G -XX:MaxNewSize=4G -XX:SurvivorRatio=6 
 -XX:MaxPermSize=512M -XX:-UseConcMarkSweepGC -XX:+UseStringCache 
 -XX:+HeapDumpOnOutOfMemoryError
 -XX:HeapDumpPath=/home/example/logs

- -Xmx6g and NewSize=4G? Plus 0.5G for PermGen?

Have you tried using -XX:+UseCompressedOops? I wonder if you are
getting killed with half-empty 64-bit pointers.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk/WQ9kACgkQ9CaO5/Lv0PAzQQCfb27emGzLf1rcF+5HP/CDV7iH
1w0An3X19YeWKrnwx2AyqO4QkMGvr5sm
=UHL9
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat uses 99% of CPU - Something to do with AJP connector

2012-06-11 Thread Dharamshila Khandelwal
Hi Konstantin,

I cannot upgrade Tomcat because we upgraded last year.
I will do a thread dump when it slows down next time.
However, I still need answers to AJP connection time out.

Thanks,
DS.

On Mon, Jun 11, 2012 at 12:39 PM, Konstantin Kolinko knst.koli...@gmail.com
 wrote:

 2012/6/11 Dharamshila Khandelwal dharmshil...@gmail.com:
  Hi,
 
  I use a combination of tomcat (version 6.0.32) and apache (version
 2.2.17)
  connected by mod_proxy_ajp connector.
  The website starts responding slow all of a sudden and I see that tomcat
  process uses 99% of the CPU.
  At the same time I see the following in apache error_log:
 
  [Sun Jun 10 00:20:36 2012] [error] (70007)The timeout specified has
  expired: ajp_ilink_receive() can't receive header
  [Sun Jun 10 00:20:36 2012] [error] ajp_read_header: ajp_ilink_receive
 failed
  [Sun Jun 10 00:20:36 2012] [error] (120006)APR does not understand this
  error code: proxy: read response failed from 10.128.18.60:9393 (
  roplws01.hsn.net)
 

 It might be anything.  You have to take a thread dump,  or better
 several (3) dumps with small intervals between them to see what is
 actually going on.

 How to take the thread dumps is mentioned in the FAQ.

 Any chance for upgrade to 6.0.35 or to Tomcat 7?

 Best regards,
 Konstantin Kolinko

 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org




RE: Tomcat uses 99% of CPU - Something to do with AJP connector

2012-06-11 Thread Caldarale, Charles R
 From: Dharamshila Khandelwal [mailto:dharmshil...@gmail.com] 
 Subject: Re: Tomcat uses 99% of CPU - Something to do with AJP connector

 I cannot upgrade Tomcat because we upgraded last year.

Now that is a completely bogus reason.

 - 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: [solved] Re: connection reset errors

2012-06-11 Thread Jose María Zaragoza
 The solution was to 1) set acceptCount to a higher value in Tomcat and 2) to 
 configure my OS to allow applications to specify longer accept queues. That 
 last step was the one missing. I had changed acceptCount before, but since 
 the OS was limiting the accept queue length I did not see any improvement.

Thanks for your feedback

One question: modify *only* kern.ipc.somaxconn didn't solve your
problem ?  can be any collateral problem with a high value ?

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Can someone suggest mail some opensource mail server which works well with Tomcat.

2012-06-11 Thread Kiran Badi

On 6/10/2012 1:49 AM, André Warnier wrote:

Kiran Badi wrote:


Any feedback on apache james ?


I've never used it, so I can't comment. What I would ask is: why are
you are specifically looking for a Java-based mail server?

I was looking for open source server ,capable for serving atleast 5k 
mails daily to begin with.Since I am using java api, I am under 
impression that java based mail servers will have support for java 
api's.




Kiran,

Let me try to explain again what several other people here have tried 
to explain to you already.


There are two different and separate things here :

1) an email server, capable of
- sending out the emails that your application is composing, toward 
email recipients that are somewhere else
- receiving emails coming from other senders and destined to some 
local email mailbox, and putting these emails in that mailbox, so 
that a local recipient can read them when they want


2) an interface library, which provides an API that makes it easy for 
your application to
- compose emails that you want to send out; and forward these emails 
to the email server, so that it can send them out
- connect to a mailbox, to read received emails that are waiting for 
someone to read them; and maybe parsing these emails, to extract 
something out of them; and maybe to forward one of these emails to 
some other mailbox.


(1) is a separate package (like sendmail, exim4, courier, and several 
others).  You install it, configure it and run it as a daemon.  Then 
you create email accounts with that email server, so that it would 
have email mailboxes with email addresses to which external 
people/programs can send emails.
This package can be written in any language, it does not matter; your 
programs will not directly call the internal functions of this email 
server, so it will make no difference whether it is written in Java or 
not.


(2) is an API library, and for that one it will matter what language 
it is written in, because your programs will need to call functions of 
this library, to send outgoing emails or to read incoming emails that 
are sitting in one of the email server's mailboxes.


Graphically :

(your.program === email library)  SMTP or POP3 or IMAP -- 
email server  Internet


=== are calls from your program, into functions of the library
--- is a TCP/IP connection between that library and some email 
server, and the language used over that connection is SMTP or POP3 
or IMAP


It is similar to what you would use if your program needed to talk to 
another webserver:


(your.program === HTTP Client library) --- HTTP or HTTPS -- web 
server
It does not matter if the web server is an Apache httpd, IIS, Tomcat 
or www.google.com, or whatever language that webserver is written in, 
or if it is local or remote.


Similarly, it does not matter which email server you are going to 
use.  It just needs to support the email protocol you want to use and 
which your library supports.


The /library/ is what matters.
And for Java, the one that comes to mind first is Javamail.
(It can help you composing ans sending emails; but I do not know if it 
can /read/ incoming emails).




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Thanks Andre. I am clear on what I want and thanks for clarifying it.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



HttpOnly

2012-06-11 Thread N.s.Karthik
Hi

Spec
JDK1.6
Tomcat 6.0.10
O/s Win / Linux(r-Hat)
Browser : Crome 19.0.x / IE8

For some specific Reason We use Tomcat 6.0.10 for Dev/Deploy in INTRANET.

I have Googled / Yahooed for the same. HttpOnly

1 form suggested to use Filters and set Cookie Headers as alternative for
Handling HttpOnly

How ever with this setting we are able to see multiple Cookies being set

*HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Set-Cookie: JSESSIONID=A0A4EFD9A28E2C24D925B519EA9EC4F6; Path=/ABCD;
HttpOnly
Set-Cookie: JSESSIONID=D29822A1FD77C84907D67708C4DACC04; Path=/ABCD
Content-Type: text/html
Content-Length: 2333
Date: Tue, 12 Jun 2012 04:46:29 GMT*


Please some body explain me Why this is happening and how to prevent this
for Cross scripting Hack ???


with regards
karthik


--
View this message in context: 
http://tomcat.10.n6.nabble.com/HttpOnly-tp4982369.html
Sent from the Tomcat - User mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: HttpOnly

2012-06-11 Thread Satish Kumar Geddam
https://owasp.org/index.php/HttpOnly#Using_Java_to_Set_HttpOnly
enjoy

On Tue, Jun 12, 2012 at 10:27 AM, N.s.Karthik nskarthi...@gmail.com wrote:

 Hi

 Spec
 JDK1.6
 Tomcat 6.0.10
 O/s Win / Linux(r-Hat)
 Browser : Crome 19.0.x / IE8

 For some specific Reason We use Tomcat 6.0.10 for Dev/Deploy in INTRANET.

 I have Googled / Yahooed for the same. HttpOnly

 1 form suggested to use Filters and set Cookie Headers as alternative for
 Handling HttpOnly

 How ever with this setting we are able to see multiple Cookies being set

 *HTTP/1.1 200 OK
 Server: Apache-Coyote/1.1
 Set-Cookie: JSESSIONID=A0A4EFD9A28E2C24D925B519EA9EC4F6; Path=/ABCD;
 HttpOnly
 Set-Cookie: JSESSIONID=D29822A1FD77C84907D67708C4DACC04; Path=/ABCD
 Content-Type: text/html
 Content-Length: 2333
 Date: Tue, 12 Jun 2012 04:46:29 GMT*


 Please some body explain me Why this is happening and how to prevent this
 for Cross scripting Hack ???


 with regards
 karthik


 --
 View this message in context:
 http://tomcat.10.n6.nabble.com/HttpOnly-tp4982369.html
 Sent from the Tomcat - User mailing list archive at Nabble.com.

 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org




Re: Tomcat uses 99% of CPU - Something to do with AJP connector

2012-06-11 Thread Martin Knoblauch
On Mon, Jun 11, 2012 at 10:37 PM, Caldarale, Charles R
chuck.caldar...@unisys.com wrote:
 From: Dharamshila Khandelwal [mailto:dharmshil...@gmail.com]
 Subject: Re: Tomcat uses 99% of CPU - Something to do with AJP connector

 I cannot upgrade Tomcat because we upgraded last year.

 Now that is a completely bogus reason.


 From a technical point of view - yes. But from experience I can tell
that you there are IT organisations out there that have really weird
policies. So upgrade middleware only once a year is not unthinkable
:-(

Martin

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org