Hi, I believe that you are configusing the process memory consumed by the java application, with that used by the java image
Running system.gc does not return memory to the operating system, is garbage collects the memory that it has allocated. This means that there may be some unused holes in the memory space. Whether the memory is compacted and returned to the OS is down to the VM, and I have not seen that occur. The amount is free memory can be seen from Runtime.getRuntime().freeMemory() You should ensure that the memory restrictions that you give the java VM are ones that you can live with! I presume that you did not actually mean that you had java.sql.Connection objects lying around in your session. If you want to track the objects lying around in your sessions, and some (very rough) guesses as to what memory is being consumed, you could attach a session listener and periodically serialise the session data (that is the rough and approximate bit) and look at the size of the data that was serialised Mike > -----Original Message----- > From: Shapira, Yoav [mailto:[EMAIL PROTECTED]] > Sent: Thursday 29 August 2002 14:22 > To: Tomcat Users List > Subject: RE: Garbage Collection in Java: Am I an idiot? > > > Howdy, > Very few things are guaranteed regarding garbage collection > when you consider your system as a whole. The container can > almost always cache things like JSPs, servlets, and sessions > until it feels like releasing them. Some of these parameters > you can control via configuration, e.g. session expiration. > > System.gc() is a suggestion. It doesn't guarantee garbage > collection will run. In fact, JDK 1.4 and later can be told > to ignore calls to System.gc via a runtime option, so your > server admin may set this option, at which point you could > rely on System.gc() even as a suggestion to the VM. > > Have your tried adding -verbose:gc to your runtime options? > That will let you know when garbage collection is running and > how much memory it collected at each run. > > Have your tried using another garbage collector, e.g. the incremental > (-Xincgc) or concurrent mark-sweep (-XX:+UseConcMarkSweepGC > (available beginning with J2SE 1.4.1) ? > > Yoav Shapira > Millennium ChemInformatics > > > >-----Original Message----- > >From: Michael Nicholson [mailto:[EMAIL PROTECTED]] > >Sent: Thursday, August 29, 2002 9:08 AM > >To: Tomcat Users List > >Subject: OT: Garbage Collection in Java: Am I an idiot? > > > >The answer to the (completely rhetorical) question is probably yest, > but > >I've got another question, too. > > > >So, I have this moderately large application with jsps, servlets, and > an > >Oracle DB. It does its thing ok, but it never releases > memory. There > are > >certainly session variables (probably way too many, but that's > (hopefully) > >a question for another day), but even after the session expires, I'm > still > >using the same amount of memory. I even included a direct call to > >System.gc() on my first page, hoping to collect the memory from the > three > >day old sessions, but no luck. > > > >So, my thoughts/questions: Some connections are still > opened (this is > >what's running on my development server right now: however, > the actual > >development is done in Sun ONE on my desktop, so I'm going > through and > >making sure all of those are closed there... but I'm also trying to > debug > >this memory issue), so maybe these open connections force > some of the > >session scoped beans to persist? Forever? Or am I just missing > something > >completely about garbage collection? > > > >So, in short, if I have a session scoped bean that has in it > something > like > >a connection or a recordset (which is most likely not a good > idea... I > now > >know that), even after the session times out, would that > bean continue > to > >exist? And eat up my memory? > > > >Sorry for the rambling. > > > >Michael Nicholson, > >Carolina Center for Public Service > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
