Created attachment 622290 [details] Addresses OutOfMemoryError in EMS I have a Tomcat installation with a lot of files in a server directory. So many files that it is an issue finding the server classes. This is what I see. Caused by: java.lang.OutOfMemoryError: GC overhead limit exceeded at java.nio.ByteBuffer.wrap(ByteBuffer.java:350) at java.lang.StringCoding$StringDecoder.decode(StringCoding.java:137) at java.lang.StringCoding.decode(StringCoding.java:173) at java.lang.String.<init>(String.java:443) at java.lang.String.<init>(String.java:515) at java.io.UnixFileSystem.list(Native Method) at java.io.File.list(File.java:973) at java.io.File.listFiles(File.java:1051) at org.mc4j.ems.connection.ConnectionFactory.findFile(ConnectionFactory.java:241) at org.mc4j.ems.connection.ConnectionFactory.findFile(ConnectionFactory.java:246) at org.mc4j.ems.connection.ConnectionFactory.findFile(ConnectionFactory.java:246) at org.mc4j.ems.connection.ConnectionFactory.findFile(ConnectionFactory.java:235) at org.mc4j.ems.connection.ConnectionFactory.discoverServerClasses(ConnectionFactory.java:204) at org.jboss.on.plugins.tomcat.TomcatServerComponent.loadConnection(TomcatServerComponent.java:201) at org.jboss.on.plugins.tomcat.TomcatServerComponent.start(TomcatServerComponent.java:307) The obvious improvement would be to catch the exception. Patch is attached
How many files do you have in your server directory? Which directory is it of the Tomcat server? What kind of files are you storing there?
Probably tens or hundreds of thousands of files in a single directory. It was a directory that did not contain classes but data files. I'm guessing this is not really a big issue but the plugin should not have been looking for classes in there.
Fixed in master commit faf0013f511894eb2c7b9ef14f87b5e87d657154 Author: Thomas Segismont <tsegismo> Date: Wed Jul 3 14:01:00 2013 +0200 Changed the libraryURI root: the plugin was looking for catalina jars from the CATALINA_HOME directory, instead of CATALINA_HOME/lib. Now users can put any number of files in CATALINA_HOME, provided they're outside the lib directory.
Reverted. This needs to go through the EWS team
Created attachment 772164 [details] Search recursively for EMS connection classes in HOME/lib instead of HOME (HOME/server/lib on Tomcat 5.5)
The new patch is looking good, and can be backported if needed as it will certainly support Tomcat 5.5 as well. In case the functionality is really required in some cases. commit 794d564b16b697870ca92040f27acbcdcad63522 in master
Bulk closing now that 4.10 is out. If you think an issue is not resolved, please open a new BZ and link to the existing one.