On Tue, 15 Jun 2004, Shapira, Yoav wrote: | | Hi, | | >You might also want to try .gc() (force Garbage Collection) - run | >freeMemory() right before and right after .gc(), print out the diff | too. | | Man, I expect this error from novice posters, but not from you ;)
Oh, thanks..! ;) | System.gc is ONLY A SUGGESTION. I know - but Sun's VMs surely seems to follow your suggestions! | The more recent the JVM, the more likely it is to be ignored by the | JVM, and moreover more and more admins/developers I know are setting | -XX:+DisableExplicitGC as a Standard Operating Procedure. Don't count | on System.gc for anything. Well, 1.5beta2 (that's rather recent, ai?) GC's like hell when I invoke the method - it even seems to do it synchronous, as it (currentThread) hangs while it does it.. I only said this as an suggestion for seeing if you have tons of "dead objects" lying around - you might be able to figure something out based on the diff. On my system, I get a considerable diff after some time, but I feel this is expected. A worse thing is that after each restart of my app I get less memory free, and eventually I run out (it isn't much each time, but after e.g. 40 reloads, there aren't many megs left of my initial 64). I have to debug this now, it will be interesting to see if it is Tomcat code or my code that have the bug..! ;) Btw: you can turn on "verbose gc" on the JVM, this is cool: -verbose:gc Report on each garbage collection event. And then, Yoav, you can se that your objects are killed -when you invoke gc()-! ;) Endre. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]