Page 1 of 1

Reset for memory usage?

Posted: Wednesday 11 February 2015 10:03
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?

Re: Reset for memory usage?

Posted: Wednesday 11 February 2015 10:21
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

Re: Reset for memory usage?

Posted: Wednesday 11 February 2015 10:26
by Toulon7559
Thanks!
;-) Before posting the question, I searched the forum, but apparently not with the appropriate keyword ........

Re: Reset for memory usage?

Posted: Wednesday 11 February 2015 10:38
by antwan

Re: Reset for memory usage?

Posted: Wednesday 11 February 2015 17:48
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.

Re: Reset for memory usage?

Posted: Wednesday 11 February 2015 18:37
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 .......

Re: Reset for memory usage?

Posted: Thursday 12 February 2015 13:31
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

Re: Reset for memory usage?

Posted: Thursday 12 February 2015 15:12
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.

Re: Reset for memory usage?

Posted: Thursday 12 February 2015 15:23
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 ;-)

Re: Reset for memory usage?

Posted: Friday 13 February 2015 18:01
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 ;)

Re: Reset for memory usage?

Posted: Wednesday 16 March 2016 6:17
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?

Re: Reset for memory usage?

Posted: Tuesday 05 April 2016 20:26
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

Re: Reset for memory usage?

Posted: Friday 28 April 2017 1:10
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 3043 times
This strange or not?
ScreenShot221.jpg
ScreenShot221.jpg (103.33 KiB) Viewed 3043 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 3043 times

Re: Reset for memory usage?

Posted: Friday 28 April 2017 1:16
by Derik
Domoticz.... Eating my CPU:
ScreenShot223.jpg
ScreenShot223.jpg (22.13 KiB) Viewed 3041 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?