On my box if i use the Xms20m and Xmx20m the Runtime.getRuntime().totalMemory() gives: Total Memory: 20840448. Free Memory left: 1618328
I see from remote box (where the webapp should work) log that the memory results, just after the application is started, gives: Total Memory: 15679488. Free Memory left: 4928976 15mb total and only 5 free. I notice that when free memory get low, total memory resize a bit, but today it thrown the first out of memory of heap when the situation was: Total Memory: 66650112. Free Memory left: 451216 It means it allocated only 66mb while according to the configuration it should allocate at least 256mb The question is easy: if i used xms, shouldn't the total memory be at least that value when the application is boot? > You will need to enable GC Stats for your JVM > either on command line or > set in JVM_OPTS env variable or > handcode in %JAVA_HOME%/jre/lib/i386/jvm.cfg > e.g. > java -verbose:gc -XX:+PrintGCTimeStamps -XX:+PrintGCDetails > > and then use a GCStatAnalyzer to look at ObjectAllocation and > ObjectPromotion/younggenCollectionTime > e.g. > PrintGCStats -v ncpu=<n> [-v interval=<seconds>] [-v verbose=1] <gc_log_file > > > > http://java.sun.com/developer/technicalArticles/Programming/turbo/index.html > > Does this help? > Martin-- > This email message and any files transmitted with it contain confidential > information intended only for the person(s) to whom this email message is > addressed. If you have received this email message in error, please notify > the sender immediately by telephone or email and destroy the original > message without making a copy. Thank you. > > ----- Original Message ----- > From: <[EMAIL PROTECTED]> > To: "users" <users@tomcat.apache.org> > Sent: Monday, April 30, 2007 6:37 AM > Subject: Runtime.getRuntime().****Memory() > > > As i wrote in my previous messages i'm experiencing OutOfMemory heap > problems. > I added a Runtime.getRuntime().totalMemory() and > Runtime.getRuntime().freeMemory() at the end of the main client thread that > is created when a client connects to the webapp. > I noticed that when i deply the webapp i got those values: > > Total Memory: 43425792. Free Memory left: 17827832 > > After about an hour the values drop to: > > Total Memory: 43425792. Free Memory left: 6898584 > > and keep getting lower. > After 1 hour and half i got that: > > Total Memory: 43425792. Free Memory left: 439248 > > so i thought that this would go to OutOfMemory soon, but after some mins i > got: > > Total Memory: 58986496. Free Memory left: 25538936 > > so i went to catalina.out logs and looked what happen: > > [Unloading class sun.reflect.GeneratedMethodAccessor44] > [Unloading class sun.reflect.GeneratedSerializationConstructorAccessor10] > [Unloading class sun.reflect.GeneratedMethodAccessor48] > [Unloading class sun.reflect.GeneratedSerializationConstructorAccessor14] > [Unloading class sun.reflect.GeneratedSerializationConstructorAccessor8] > [Unloading class sun.reflect.GeneratedSerializationConstructorAccessor11] > [Unloading class sun.reflect.GeneratedSerializationConstructorAccessor13] > [Unloading class sun.reflect.GeneratedSerializationConstructorAccessor9] > [Unloading class sun.reflect.GeneratedSerializationConstructorAccessor15] > [Unloading class org.apache.jsp.admin_jsp] > [Unloading class sun.reflect.GeneratedSerializationConstructorAccessor12] > [Unloading class sun.reflect.GeneratedSerializationConstructorAccessor7] > [Loaded com.mysql.jdbc.Messages from > file:/usr/local/jakarta/jakarta-tomcat-5.5.9/common/lib/mysql-connector-java-5.0.5-bin.jar] > [Loaded sun.reflect.GeneratedSerializationConstructorAccessor16 from > __JVM_DefineClass__] > [Loaded sun.reflect.GeneratedSerializationConstructorAccessor17 from > __JVM_DefineClass__] > > Why total memory increased? it adjusted the heap memory to not go out of > memory? from 43mb to 58mb there is 15mb of difference, why the free space > raised to 25mb then? the garabge collection wasn't efficent? > > I started the server with "java -server -Xms512m -Xmx1024m" so the heap will > be resized untill it reaches 1024mb? > > I'm using db connection pooling, is there a chance that it's getting a lot > of resources? i followed the tutorials to create and close db connections > for pooling reuse: if i used them wrong, shouldn't i get another error > message? > > It's some weeks i'm trying to figure out what's the problem of those > OutOfMemory heap errors, any help is appreciated. > > > > ------------------------------------------------------ > Leggi GRATIS le tue mail con il telefonino i-modeT di Wind > http://i-mode.wind.it/ > > > > --------------------------------------------------------------------- > To start a new topic, e-mail: users@tomcat.apache.org > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > > --------------------------------------------------------------------- > To start a new topic, e-mail: users@tomcat.apache.org > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > ------------------------------------------------------ Leggi GRATIS le tue mail con il telefonino i-modeĀ di Wind http://i-mode.wind.it/ --------------------------------------------------------------------- To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]