On 13/04/2021 00:11, Jerry Malcolm wrote:
I'm getting TC crashes (ver 8.5) with "out of memory" errors.

What is the exact error message? There are multiple different problems that all get reported with an OutOfMemoryException and the detail of the exception will tell you (and us) which it is.

  I understand heap space and the parameters to set it.  But I need a bit of help with "out of memory", not "out of heap space".   This is running in an EC2 on AWS.  It's a development server, so activity is minimal compared to production.  We also are running it on a smaller EC2 which is likely contributing to the problem. But interestingly the last crash happened in the middle of the night.  The last request came in 15 minutes prior to the crash, and it was some php intrusion attempt URL that returned 404. Crashes don't happen often.  A couple of servers have failed once or twice a week.  And this is the first time the dev server crashed.  But I still really need to get a handle on it.

We have a pretty large max heap space configured.  Does this problem have something to do with specifying a heap space larger than TC can allocate with physical memory?  I figured there was still the option of virtual memory and swapping if it ran out of physical memory.

The heap space isn't the only memory the JVM needs. It also needs memory for:
- the JVM code
- classes
- thread stacks
- native libraries
- managing GC

and a bunch of other things I have probably forgotten.

I need to learn more and tuning the memory usage.  Is there some formula that tells me the max heap space given a certain size of physical memory?  Or is there something else I'm totally missing about memory configuration?

There is no fixed formula to determine total memory requirements for a given heap as it is very application dependent. Once you know which particular OOME issue you are hitting, then you can figure out the right response.

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to