Problems with JVM running out of memory

Hi,

I have a JVM running out of available memory, is there anyway in Java that I can track the avaIlable memory in the JVM so that I can stop the thread that is causing the excessive memory usage when it reaches a certain threshold? Or is there any mechanism for monitoring it? Any idea's/suggestions would be greatly appreciated.

Thanks

Col

[367 byte] By [col2006a] at [2007-10-3 8:51:15]
# 1

use a profiler, profilers analyze your programs at runtime and give usefull information like processor time spent, memory use, etc. You can also pass more memory to your program with -Xms and -Xmx java parameters, but if you are using a lot more memory than expected maybe your application is not designed properly... If you can be more specific about your thread, maybe we can figure out what's going wrong...

mpinga at 2007-7-15 4:00:47 > top of Java-index,Java HotSpot Virtual Machine,Specifications...