On 22.12.18 22:58, Dhaval Jaiswal wrote: > Application built in such a way that it consum memory and hence, it's > exhaust all memory and results in crashing Java. Probably GC is not running > when it reaches to its threshold. Is there a way I can call GC explicitly > without affecting running application. I believe need to identify the > memory consumption as well.
I'd recommend to run the whole system in a profiler, set the memory as advised to the same -Xms and -Xmx values. GC *always* runs before an OutOfMemory condition - however, if it's an allocation issue, technically the JVM isn't out of memory with your original settings, because it rightfully tries to allocate more from the OS until it reaches -Xmx. In that case it'd be correct to just stop working if the OS can't provide more memory. If you legitimately use that much memory for operations, you might want to throttle the rate of processing - but we can't tell you where your code problems are without your code. The problem is clearly application specific and not tomcat related, as Tomcat happily runs with a lot less memory. In the beginning of this (mail-)thread you asked, which thread is consuming the memory: We don't know, and as memory isn't allocated to a thread, it doesn't matter. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org