Memory leaks?

Discussions about RaZberry - Z-Wave board for Raspberry computer
Post Reply
pz1
Posts: 2053
Joined: 08 Apr 2012 13:44

Memory leaks?

Post by pz1 »

I am only running v1.7.2 with HA where I have defined:
  1. Battery polling,
  2. Pol sensors periodically,
  3. Logical rules
The logical rule is not functioning properly as I have reported in an other thread.
Because my system tends to crash, I am recording memory usage as requested by PoltoS. Below in the screendump are a couple of reports that show that in some 3 days, the used memory has almost doubled from 93064 to 169668.
My installation is based on NOOBS.
memory.PNG
memory.PNG (326.71 KiB) Viewed 13598 times
Update: Now five days after the start used memory has risen to 226120. Half of the total.
Since 29-12-2016 I am no longer a moderator for this forum
pz1
Posts: 2053
Joined: 08 Apr 2012 13:44

Re: Memory leaks?

Post by pz1 »

The 6th day after the start of the above experiment, I did remove all automation modules in the preferences menu. Still as the image below shows, the amount of free memory continues to decrease, though it looks as if it is at a somewhat slower pace.
usage20140903-10.31.PNG
usage20140903-10.31.PNG (14.08 KiB) Viewed 13468 times
Only 203776 free now on day 8.

EDIT: 20140917: Since this post I did get the following two updates from Poltos via mail:
LEt me discuss this with pofs, but I don't see any critical things in your data: Look at RSS columnt. 22 Mb memory usage is pretty ok.

Does the overall free+cached memory goes down during time?
PS
looked a bit more. seems like it is not Z-Way eating all memory. And even not sure if it is - look at buffered + chached + free. It is almost constant. This is easy to check using some program that really eats memory - kernel at some point will decide to free buffers and cache to give it to the eater.

PS
I did not yet have the time for further experiments
Last edited by pz1 on 17 Sep 2014 15:51, edited 1 time in total.
Since 29-12-2016 I am no longer a moderator for this forum
kickus
Posts: 33
Joined: 13 Aug 2014 14:33

Re: Memory leaks?

Post by kickus »

It seems that I'm experiencing the same kind of memory leak.
I have a frequent polling of several electricity meters (5 devices, 17 values), and the z-way network gets unstable after a few days when the raspberry gets out of memory.

It appears as strange behavior. Some values does not get updated anymore (but others does). top command showed that z-way-server uses 65.9% memory and about 80-99% CPU. Free -h revealed that 418M was in use and 18M free.

After a z-way-server restart, the top command showed 4.4% memory usage, 10.2% CPU, and free -h 150M used, 286M free.

This was less than 5 days since reboot.
pz1
Posts: 2053
Joined: 08 Apr 2012 13:44

Re: Memory leaks?

Post by pz1 »

@kickus
I did update my post with some remarks I received later via email
Since 29-12-2016 I am no longer a moderator for this forum
Lumberjack
Posts: 26
Joined: 04 Mar 2014 03:31

Re: Memory leaks?

Post by Lumberjack »

I do not have any issue with the CORE 1.7.2 release since 42 days of continuous uptime and very stable operation. The only thing I did was REMOVE all home automation which I do with my own python code. Before that, I also experienced performance degradation.

Since we are all posting tops, here is copy I made after 42 days (This particular Raspberry has 32 Z-wave devices connected):

top - 17:46:35 up 42 days, 6:32, 1 user, load average: 0.15, 0.18, 0.21
Tasks: 68 total, 1 running, 67 sleeping, 0 stopped, 0 zombie
%Cpu(s): 9.4 us, 3.0 sy, 0.0 ni, 87.6 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
KiB Mem: 447996 total, 435492 used, 12504 free, 77404 buffers
KiB Swap: 102396 total, 0 used, 102396 free, 231104 cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
2049 root 20 0 501m 55m 3248 S 5.9 12.7 2954:11 z-way-server
dubliner
Posts: 3
Joined: 23 Sep 2014 22:08

Re: Memory leaks?

Post by dubliner »

Lumberjack wrote:I do not have any issue with the CORE 1.7.2 release since 42 days of continuous uptime and very stable operation. The only thing I did was REMOVE all home automation which I do with my own python code.
Can I ask how you trigger an update?
I've tried logging using HA but after a week I've an average of two temperature readings a day, probably from manual updates I did via the blue UI.
So now I'm trying this in a cron job:
wget "http://localhost:8083/ZWaveAPI/Run/devi ... 49].data[1]"
Is this the best format command for me? Does anyone know how I force an update of either the Fibaro Universal with temperature sensors, or a Topp 123658 power meter?

Any ideas much appreciated.
kickus
Posts: 33
Joined: 13 Aug 2014 14:33

Re: Memory leaks?

Post by kickus »

It seems to me that version 1.7.2 is still consuming quite much memory. Uptime: 1 day, 23:16
memory leaks with 1.7.2
memory leaks with 1.7.2
z-wave-memory.PNG (32.44 KiB) Viewed 12483 times
kickus
Posts: 33
Joined: 13 Aug 2014 14:33

Is it just me?

Post by kickus »

I'm not using any automation at all. I do not do any polling.
I'm just running the controller function.

In about 22 hours, the z-way-server has consumed notably amount of the raspberry memory.
As earlier mentioned, I'm running version 1.7.2.

Is this a problem that everybody is phasing, or is it just me?
Memory wasted again
Memory wasted again
z-wave-memory2.PNG (20.74 KiB) Viewed 12360 times
...in about 22 hours
...in about 22 hours
z-wave-memory3.PNG (4.01 KiB) Viewed 12360 times
pz1
Posts: 2053
Joined: 08 Apr 2012 13:44

Re: Is it just me?

Post by pz1 »

kickus wrote: Is this a problem that everybody is phasing, or is it just me?
I would rephrase that as: or is it just us?

I still haven't solved it. Please note that you have a few more processes running than I do. My installations are based on the standard virgin image, where I prevented openremote to run (see other thread on this forum). The latter has improved my situation a bit
Since 29-12-2016 I am no longer a moderator for this forum
kickus
Posts: 33
Joined: 13 Aug 2014 14:33

Is it just us?

Post by kickus »

pz1 wrote:
kickus wrote: Is this a problem that everybody is phasing, or is it just me?
I would rephrase that as: or is it just us?
Sorry pz1, thanks for pointing out that you're still suffering the same problem.
According to your signature, you're running Z-Way 2.0.0-rc8, and it seems to have the same troubles as 1.7.2.

My image is not much modified either. Compared to a virgin image, I do run a node js script that extracts interesting data from the z-way http interface into files on small ramdisk. I do also run a bash script that forwards the data to a centralized server (using curl). The purpose is to collect energy monitoring data from many similar raspberries (within an EU project). Both of my scripts are quite simple and light weight (both in functionality and footprint) compared to the z-way-server.

I had to restart my z-way-server process now, because the raspberry began to jam. I did also stop the openremote process in order to follow up whether it has any affect for me. After the process restart, the z-way ui is snappy and responsive again.

The raspberry has even started to swap to the sd card. :|
Attachments
z-way-server after service restart.PNG
z-way-server after service restart.PNG (29.73 KiB) Viewed 12327 times
Post Reply