V4.1.2: steadily increasing cpu load
Re: V4.1.2: steadily increasing cpu load
Yes, it is possible to make the other way and use modhttp.so from 3.2.3 in 4.1.2.
Re: V4.1.2: steadily increasing cpu load
Perhaps any of the 4.1.2 users can do that?
Raspberry Pi 3 Model B Rev 1.2
Raspbian GNU/Linux 10 (buster, 32bit)
RaZberry by Z-Wave.Me(327) ZW0700 7.21.00 07.42/1766938484 1025/257
Z-Way version v4.1.2 from 2023-10-18 03:34:26 +0300
Raspbian GNU/Linux 10 (buster, 32bit)
RaZberry by Z-Wave.Me(327) ZW0700 7.21.00 07.42/1766938484 1025/257
Z-Way version v4.1.2 from 2023-10-18 03:34:26 +0300
Re: V4.1.2: steadily increasing cpu load
Do we have more evidence? Can somebody help us investigate the issue in more details by providing us with the remote access?
Re: V4.1.2: steadily increasing cpu load
Surely there must be SOMEONE of all who reported increasing CPU load with more recent version that can assist the developers to examine this more thoroughly?

Re: V4.1.2: steadily increasing cpu load
Hey, someone ! 

Re: V4.1.2: steadily increasing cpu load
I actually wanted to wait a little longer and do some more tests before reporting my findings. But I'm convinced that I'm right.
The comments about garbage collection in other thread led me in the right direction. I was able to find the app that generates the growth and isolate the reason.
The app is doing socket communications. I made some changes and now I don't have CPU growth anymore in 4.1.2.
I have:
- consistently cleared all buffer variables as soon as they are no longer needed (>undefined)
- deleted a recursive function call with passing a buffer variable
Please look here for the result: In the left picture, you see there's no CPU load growing.
Interesting is the right picture.It shows the development of the memory of two different versions of the app:
- The last 5 days (week 06) a version without the recursive function call, but also without the explicit clearing of the buffer variables. The memory is growing, but suddenly is comes back.
- The 5 days before (week 05) the version without the recursive function call and now with the explicit clearing of the buffer variables in the app. The memory is constant.
I conclude from this:
- In 4.1.2 there is a problem with the release of buffers received from external. In my case It's socket communication, but this probably also applies to http communication.
- The problem was worsened by the recursive function call. This led to the growth of the CPU load.
As a workaround you can clear all buffers in the app.
Raspberry Pi 3 Model B Rev 1.2
Raspbian GNU/Linux 10 (buster, 32bit)
RaZberry by Z-Wave.Me(327) ZW0700 7.21.00 07.42/1766938484 1025/257
Z-Way version v4.1.2 from 2023-10-18 03:34:26 +0300
Raspbian GNU/Linux 10 (buster, 32bit)
RaZberry by Z-Wave.Me(327) ZW0700 7.21.00 07.42/1766938484 1025/257
Z-Way version v4.1.2 from 2023-10-18 03:34:26 +0300
Re: V4.1.2: steadily increasing cpu load
That is a great work!
Please let us know what was not released and which buffer you cleared to make it consume less memory and less CPU?
What was producing the high CPU? Was it the GC working? How have you changed this?
As for releasing buffers in the JS code versus letting the GC do it, I see a 20 Mb difference in memory (which is big!), but Z-Way is still handling it by clearing. I'm interested to see which buffer were you playing with to understand why wasn't it cleared on time.
Please let us know what was not released and which buffer you cleared to make it consume less memory and less CPU?
What was producing the high CPU? Was it the GC working? How have you changed this?
As for releasing buffers in the JS code versus letting the GC do it, I see a 20 Mb difference in memory (which is big!), but Z-Way is still handling it by clearing. I'm interested to see which buffer were you playing with to understand why wasn't it cleared on time.
Re: V4.1.2: steadily increasing cpu load
Hi PoltoS,
Your questions are difficult to answer.
Perhaps you should take a look at the code? Preferably all 3 versions for comparison. I can put this together in a clearly arranged form.
Your questions are difficult to answer.
Perhaps you should take a look at the code? Preferably all 3 versions for comparison. I can put this together in a clearly arranged form.
I agree, it looks very strange. And it continues looking strange: In the meantime, I only made a restart.As for releasing buffers in the JS code versus letting the GC do it, I see a 20 Mb difference in memory (which is big!)
Raspberry Pi 3 Model B Rev 1.2
Raspbian GNU/Linux 10 (buster, 32bit)
RaZberry by Z-Wave.Me(327) ZW0700 7.21.00 07.42/1766938484 1025/257
Z-Way version v4.1.2 from 2023-10-18 03:34:26 +0300
Raspbian GNU/Linux 10 (buster, 32bit)
RaZberry by Z-Wave.Me(327) ZW0700 7.21.00 07.42/1766938484 1025/257
Z-Way version v4.1.2 from 2023-10-18 03:34:26 +0300
Re: V4.1.2: steadily increasing cpu load
Let's separate memory usage and CPU load... I'm not even sure this is related.
Could you please show your code diff that lead to lower CPU usage?
Could you please show your code diff that lead to lower CPU usage?
Re: V4.1.2: steadily increasing cpu load
As I reported, I upgraded twice from 3.2.3 to 4.1.2. After the first time I had that CPU load growing, after the last upgrade not.
Since then, I have been doing a lot of testing and investigating because I wanted to know
what exactly solved the problem. And the result: I don't know.
I rolled back everything I had changed. But I couldn't reproduce the problem.
Only the Raspbian dist-upgrade I couldn't undo. Is it possible that the dist-upgrade had such an effect on Z-Way?
Since then, I have been doing a lot of testing and investigating because I wanted to know
what exactly solved the problem. And the result: I don't know.
I rolled back everything I had changed. But I couldn't reproduce the problem.
Only the Raspbian dist-upgrade I couldn't undo. Is it possible that the dist-upgrade had such an effect on Z-Way?
Raspberry Pi 3 Model B Rev 1.2
Raspbian GNU/Linux 10 (buster, 32bit)
RaZberry by Z-Wave.Me(327) ZW0700 7.21.00 07.42/1766938484 1025/257
Z-Way version v4.1.2 from 2023-10-18 03:34:26 +0300
Raspbian GNU/Linux 10 (buster, 32bit)
RaZberry by Z-Wave.Me(327) ZW0700 7.21.00 07.42/1766938484 1025/257
Z-Way version v4.1.2 from 2023-10-18 03:34:26 +0300