Reset for memory usage?

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.

Moderators: leecollings, remb0

Post Reply
Toulon7559
Posts: 859
Joined: Sunday 23 February 2014 17:56
Target OS: Raspberry Pi / ODroid
Domoticz version: mixed
Location: Hengelo(Ov)/NL
Contact:

Reset for memory usage?

Post by Toulon7559 »

Domoticz@RPI at my place as a server runs silently and steadily in the background.
Just curious how the processor behaves, I looked in Domoticz at RPI_MemoryUsage: see the attached file
The diagram shows a slow dayly increase in usage.
Not much per day, therefore plenty of space left, but at a certain future time it will hit the limit.
Remedy is simple: shutdown & reboot. But that is an on-purpose interruption to continuous operation.
;-) For lazy users of Domoticz@RPI: is there a way, either to automatically stop that increase, or to periodically reset to a low value of memory usage?
Attachments
RPI_MemoryUsage 2015-2-11 9 44 57.png
RPI_MemoryUsage 2015-2-11 9 44 57.png (289.62 KiB) Viewed 5596 times
Set1 = RPI-Zero+RFXCom433+S0PCM+Shield for BMP180/DS18B20/RS485+DDS238-1ZNs
Set2 = RPI-3A++RFLinkGTW+ESP8266s+PWS_WS7000
Common = KAKUs+3*PVLogger+PWS_TFA_Nexus
plus series of 'satellites' for dedicated interfacing, monitoring & control.
User avatar
gizmocuz
Posts: 2549
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: Reset for memory usage?

Post by gizmocuz »

This has been discussed before on the forum and is almost certain it are internal cache file of the systems that gets deleted when more memory is needed
Quality outlives Quantity!
Toulon7559
Posts: 859
Joined: Sunday 23 February 2014 17:56
Target OS: Raspberry Pi / ODroid
Domoticz version: mixed
Location: Hengelo(Ov)/NL
Contact:

Re: Reset for memory usage?

Post by Toulon7559 »

Thanks!
;-) Before posting the question, I searched the forum, but apparently not with the appropriate keyword ........
Set1 = RPI-Zero+RFXCom433+S0PCM+Shield for BMP180/DS18B20/RS485+DDS238-1ZNs
Set2 = RPI-3A++RFLinkGTW+ESP8266s+PWS_WS7000
Common = KAKUs+3*PVLogger+PWS_TFA_Nexus
plus series of 'satellites' for dedicated interfacing, monitoring & control.
antwan
Posts: 116
Joined: Saturday 13 July 2013 13:28
Target OS: Linux
Domoticz version: Latest
Location: Hilversum, The Netherlands
Contact:

Re: Reset for memory usage?

Post by antwan »

Rasp Pi 2B: 3x DS18S20 (1-wire), BME280 (i2c)
Cubietruck 1: Aeotec Z-Wave+, RFXtrx433XL+P1, RFXtrx868, TE923 display, SolarEdge API
Cubietruck 2: Aeotec Z-Wave, Voltcraft CO-20
User avatar
Conn-artist
Posts: 21
Joined: Saturday 12 July 2014 12:06
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8367
Location: 127.0.0.1
Contact:

Re: Reset for memory usage?

Post by Conn-artist »

In Linux-land, unused memory is wasted memory. So you don't have to worry about going into the direction of the 100%.

Having said that, it is of course possible that some progress is not freeing up memory properly.

Of paramount importance is that your system does NOT start to use its swap memory, as this will dramatically lower performance and also decreases the lifetime of your Raspberry Pi's SD card. Swap usage can be monitored with the command line tool top.

A much better tool than top is atop. It will show you the growth ('delta') of memory use, per process. So if some process is just humming along but its memory use is continuously increasing, something might be wrong.

And it shows a whole lot of other interesting parameters as well. Get it at http://www.atoptool.nl.
--
Martijn
Toulon7559
Posts: 859
Joined: Sunday 23 February 2014 17:56
Target OS: Raspberry Pi / ODroid
Domoticz version: mixed
Location: Hengelo(Ov)/NL
Contact:

Re: Reset for memory usage?

Post by Toulon7559 »

@Martijn,

;-) Perhaps my view is clouded by (bad) 'Windows'- experience:
there the message 'lack of memory' (or equivalent) is sign for eminent problems (at least).
In this perspective Linux is better, but sometimes I forget .......

My Raspberry is only running Domoticz, and then seeing such increase causes some thoughts .......
Set1 = RPI-Zero+RFXCom433+S0PCM+Shield for BMP180/DS18B20/RS485+DDS238-1ZNs
Set2 = RPI-3A++RFLinkGTW+ESP8266s+PWS_WS7000
Common = KAKUs+3*PVLogger+PWS_TFA_Nexus
plus series of 'satellites' for dedicated interfacing, monitoring & control.
User avatar
Siewert308SW
Posts: 290
Joined: Monday 29 December 2014 15:47
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: The Netherlands
Contact:

Re: Reset for memory usage?

Post by Siewert308SW »

As mentioned in the thread earlier.
Unused Memory in linux is wasted memory.
I'm comfortable if Domo is running with 70 and 90 % usage.
But i do notice that above 90% domo is starting to react slow and domoticz service is halted on random times.
When rebooted it will take almost 12hr to slowly increase memory above 90%
There for i use a lua script so the system is rebooted when the memory is above 90% and only a night time ti ensure the system is running idle and no events are running.
Don't remember where i got the script but it aint mine.

Code: Select all

--script_time_memory.lua
t1 = os.date("*t")
memory = tonumber(otherdevices_svalues['Memory Usage'])
commandArray = {}
if ( memory >= 90 and t1.hour >= 2 and t1.hour < 5 ) then
      commandArray['SendNotification']='Raspberry rebooted#Memory usage exeeded more then 90 procent!'  
        os.execute('curl -s -i -H "Accept: application/json" "http://192.168.178.11:8080/json.htm?type=command&param=system_reboot"')
end
return commandArray
Setup:
- RPi4 - Domo Stable / Aeotec Z-stick7 / PiHole Unbound Gemini
- RPi4 - PiHole / PiVPN Unbound Gemini
- Synology DS923+ / DS218j
- P1 Gas/Power, SmartGateway watermeter
- Fibaro switches, contacts, plugs, smoke/Co2 ect
- rootfs @ USB HDD
User avatar
bizziebis
Posts: 182
Joined: Saturday 19 October 2013 14:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8805
Location: The Netherlands
Contact:

Re: Reset for memory usage?

Post by bizziebis »

You can also use:

Code: Select all

sudo sh -c "sync; echo 3 > /proc/sys/vm/drop_caches" >/dev/null 2>&1
To free up memory. It will clear the cached memory.
User avatar
Siewert308SW
Posts: 290
Joined: Monday 29 December 2014 15:47
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: The Netherlands
Contact:

Re: Reset for memory usage?

Post by Siewert308SW »

bizziebis wrote:You can also use:

Code: Select all

sudo sh -c "sync; echo 3 > /proc/sys/vm/drop_caches" >/dev/null 2>&1
To free up memory. It will clear the cached memory.
Yep... but had a couple of bad experiences with that.
After monitoring it it became clear to me.
That domoticz was busy with an event because someone was awake in the time set to flush the cache.
And there for all light were switched on all night.
There in my personal case i rather use the reboot option to ensure all events are continued ;-)
Setup:
- RPi4 - Domo Stable / Aeotec Z-stick7 / PiHole Unbound Gemini
- RPi4 - PiHole / PiVPN Unbound Gemini
- Synology DS923+ / DS218j
- P1 Gas/Power, SmartGateway watermeter
- Fibaro switches, contacts, plugs, smoke/Co2 ect
- rootfs @ USB HDD
User avatar
Conn-artist
Posts: 21
Joined: Saturday 12 July 2014 12:06
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8367
Location: 127.0.0.1
Contact:

Re: Reset for memory usage?

Post by Conn-artist »

Siewert308SW wrote:When rebooted it will take almost 12hr to slowly increase memory above 90%
My most recent 'high' uptime was 78 days. And I did not notice that at the end Domoticz was running slower than on the first day. Also running Nginx on that wee box (the 'old way' to add an SSL proxy).

But then, I don't use a lot of scripts and just a few interfaces that create events ;)
--
Martijn
Toulon7559
Posts: 859
Joined: Sunday 23 February 2014 17:56
Target OS: Raspberry Pi / ODroid
Domoticz version: mixed
Location: Hengelo(Ov)/NL
Contact:

Re: Reset for memory usage?

Post by Toulon7559 »

Occasionally my setup with Domoticz@Raspberry ' locks' and appears completely dead, although all leds still bright.
Not nice if used for registration of PV-production etc., including uploads to PVOutput.org
Alerted by an earlier occurence of apparent 'self-healing' at latest 'lock' I decided to wait and see.
11th of March at 07:00 all uploads to PVOrg etc. stopped, and without any action from my side at 15th of March 20:50 the uploads restarted. See e.g WWZ_7559A0 at PVOutput.org.
Can anybody explain this 'magic' revival?

But on 28th of march after such 'lock' the upload by the python-script to that webaccount does not restart, while the lua-scripts for other functions run.
Any explanation why apparently the python-script reacts in a different way than the lua-scripts?
Set1 = RPI-Zero+RFXCom433+S0PCM+Shield for BMP180/DS18B20/RS485+DDS238-1ZNs
Set2 = RPI-3A++RFLinkGTW+ESP8266s+PWS_WS7000
Common = KAKUs+3*PVLogger+PWS_TFA_Nexus
plus series of 'satellites' for dedicated interfacing, monitoring & control.
punter9
Posts: 18
Joined: Thursday 13 August 2015 4:36
Target OS: Windows
Domoticz version:
Contact:

Re: Reset for memory usage?

Post by punter9 »

add me to the list of people having memory issues. Running a ps -aux shows that at a point in time when my system had ~64% of memory used domoticz was using 51%, node red 10%, and the rest minor pieces. Domoticz is the only program that the memory use increases (if system is at 95% domoticz is about 82%).

Right now I am just using crontab -e

sudo service domoticz.sh stop
sudo service domoticz.sh start (1 minute later)

so clearly there is some memory issue. It likely needs to start releasing memory as intended at a much lower level because over 90% this thing starts crashing out, nodes work spottily, server shuts down, general undesirous behaviors commence

edit:
raspberry pi B+
domoticz v3.4834
mysensors nodes
Derik
Posts: 1602
Joined: Friday 18 October 2013 23:33
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Arnhem/Nijmegen Nederland
Contact:

Re: Reset for memory usage?

Post by Derik »

My CB is running not fine..
many times a reboot, without a reason for me ... :oops: :oops:
Is this perhaps the problem:
ScreenShot220.jpg
ScreenShot220.jpg (24.97 KiB) Viewed 3034 times
This strange or not?
ScreenShot221.jpg
ScreenShot221.jpg (103.33 KiB) Viewed 3034 times
Looks from the 19 april there is high use of memory..
Is there a option to reset this?

And my Cpu:
ScreenShot222.jpg
ScreenShot222.jpg (107.48 KiB) Viewed 3034 times
Last edited by Derik on Friday 28 April 2017 1:17, edited 1 time in total.
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups
Derik
Posts: 1602
Joined: Friday 18 October 2013 23:33
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Arnhem/Nijmegen Nederland
Contact:

Re: Reset for memory usage?

Post by Derik »

Domoticz.... Eating my CPU:
ScreenShot223.jpg
ScreenShot223.jpg (22.13 KiB) Viewed 3032 times
Can i look in in domoticz what the cpu uage is?

Strange that root is the owner..
Linaro should be the Domoticz user?
Or is root a user of Domoticz to?
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest