Where on Hubitat can I view current memory usage?

Install Hub Info from HPM. Way too much info for one nurd :wink:

3 Likes

useful tip there, thank you @Rxich

On browsing mine, i see info like this:

2023-05-11 22:49:48,659056,0.77
2023-05-16 14:20:47,591796,0.01
2023-06-15 08:12:47,483316,0.0

(a few values from a long list)

It can be seen that the values, which i assume are available memory, get smaller so i assume eventually this will lead to a problem and may explain why i had a crash after a few months of my HB running.
Is this normal? Would this be the result of logs accumulating?
I am aware that a reboot will probably clear this up but then surely that would be covered by some form of tidy-up as part of the OS, unless there is a limit to how much memory logs (assuming it is this) can have.

PS- what is the 0.0x value after the comma?

Will keep an eye on this but may have to implement the auto-reboot on memory shortage rule.

The memory will decrease rapidly after reboot and then stabilize over time. Eventually it would stop decreasing altogether as the system gets low and starts to age out unused items in memory. That tends to happen once it geta low enough that the system starts to perform removal of older data. Initially it just leaves everything there incase it is needed. This is how java memory allocation works and typically isn't a bad thing.

You know, when I clicked on the link, I had previously bookmarked it!
But then again, I have a million bookmarks I never look at.

Columns are date/time, memory, CPU Load

so no need to worry about the diminishing memory value trends, as seen?

Still slightly concerned about the diminishing memory.
here are a few readings since the last reboot, less than an month ago:

Date/time,Free OS,5m CPU avg
2023-07-21 08:57:26,660432,0.72
2023-07-23 13:45:34,393960,0.05
2023-07-26 00:31:44,371336,0.04
2023-07-30 06:30:46,305036,0.05
2023-08-04 11:44:28,259792,0.04
2023-08-08 09:51:36,219908,0.13

Should i implement some house-keeping to avoid the inevitable?
remind me again, please, what is the minimum memory value required for a healthy system?

The hub will do clean up on its own, so it really isn't something to be to concerned about. It will also create an alert if it starts to run extreamly low. Memory being used is not inherently a bad thing. It is actually better to use as much as we can of it to maximize system performance. Memory management is also different based on OS and other criteria. This hub runs Linux with the meat of the HA platform running in a JVM. Both of them tend to keep things in memory more to keep performance high.

It varies depending on your appplication and device mix, but most people are good down to about 150-180K. 120K seems to be the absolute minimum.

1 Like

thanks, @mavrrick58 and @thebearmay for your reassuring comments.

Picking up on this thread, i have been watching my system memory dissappear since i last rebooted back in August. Given this trend, you think i can expect a system crash or freeze in the coming weeks?
I could manually reboot but should i really have to or will it take care of itself?

Date/time,Free OS,5m CPU avg
2023-08-14 14:03:46,659652,0.75
2023-08-15 02:22:50,583252,0.0
2023-08-18 14:52:13,362588,0.01
2023-08-20 08:22:12,327316,0.03
2023-09-02 17:53:46,230588,0.01
2023-09-06 21:32:02,208280,0.05
2023-09-10 04:11:28,204768,0.01
2023-09-15 07:37:52,212316,0.15
2023-09-17 16:49:36,226292,0.04
2023-09-28 12:52:34,196616,0.01
2023-09-30 23:55:07,191468,0.01
2023-10-02 22:53:37,145256,0.0

I would schedule a monthly reboot - at some time that it will not inconvenience your family. There is no "uptime" championship ...... :smiley:

1 Like

Wise words, thanks.
What is the most simple/recommended method (app?) where i and schedule a monthly reboot?

Install @thebearmay’s Hub Information Driver, and then use Rule Machine to schedule a reboot using HID.

1 Like

I reboot with a switch that's controlled by a rule, and is also on the desktop, just in case.

This is just what I do, maybe not ideal.
I'm trying to avoid apps as much as I can, but maybe that's not ideal either.

Here is the rule that actually reboots the hub:

Here is the rule that turns on the switch when memory gets low:

edit: I also put the hourly memory on the dashboard. Not as fancy as HID, but that's all I use.
image

Something to remember as well is using memory isn't in and of itself a bad thing. If your hub is fairly idle which your cpu avg numbers do indicate it is likely the hub just doesn't see a need to remove things from memory.

The linux OS and JVM combo that the hub uses are not as quick to free up memory as something like windows. Generally speaking in any computing environment you want to keep things in memory if possible as it is faster to access then pretty much any storage tech.

The problem occurs when you have a usage spike that needs to access more memory then what is free. If the usage stays flat then it isn't likely to cause an issue. My hub hardly drops once it gets down to around 180MB. Because our HE environments are all different though there is no one magic value for free mem that represents a problem. That said, a rule that will reboot the hub when it drops to a point is not a bad thing. I have a Rule in RM that looks at the memory at 3am (before DB Backup) and then if it is below 120MB will initiate a reboot. I only check at 3am since generally speaking there are not huge drops for me and i only want it to reboot over night for this to prevent unexpected HA issues during the day.

It is also nice to graph with Webcore, or the combination of Influxdb Logger, INfluxdb, and Grafana as shown below. I like the later because it gets all of the processing off the hub.

Here you can see my last reboot and where it is now. That graph though does a great job of showing how the lights flattens out. So overtime it shouldn't be a issue.

That said it is more important to do a graceful restart then allow it to lock and have to pull power. That can corrupt the database and sometimes in ways that are not obvious.

thanks, and i apoligise for any repeats as i'm aware i discussed this issue a few months ago)
I'm still on FW 2.3.4.153 (reliable- if it aint broke dont fix it) and i dont see the Hub information driver app so guess i will have to install as a custom app?
Any tips on this or should i hang on a bit longer and see if HE looks after its own available memory?
thanks all

It's a driver,

1 Like

If i remember right that is the firmware right before the C-8 was released. There were many improvements that have gone in since then, so you may see benifit.

Do you use HPM(Hubitat Package Manager) that is a community app that makes finding apps easy. If you do not i would suggest get it to make finding things allot easier.

In many ways it does. They JVM that it is running on has a process called garbage collection that will free up memory as it sees it is needed. They key with that statement is as it is as needed. If there is allot of free ram it may leave things in memory to improve performance.

1 Like

Given that this is such a talked about thing not sure why freeMemory isn't exposed on one of the hub pages; setting/details, settings diagnostics or what ever. Or all of it; CPU%, memory, temperature, etc.. on a new settings tab "Hub Operating Stats" or something.