Sorry, I will explain the confusion regarding the admin graphs at the end of this post. For now, let me move on to the original goal, confirming if Lucee is using the max heap that you expect it to be. Fortunately there are a few other ways you can find that.
And if you confirm it is indeed what you expected, I have another more specific suggestion about FR for you, about really finding what’s USING heap.
1. Finding the heap amount for Lucee
First, the actual heap value set can be found in the Lucee/Tomcat logs. See either the
lucee-stderr log, as may be found in your
lucee\tomcat\logs (though different deployment types may offer these logs in differently named folders). In either log, one of the lines tracked during the instance startup should look something like this:
16-Jul-2022 15:46:37.131 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xmx256m
Second, for someone WITHOUT access to the logs (or FR), you can get a CLOSE (but not EXACT) approximation of what the heap max (xmx) was, using this java object and method:
That will be in bytes, so if you divide it by 1024/1024, that will be in mb. Again, it’s not EXACTLY the same as the XMX, because we don’t really get the exact value in the XMX, but for instance I found that with an XMX of 256mb this reported 240mb, while for an XMX value of 1024 it reported 910. (The difference between the actual and reported value may vary for any number of reasons.) At least this will give a reasonable indication of whether the value you THINK you set is indeed what the max JVM heap size is.
Third, FWIW, FusionReactor also shows in multiple places what the heap max is (either that “reported max heap” or the actual XMX value), because again it can be very important to be able to confirm that.
Again, my original point is that some people set the XMX in some given way but then it may turn out that Lucee/Tomcat for some reason does NOT use that value they set, so their heap may be far smaller than they think, leading to OutofMemory errors.
2. Moving on to what MAY be causing excessive heap use
If this is NOT your issue, then I realize you will wonder, “so what’s causing me to run out of memory?” Zack and others have offered some suggestions.
I would assert again that FR can really be the next best tool for finding what’s amiss. And some good news is that in my FR video playlist, one of them is specifically, “Troubleshooting JVM memory problems with FusionReactor”.
Hope that may be helpful. While it’s now a few years old, I just watched it also and feel it still conveys the primary points I would make in helping someone address memory problems.
That said, I would add one concluding topic–and I will, if I ever reprise it–for some people, raising the heap used really is the right solution. It may feel like you’re just “delaying the inevitable” if you would hit it again, but often I help people find that for their typical workload and nature of their app (and without focusing on reducing heap use), there may be some heap size value (above what they’re using) where things simply remain stable for days, weeks, or months of uptime. That may be good enough.
I understand in your case @thequeue you would likely feel that’s not the right solution, as it seems “nothing has changed” for you but Lucee reinstallation. So you really want to know “what is causing MY out of memory problem”. And that’s why I have been pressing the first point. And perhaps using FR (or the techniques Zack and others may offer) will help you.
As always, I do write my replies in a way and with the hope that I may help even more readers than the one person who is asking a question. Maybe they may still take value from all the above.
3. A change in the Lucee Admin graphs reporting heap values
Finally, let me now address the confusion over the Lucee Admin heap info. I see now that the version you are on (and indeed that screenshot in the docs) do NOT allow you to see that info.
It’s not that I was saying it would show the min and the max. Instead, I was recalling how the memory graph would (in the past) at least help you confirm if the max was at least close to whatever you felt you’d set it to.
Let me explain first how:
- In earlier releases, that graph DID offer more. See my attached screenshot below.
- Notice how I show it depicting that if you moused over the memory graph, it popped up additional info reporting the heap
in use. One could add those together to see if that was close to what you expected the heap max to be. (Like the java method calls above, it would not be EXACT but it would be close).
As for what changed and when, for anyone interested:
- Notice first that my screenshot shows it’s from a 188.8.131.52. I know it’s a bit old. I just had not yet updated this Lucee instance for a while, on one of my dev machines. Anyway, when I wrote my previous reply from my phone, I was recalling having seen these mem used/available details in the past in Lucee
- And I know @thequeue indicated they were on 184.108.40.206. So once I returned home, I did update to that version first, and I see now that the graph looks a bit different (indeed it looks like what was in that docs page)
- Sadly somehow they have REMOVED the feature where you could mouse over the graph, to have it popup with those available/in use values. (And I even updated to the latest available release, 220.127.116.11, and it’s still this way. I even went to the latest available 6 snapshot, 18.104.22.168, and the graph is as in 5.3.) I don’t know when things changed from the graph in the screenshot below. I did try to find that but could not.
- Finally, FWIW, I did indeed look at that doc page before sharing the URL in my first reply about it above. I just didn’t know if the lack of it showing the popup (of available/in use memory) was simply because whoever took that screenshot didn’t think to show it. I just wanted to be able to point to the only doc page I could find which offered that admin memory graph image at all.
Sorry it led to the confusion, but this all may interest some.