Hi,
We are facing high CPU usage in our application hosted on Tomcat. After getting thread dumps, I see the following information. Seems like the RE.java is getting processed continuously and due to this few threads in Tomcat are stuck forever. This pushes the CPU usage above 90% and making the application very unstable. Please advice. Below is the info from thread dump: TP-Processor5396" daemon prio=10 tid=0x022cff28 nid=0x1f91b runnable [0x4dcfb000..0x4dcffc70] at org.apache.regexp.RE.matchNodes(RE.java:860) at org.apache.regexp.RE.matchNodes(RE.java:1376) at org.apache.regexp.RE.matchNodes(RE.java:1376) at org.apache.regexp.RE.matchNodes(RE.java:1376) at org.apache.regexp.RE.matchNodes(RE.java:1376) at org.apache.regexp.RE.matchNodes(RE.java:1376) at org.apache.regexp.RE.matchNodes(RE.java:1376) at org.apache.regexp.RE.matchNodes(RE.java:1376) at org.apache.regexp.RE.matchNodes(RE.java:1376) at org.apache.regexp.RE.matchNodes(RE.java:1376) at org.apache.regexp.RE.matchNodes(RE.java:1376) at org.apache.regexp.RE.matchNodes(RE.java:1376) at org.apache.regexp.RE.matchNodes(RE.java:1376) at org.apache.regexp.RE.matchNodes(RE.java:1376) at org.apache.regexp.RE.matchNodes(RE.java:1376) at org.apache.regexp.RE.matchNodes(RE.java:1376) at org.apache.regexp.RE.matchNodes(RE.java:1376) at org.apache.regexp.RE.matchNodes(RE.java:1376) at org.apache.regexp.RE.matchNodes(RE.java:1376) at org.apache.regexp.RE.matchNodes(RE.java:1376) at org.apache.regexp.RE.matchNodes(RE.java:1376) at org.apache.regexp.RE.matchNodes(RE.java:1376) at org.apache.regexp.RE.matchNodes(RE.java:1376) at org.apache.regexp.RE.matchNodes(RE.java:1376) at org.apache.regexp.RE.matchNodes(RE.java:1376) at org.apache.regexp.RE.matchNodes(RE.java:1376) at org.apache.regexp.RE.matchNodes(RE.java:1376) at org.apache.regexp.RE.matchNodes(RE.java:1376) at org.apache.regexp.RE.matchNodes(RE.java:1376) at org.apache.regexp.RE.matchNodes(RE.java:1376) at org.apache.regexp.RE.matchNodes(RE.java:1376) at org.apache.regexp.RE.matchNodes(RE.java:1376) at org.apache.regexp.RE.matchNodes(RE.java:1376) at org.apache.regexp.RE.matchNodes(RE.java:1376) at org.apache.regexp.RE.matchNodes(RE.java:1376) at org.apache.regexp.RE.matchNodes(RE.java:1376) at org.apache.regexp.RE.matchNodes(RE.java:1376) at org.apache.regexp.RE.matchNodes(RE.java:1376) at org.apache.regexp.RE.matchNodes(RE.java:1376) at org.apache.regexp.RE.matchNodes(RE.java:1376) at org.apache.regexp.RE.matchNodes(RE.java:1376) at org.apache.regexp.RE.matchNodes(RE.java:1376) at org.apache.regexp.RE.matchNodes(RE.java:1376) at org.apache.regexp.RE.matchNodes(RE.java:1376) at org.apache.regexp.RE.matchNodes(RE.java:1376) at org.apache.regexp.RE.matchNodes(RE.java:1376) at org.apache.regexp.RE.matchNodes(RE.java:1376) at org.apache.regexp.RE.matchNodes(RE.java:1376) at org.apache.regexp.RE.matchNodes(RE.java:1376) at org.apache.regexp.RE.matchNodes(RE.java:1376) at org.apache.regexp.RE.matchNodes(RE.java:1376) at org.apache.regexp.RE.matchNodes(RE.java:1376) at org.apache.regexp.RE.matchNodes(RE.java:1376) at org.apache.regexp.RE.matchNodes(RE.java:1376) at org.apache.regexp.RE.matchNodes(RE.java:1376) at org.apache.regexp.RE.matchNodes(RE.java:1376) at org.apache.regexp.RE.matchNodes(RE.java:1376) at org.apache.regexp.RE.matchNodes(RE.java:1376) at org.apache.regexp.RE.matchNodes(RE.java:1376) at org.apache.regexp.RE.matchAt(RE.java:1448) at org.apache.regexp.RE.match(RE.java:1498) at org.apache.regexp.RE.match(RE.java:1468) at org.apache.regexp.RE.match(RE.java:1561) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica tionFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt erChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv e.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv e.java:175) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java :128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java :102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve. java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:2 86) at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190) at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:283) at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:767) at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java: 697) at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket. java:889) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool .java:690) at java.lang.Thread.run(Thread.java:595) Here is the regex related code in our application : try{ RE r = new RE("^[\\w\\-]+(\\.)?[\\w\\...@[\\w\\-\\.]+(\\.([a-z]){2,4})$"); RE r1 = new RE("^\\w{5,65}$"); match = r.match(userID); if(!match) match = r1.match(userID); }catch(Exception ex){ throw new BusinessException(ex); } Any thoughts???? Do you really need to print this email? Help preserve our environment! Devez-vous vraiment imprimer ce courriel? Pensons a l'environnement! __________________________________________________________ Cogeco Cable operates under various legal entities and, except as specifically provided herein, this communication cannot be attributed to any given entity or be regarded as a statement of any given entity. The information in this message, including in all attachments, is confidential or privileged. In the event you have received this message in error and are not the intended recipient, you are hereby advised that any use, copying or reproduction of this document is strictly forbidden. Please notify immediately the sender of this error and destroy this message, including its attachments, as the case may be. Cogeco Cable exerce ses activites par l'entremise de differentes entites legales et, sauf si autrement indique dans la presente communication, celle-ci ne peut etre attribuee a l'une ou l'autre de ces entites en particulier ou consideree comme un enonce d'une de ces entites en particulier. L'information apparaissant dans ce message electronique et dans les documents qui y sont joints est de nature confidentielle ou privilegiee. Si ce message vous est parvenu par erreur et que vous n'en etes pas le destinataire vise, vous etes par les presentes avises que toute utilisation, copie ou distribution de ce message est strictement interdite. Vous etes donc prie d'en informer immediatement l'expediteur et de detruire ce message, ainsi que les documents qui y sont joints, le cas echeant. __________________________________________________________