Many thanks for the useful comments. I threw this system together in a rush and with very little thought. It’s just the unmodified ruuviberry image and I have left it to do its own thing for a number of months. Worked fine as a proof-of-concept and has produced some useful information on the building’s performance.
I suspect it would be wiser to just use the Raspberry Pi to collect the data from the RuuviTags and forward it somewhere else for longer term storage and analysis! Running grafana-server on the Raspberry Pi accessing data for long time periods may well have been the source of the out of memory issues.
For production hardware it would probably be wise to have some form of UPS to protect the Raspberry Pi from power outages. One possibility might be a PiJuice HAT.
The Ruuvi Dongle might be an alternative to a Raspberry Pi. Note that it only uses USB as a power supply (similar to the ZigBee CAD for Smart Meters which can be used to monitor electricity and gas usage.
For storage of time series data InfluxDB (1.x or 2.x) or Prometheus look like the main options.
For Bluetooth LE scanners bluewalker is another option.
Time for some more investigation …