Jatin
Jatin

Reputation: 31754

Weird Memory Usage by Tomcat

Its a vague question. So please feel free to ask for any specific data.

We have a tomcat server running with two web-service's. One tomcat built using spring. We use mysql for 90% of tasks and mongo for caching of jsons (10%). The other web-service is written using grails. Both the services are medium sized codebases (About 35k lines of code each)

The computation only happens when there is an HTTP request (No batch processing). With about 2000 database hits per request (I know its humongous. We are working on it). The request rate is about 30 req/min. For one particular request, there is Image processing which is quite memory expensive. No JNI anywhere

We have found a weird behavior. Last night, I can confirm that there was no request to the server for about 12 hours. But when I look at the memory consumption, it is very confusing: enter image description here

Without any requests, the memory keeps jumping from 500Mb to 1.2Gb (700 Mb jump is worrysome). There is no computation on server side as mentioned. I am not sure if its a memory leak:

  1. The memory usage comes down. (Things would have been way easier if the memory didnt come down).
  2. This behavior is reproducable with caches based on SoftReference or so. With full gc's. But I am not using them anywhere (Not sure if something else is using it)

What else can be the reason. is it a cause to worry?

PS: We have had Our of Memory Crashes (Not errors but JVM crash) quite frequently very recently.

Upvotes: 3

Views: 285

Answers (1)

John Thompson
John Thompson

Reputation: 524

This is actually normal behavior. You're just seeing garbage collection occur.

Upvotes: 1

Related Questions