Solved Issue - Memory leak with Krypton beta1?

  Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
lovemachine Offline
Junior Member
Posts: 29
Joined: May 2015
Reputation: 0
Post: #1
Still relatively new to linux, so please be kind. After doing a fresh install of Lubuntu 16.04.1 (previously on 14.04 with Kodi 16), I installed Krypton beta1 . When playing any MPEG2 recorded TV show (720p or 1080i, from a Mythtv backend), any attempt at skipping ahead/back results in Kodi freezing and crashing out. With the debug window turned on, free memory goes from 3GB out of 4 down to about 200k within a few seconds. At the end of kodi.log, there is a warning of low memory as well. CPU usage is very low, all video settings set per Fritsch's EGL thread, going to software decoding doesn't change anything. H264 encoded movies seem to play fine with no significant decrease in free memory. Hardware is an i3 Chromebox with 4GB of system memory. apt-get update/upgrade hasn't changed anything. Downgrading to Jarvis, no playback problems. What did I screw up?

Before Fritsch yells through his keyboard:
$ dpkg -l |grep mesa | pastebinit
http://paste.ubuntu.com/23109396/
$ DISPLAY=:0 vainfo | pastebinit
libva info: VA-API version 0.39.2
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_0_39
libva info: va_openDriver() returns 0
http://paste.ubuntu.com/23109397/
$ cat ~/.kodi/temp/kodi.log | pastebinit
http://paste.ubuntu.com/23109417/
$ dmesg | pastebinit
http://paste.ubuntu.com/23109421/
$ amixer | pastebinit
http://paste.ubuntu.com/23109424/

Does that vainfo section (returns 0) point to something missiing? I went back to the EGL thread and checked to make sure the appropriate packages were installed and didn't seem to be missing anythhing. Thanks for any help.
(This post was last modified: 2016-09-13 18:28 by lovemachine.)
find quote
fritsch Online
Team-Kodi Developer
Posts: 15,495
Joined: Aug 2011
Reputation: 457
Location: Stuttgart*
Post: #2
Nothing to yell. Congrats you found a bug.

"Your most vocal users are not reflective of your userbase" J.M.
"Of course, they [XP Users and people with outdated hardware] need to tell the world about the kind of hero they are, and block innovation for everyone else because their decades old OS / hardware needs to work =p" nevcairiel (ffmpeg)
No Debug Log no issue.
find quote
fritsch Online
Team-Kodi Developer
Posts: 15,495
Joined: Aug 2011
Reputation: 457
Location: Stuttgart*
Post: #3
Same with the same recording, but played via files and not the myth pvr Addon?

"Your most vocal users are not reflective of your userbase" J.M.
"Of course, they [XP Users and people with outdated hardware] need to tell the world about the kind of hero they are, and block innovation for everyone else because their decades old OS / hardware needs to work =p" nevcairiel (ffmpeg)
No Debug Log no issue.
find quote
Milhouse Offline
Team-Kodi Member
Posts: 10,406
Joined: Jan 2011
Reputation: 405
Post: #4
@fritsch: It's this: http://forum.kodi.tv/showthread.php?tid=...pid2402265

Texture Cache Maintenance Utility: Preload your texture cache for optimal UI performance. Remotely manage media libraries. Purge unused artwork to free up space. Find missing media. Configurable QA check to highlight metadata issues. Aid in diagnosis of library and cache related problems.
find quote
fritsch Online
Team-Kodi Developer
Posts: 15,495
Joined: Aug 2011
Reputation: 457
Location: Stuttgart*
Post: #5
Wondering as for PVR passthrough should not be in use ... Don't forget to report in the original PR.

"Your most vocal users are not reflective of your userbase" J.M.
"Of course, they [XP Users and people with outdated hardware] need to tell the world about the kind of hero they are, and block innovation for everyone else because their decades old OS / hardware needs to work =p" nevcairiel (ffmpeg)
No Debug Log no issue.
find quote
fritsch Online
Team-Kodi Developer
Posts: 15,495
Joined: Aug 2011
Reputation: 457
Location: Stuttgart*
Post: #6
Can you verify the issues is gone with reverting that commit?

"Your most vocal users are not reflective of your userbase" J.M.
"Of course, they [XP Users and people with outdated hardware] need to tell the world about the kind of hero they are, and block innovation for everyone else because their decades old OS / hardware needs to work =p" nevcairiel (ffmpeg)
No Debug Log no issue.
find quote
Milhouse Offline
Team-Kodi Member
Posts: 10,406
Joined: Jan 2011
Reputation: 405
Post: #7
(2016-08-30 09:13)fritsch Wrote:  Can you verify the issues is gone with reverting that commit?

Yes, I (and one other) have verified that reverting PR10247 fixes the OOM while seeking with passthrough enabled.

I've posted details to the PR, there's a sample video available to reproduce the issue.

Texture Cache Maintenance Utility: Preload your texture cache for optimal UI performance. Remotely manage media libraries. Purge unused artwork to free up space. Find missing media. Configurable QA check to highlight metadata issues. Aid in diagnosis of library and cache related problems.
(This post was last modified: 2016-08-30 09:39 by Milhouse.)
find quote
fritsch Online
Team-Kodi Developer
Posts: 15,495
Joined: Aug 2011
Reputation: 457
Location: Stuttgart*
Post: #8
wrong PR linked?

"Your most vocal users are not reflective of your userbase" J.M.
"Of course, they [XP Users and people with outdated hardware] need to tell the world about the kind of hero they are, and block innovation for everyone else because their decades old OS / hardware needs to work =p" nevcairiel (ffmpeg)
No Debug Log no issue.
find quote
Milhouse Offline
Team-Kodi Member
Posts: 10,406
Joined: Jan 2011
Reputation: 405
Post: #9
Sorry fat fingers. Post updated.

Texture Cache Maintenance Utility: Preload your texture cache for optimal UI performance. Remotely manage media libraries. Purge unused artwork to free up space. Find missing media. Configurable QA check to highlight metadata issues. Aid in diagnosis of library and cache related problems.
find quote
fritsch Online
Team-Kodi Developer
Posts: 15,495
Joined: Aug 2011
Reputation: 457
Location: Stuttgart*
Post: #10
I don't see an immediate issue in that change :-( thought it was the split_data but the unref later also removes the alloced side_data, let's wait until fernet comes back from holidays.

"Your most vocal users are not reflective of your userbase" J.M.
"Of course, they [XP Users and people with outdated hardware] need to tell the world about the kind of hero they are, and block innovation for everyone else because their decades old OS / hardware needs to work =p" nevcairiel (ffmpeg)
No Debug Log no issue.
find quote
Milhouse Offline
Team-Kodi Member
Posts: 10,406
Joined: Jan 2011
Reputation: 405
Post: #11
Unfortunately I'm not able to confirm behaviour on my Ubuntu x86_64 box as my Radeon video card doesn't support passthrough, but reproducing in LE is easy enough, and without PR10247 the problem is gone. I've also tested a "plain" version of LibreELEC master (based on Kodi 17 beta1) and that has the same OOM behaviour so it's not introduced by any other patch I'm using in my builds.

I guess if @lovemachine can repeat his test with passthrough disabled, this might help confirm we are on the right track.

Texture Cache Maintenance Utility: Preload your texture cache for optimal UI performance. Remotely manage media libraries. Purge unused artwork to free up space. Find missing media. Configurable QA check to highlight metadata issues. Aid in diagnosis of library and cache related problems.
find quote
lovemachine Offline
Junior Member
Posts: 29
Joined: May 2015
Reputation: 0
Post: #12
Hooray! I'm useful!

Playing the file directly, not through PVR service, still results in the same problem (not in the log posted below). Disabling passthrough DOES solve the problem, with no drop in free memory with skipping. Below is a new kodi log with passthrough disabled if it helps.

http://paste.ubuntu.com/23112048/
find quote
fritsch Online
Team-Kodi Developer
Posts: 15,495
Joined: Aug 2011
Reputation: 457
Location: Stuttgart*
Post: #13
Here a video:
https://www.youtube.com/watch?v=fUspLVStPbk

With the text (ignore the other propaganda, just the refrain):
Because

Every log is useful.
Every log is great.
If a log is missing,
fritsch is goin' to yell.

CHILDREN:
Every log is useful.
Every log is great.
If a log is missing,
fritsch is goin' to yell.

"Your most vocal users are not reflective of your userbase" J.M.
"Of course, they [XP Users and people with outdated hardware] need to tell the world about the kind of hero they are, and block innovation for everyone else because their decades old OS / hardware needs to work =p" nevcairiel (ffmpeg)
No Debug Log no issue.
find quote
fritsch Online
Team-Kodi Developer
Posts: 15,495
Joined: Aug 2011
Reputation: 457
Location: Stuttgart*
Post: #14
Fixed it in master.

"Your most vocal users are not reflective of your userbase" J.M.
"Of course, they [XP Users and people with outdated hardware] need to tell the world about the kind of hero they are, and block innovation for everyone else because their decades old OS / hardware needs to work =p" nevcairiel (ffmpeg)
No Debug Log no issue.
find quote
lovemachine Offline
Junior Member
Posts: 29
Joined: May 2015
Reputation: 0
Post: #15
(2016-08-31 16:18)fritsch Wrote:  Fixed it in master.

Danke, Fritsch. I'll add the nightly repo tonight (US Pacific time) and check it out.
find quote