Cris,
On 5/27/21 15:24, Berneburg, Cris J. - US wrote:
Hi Folks :-)
One of our web apps is using a "lot" of memory, specifically a big
user query. We'd like to find out why.
The Tomcat Web Application Manager Find leaks button said that "No
web applications appear to have triggered a memory leak on stop,
reload or undeploy."
Tomcat Manager Server Status shows that 1.7GB (82%) of G1 Old Gen
space is being used that has not been recycled yet.
I grabbed a heap dump and used Eclipse Memory Analyzer, and it shows
that only 94MB of memory is being used when G1 Old Gen space used
1.8GB. MAT seems to be looking only at the active objects, not the
discarded ones. IOW, we're looking at what the app is doing ATM, not
what it already did.
I want to explore the 1.7GB garbage pile to see what's being thrown
away, not what things are still being used, to determine
wastefulness.
1. Is there a way to analyze uncollected garbage?
2. Is that a reasonable way to identify potential memory usage
problems?
Some technical specifics: * TC 8.5.63 * Java 1.8.0_291 * AWS EC2
instance. * Windows Server 2016. * Instance started as Windows
Service. * There are other TC instances on the same server. * Each TC
instance has multiple apps.
Thanks for reading this far. :-)
What's the goal? Do you just Want To Know, or are you trying to solve an
actual problem.
If you have a bunch of garbage that's not being cleaned up, usually it's
because there is simply no need to do so. The GC is behaving according
to the 3 laws of rob..., er, 3 virtues of computing[1]:
1. Laziness: nothing needs that memory so... meh
2. Impatience: gotta clean that Eden space quick
3. Hubris: if I ever need more memory, I know where to find it
Seriously, though, the only real difference between the new gen and the
old gen is time, so if your query ran faster it might get a lot more of
its scratch objects cleaner-up without having to ask for a full GC.
How long does the query take to run? What kind of query is it? Are we
talking about something like SQL or some in-memory database or something
which really does take a lot of memory for the application to fulfill
the request?
[1] http://threevirtues.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org