2017-03-07, 21:36
First off, this is a mem.log from this afternoon running with Xonfluence. Just out of curiosity
http://sprunge.us/XKic
Sadly there wasn't any crashes as I did hope we get some useful information out of them because of having debug symbols ;(
Results:
Ok, what definetly is to state is, one query after the other, giving every query time to finish, shows correct behaviour as fas as I can tell. You can see that from the beginning of the mem.log. It's about 420MB free and each query uses up memory but releases it again short time afterwards.
I first tried JSON 3 with N=800, N=1500, N=3200, N=6400 and N=10000. Sadly (luckily) I can't reproduce a leakage with this.
Then I tried JSON 2 and got the same beahviour.
What's relevant, as LDP not only asks MyMusic, but also MyVideo, is that when multiple queries come together, the memory isn't recovering (buffering/cache?). For it being a caching issue speaks, that later on some queries do not use up memory so the queriy seemd to be cached/buffered.
It is viewable from the mem.log, that from starting with 420MB free, we do not get this allocated memory back, Mem.log is kept running while I'm writing and is about 313MB free atm with no sign of coming back to 420... (it isn't 420 friendly so to say
So from my observations and tests the following is to be kept:
* limiting the number of queried items (N) not uses up that amount of memory as JSON 2 (logical)
* running only one qurey after the other (even JSON 2) leads to memory being allocated and freed again.
* JSON 1 is definetly out of the race. Even fireing up 10 queries in a row doesn't hurt
* Once doing multiple heavy queries "simultaniously", in this case here multiple JSON 2 (like LDP probably does as it also queries Movies, Series, etc) eats up memory without giving it free again. (I would maybe need to adapt the mem.log script to also take buffers/cache into account)
* In some cases issuing a query after waiting some time frees up memory!?
* Multiple queries at once or in a short time lead to using up memory without giving it free again completly (no 420 reached ever agin). So if not after say 10-20min the buffers/cache aren't given free again or being reuseable, the memory fills up slowly but steady, You can see that in logs at about 22:40 when I fired 3 Json 1, 3 Json 2 and 3 Json 3 (N=3200) and after that 5 JSON 2 reduces memory from about 300MB to 220MB without freeing.
* Remarkable: Even JSON 2 takes round about 400ms on mysql side, but 30sec until web request is finished!!
* I let the mem.log run a little more now (10min) until I upload the logs for to see if memory returns...
I'll check against Chewitt's build asap
One thing I have to tell is, the Amlogic Box running kszaq's build is not using the same AudioDB as the RPi...
It has 2 profiles. One using another audio source (Audiobooks and Radioplays) with far less files! I'll let it run on the other profile against the "normal" music and see ... sorry, forgot about that somehow. So maybe also the Amlogic Box is suffering ^^!
So, now it's 10min later and mem is only up to 255MB free, so I'll upload...
kodi.log & memory.log
Gn8
http://sprunge.us/XKic
Sadly there wasn't any crashes as I did hope we get some useful information out of them because of having debug symbols ;(
Quote:Code:
SELECT count(idAlbum) as albumtotal FROM album;
Code:
MariaDB [MyMusic60]> SELECT count(idAlbum) as albumtotal FROM album;
+------------+
| albumtotal |
+------------+
| 8106 |
+------------+
1 row in set (0.15 sec)
Results:
Ok, what definetly is to state is, one query after the other, giving every query time to finish, shows correct behaviour as fas as I can tell. You can see that from the beginning of the mem.log. It's about 420MB free and each query uses up memory but releases it again short time afterwards.
I first tried JSON 3 with N=800, N=1500, N=3200, N=6400 and N=10000. Sadly (luckily) I can't reproduce a leakage with this.
Then I tried JSON 2 and got the same beahviour.
What's relevant, as LDP not only asks MyMusic, but also MyVideo, is that when multiple queries come together, the memory isn't recovering (buffering/cache?). For it being a caching issue speaks, that later on some queries do not use up memory so the queriy seemd to be cached/buffered.
It is viewable from the mem.log, that from starting with 420MB free, we do not get this allocated memory back, Mem.log is kept running while I'm writing and is about 313MB free atm with no sign of coming back to 420... (it isn't 420 friendly so to say
So from my observations and tests the following is to be kept:
* limiting the number of queried items (N) not uses up that amount of memory as JSON 2 (logical)
* running only one qurey after the other (even JSON 2) leads to memory being allocated and freed again.
* JSON 1 is definetly out of the race. Even fireing up 10 queries in a row doesn't hurt
* Once doing multiple heavy queries "simultaniously", in this case here multiple JSON 2 (like LDP probably does as it also queries Movies, Series, etc) eats up memory without giving it free again. (I would maybe need to adapt the mem.log script to also take buffers/cache into account)
* In some cases issuing a query after waiting some time frees up memory!?
* Multiple queries at once or in a short time lead to using up memory without giving it free again completly (no 420 reached ever agin). So if not after say 10-20min the buffers/cache aren't given free again or being reuseable, the memory fills up slowly but steady, You can see that in logs at about 22:40 when I fired 3 Json 1, 3 Json 2 and 3 Json 3 (N=3200) and after that 5 JSON 2 reduces memory from about 300MB to 220MB without freeing.
* Remarkable: Even JSON 2 takes round about 400ms on mysql side, but 30sec until web request is finished!!
* I let the mem.log run a little more now (10min) until I upload the logs for to see if memory returns...
I'll check against Chewitt's build asap
One thing I have to tell is, the Amlogic Box running kszaq's build is not using the same AudioDB as the RPi...
It has 2 profiles. One using another audio source (Audiobooks and Radioplays) with far less files! I'll let it run on the other profile against the "normal" music and see ... sorry, forgot about that somehow. So maybe also the Amlogic Box is suffering ^^!
So, now it's 10min later and mem is only up to 255MB free, so I'll upload...
kodi.log & memory.log
Gn8