cmon service graphs of mem_used on RPi

105 views
Skip to first unread message

Neil Trimboy

unread,
Jul 27, 2017, 4:04:14 AM7/27/17
to weewx-user
I'd be grateful if someone could post some cmon service graphs of mem_used of weewx running on a Pi.
Id like to know/see typical use.
Attached is mine...I am in the process of setting up my weewx install. so the large spikes are updates/installs and several reboots, but it looks like I have a memory leak somewhere, which would not be a surprise and I have some bits of my own code running....

Thanks


vince

unread,
Jul 27, 2017, 4:34:53 PM7/27/17
to weewx-user
I'm not using cmon, I'm using an extension approach that originated with Tom, but mine are at http://www.skahan.net/weewx/mem/ - plots are day/week/month/year if it's not obvious.  I'm running on a little ARM processor that only has 128MB of RAM, so I'm guessing some of the bumps are the kernel cleaning up automagically perhaps.  The big spike before 1/1/17 was me running the forecast module that basically ran amok somehow when I tried to update it.   Other spikes last summer and fall were an old forecast module and I think the weewx-wd module.  I turned them off before the end of 2016 and things got very stable here in terms of memory.

The code and skin that I use is in my github repo at https://github.com/vinceskahan/vds-weewx-v3-mem-extension which installs pretty easily with the extension installer.  It sets up a separate 'mem' database to store stuff.  Hopefully the readme there is suitably obvious.

gjr80

unread,
Jul 27, 2017, 6:57:43 PM7/27/17
to weewx-user
Hi,

Sure looks like a memory leak to me. In my experience once weeWX has been running for at least an hour your memory usage should have settled down to a fairly steady state. How much it uses depends on what extras(extension, own code, skins etc) you have added to weeWX. You will find that with a leak weeWX will continue to run until some magic level of memory usage is reached and then 'things' will not work. In my case I had a fairly aggressive leak that chewed up about 1.5G over 7 days and then weeWX would continue to run but reports stopped being genereated, you could almost set your watch by the time it took from restart to when weeWX experienced issues. Until I got around to tracking down th eleak I was restarting weeWX every few days to avoid the lights going out.

How to fix it? First thing is to identify the leaker. I guess there are a number of approaches; I have seen Matthew mention some python tools, OK I guess if you know what you are doing with python. The low tech approach is to disable everything except the standard weeWX functionality, cmon (I have found cmon to be stable) and any extras that 'add data to your database' (don't want to lose data) and see if the leak disappears. If still leaking then cut back to standard weeWX and cmon only, that should rule out any python libraries and most likely point the finger at those extras that are adding data to your database (if you have any). If no leak, then start adding your 'extras' back in one at a time restarting weeWX each time. Can be a slow process as you might need to wait for an hour or two to see if you are leaking or not after a change. Depending on what 'extras' you have you might be able to target some of them, the bigger more complex ones might be candidates. In the past I have had some issues with the forecast extension, it (or more correctly the way I was using its product in reports) was the cause of my big leak, I removed the extension and the leak disappeared. I added it back in but reworked the way I included its product in my reports and I have not had a problem since. So sometimes the fix can be subtle.

Not the definitive guide to memory leaks, and I am sure a few others will have different advice, but this is the approach I have taken in the past.

Gary

Thomas Keffer

unread,
Jul 28, 2017, 12:33:27 AM7/28/17
to weewx-user
It would be helpful if we knew what platform you are running weewx on. Hardware + operating system + kernel number + Python version.

And, what do you mean by "bits of my own code?" What language?

-tk

--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Luc Heijst

unread,
Jul 30, 2017, 5:47:06 PM7/30/17
to weewx-user
Hi Neil,

Attached three monthmem graphs from cmon.
21: Raspberry PI 2 running three instances of weewx: vantage driver, meteostick driver and klimalogg driver.
31: Raspberry PI 3 running weewx simulator driver and taking webcam snapshots between 07:00 and 19:00 each two minutes.
32: Raspberry PI 3 running weewx simulator driver and taking webcam snapshots between 07:00 and 19:00 each two minutes.


Cheers, Luc
monthmem_21.png
monthmem_31.png
monthmem_32.png

Neil Trimboy

unread,
Aug 2, 2017, 5:31:54 AM8/2/17
to weewx-user
Thanks for those, that gives me an idea.
I am on a Pi3 and continuing investigations/bringing my station to life.
Reply all
Reply to author
Forward
0 new messages