WeeWX abnormal memory consumption problem

54 views
Skip to first unread message

Remy Lavabre

unread,
Jul 5, 2025, 6:59:46 AM7/5/25
to weewx-user
Hello,

I'm using the latest version of WeeWX (5) in a venv virtual environment with an 8GB Raspberry Pi 5. It's been working very well for almost two years.

I had to create a driver specific to my Bresser weather station. This driver retrieves the data automatically sent to the Awekas website by my weather station, as well as various other data (Raspberry data, heat pump, electricity consumption, water consumption, etc.).

The problem: Memory consumption increases steadily over time, reaching 8GB after about two months (see attached diagram). It's the WeeWX task that consumes all this memory. After that, WeeWX stops without a message, but the Raspberry Pi continues to run without crashing.
The only solution I've found to avoid this problem is to set up a cron job that closes WeeWX once a week and restarts it automatically. The memory is freed up automatically.

I think the problem comes from the driver since everything else is standard (basic WeeWX installation without any modifications)? However, I followed the examples of the other drivers (simulator and other examples provided) and it has worked perfectly for 2 years... Does anyone have any idea where the problem could come from?

Thank-you...

Memory after reset Weewx (by week) :
Capture d’écran du 2025-07-05 08-40-02.png
Memory afetr reset WeeWX (by Month) :
Raspberry.png


Rick M0LEP

unread,
Jul 5, 2025, 8:13:41 AM7/5/25
to weewx...@googlegroups.com
On Sat 05 Jul Remy Lavabre wrote:
> The only solution I've found to avoid this problem is to set up a cron job
> that closes WeeWX once a week and restarts it automatically. The memory is
> freed up automatically.

Python's long had problems with memory leaks one way or another. Long
ago I set up a daily cron job that stops weewx, takes a backup of the
database, and re-starts it. It's seldom down for more than a few
minutes, and the memory gets cleaned up at least daily...

Another Pi-based system I'm using does a lot of very intensive imaging
work in a Python framework during the hours of darkness. It goes a step
further, and re-boots the Pi every day at a slack time of day to avoid
memory-leak-related problems. Of course that Pi is dedicated solely to
that task, so there are no other users to be caught out by sudden
re-boots.

--
73, Rick, M0LEP

Reply all
Reply to author
Forward
0 new messages