Opened 6 years ago

Closed 6 years ago

#12005 closed Bug Report - Memory Leak (Fixed)

Mythtv Video Library leaks while playing video with .srt subtitles

Reported by: martin@… Owned by: Jim Stichnoth
Priority: minor Milestone: 0.27.1
Component: MythTV - Captions Version: 0.27-fixes
Severity: medium Keywords:
Cc: Ticket locked: no

Description

The Video Library seems to leak some memory every time a subtitle is shown. Eventually leading to a crash of mythfrontend while watching a subtitled video.

Below is a 10 seconds interval of the ps output of mythfrontend while playing a video with .srt subtitles enabled:

UID PID PPID C SZ RSS PSR STIME TTY TIME CMD martin 6005 5996 29 145773 193288 1 13:33 ? 00:05:34 /usr/bin/mythfrontend.real --syslog local7 -q -q martin 6005 5996 29 145773 193288 0 13:33 ? 00:05:34 /usr/bin/mythfrontend.real --syslog local7 -q -q martin 6005 5996 29 145773 193288 0 13:33 ? 00:05:34 /usr/bin/mythfrontend.real --syslog local7 -q -q martin 6005 5996 29 145773 193288 0 13:33 ? 00:05:35 /usr/bin/mythfrontend.real --syslog local7 -q -q martin 6005 5996 29 145608 192756 0 13:33 ? 00:05:35 /usr/bin/mythfrontend.real --syslog local7 -q -q martin 6005 5996 29 154116 202920 1 13:33 ? 00:05:40 /usr/bin/mythfrontend.real --syslog local7 -q -q martin 6005 5996 29 154436 202924 0 13:33 ? 00:05:43 /usr/bin/mythfrontend.real --syslog local7 -q -q martin 6005 5996 29 154468 203032 0 13:33 ? 00:05:47 /usr/bin/mythfrontend.real --syslog local7 -q -q martin 6005 5996 29 154468 203032 1 13:33 ? 00:05:50 /usr/bin/mythfrontend.real --syslog local7 -q -q martin 6005 5996 29 154468 203032 0 13:33 ? 00:05:54 /usr/bin/mythfrontend.real --syslog local7 -q -q martin 6005 5996 29 154468 203032 0 13:33 ? 00:05:57 /usr/bin/mythfrontend.real --syslog local7 -q -q martin 6005 5996 29 154468 203032 1 13:33 ? 00:06:01 /usr/bin/mythfrontend.real --syslog local7 -q -q martin 6005 5996 29 154500 203188 1 13:33 ? 00:06:05 /usr/bin/mythfrontend.real --syslog local7 -q -q martin 6005 5996 29 154532 203188 1 13:33 ? 00:06:08 /usr/bin/mythfrontend.real --syslog local7 -q -q martin 6005 5996 29 154532 203188 0 13:33 ? 00:06:12 /usr/bin/mythfrontend.real --syslog local7 -q -q martin 6005 5996 29 154532 203188 1 13:33 ? 00:06:15 /usr/bin/mythfrontend.real --syslog local7 -q -q martin 6005 5996 29 154532 203188 0 13:33 ? 00:06:19 /usr/bin/mythfrontend.real --syslog local7 -q -q martin 6005 5996 29 154532 203188 0 13:33 ? 00:06:22 /usr/bin/mythfrontend.real --syslog local7 -q -q martin 6005 5996 29 154532 203188 0 13:33 ? 00:06:26 /usr/bin/mythfrontend.real --syslog local7 -q -q martin 6005 5996 29 154532 203188 0 13:33 ? 00:06:29 /usr/bin/mythfrontend.real --syslog local7 -q -q martin 6005 5996 29 154532 203188 0 13:33 ? 00:06:33 /usr/bin/mythfrontend.real --syslog local7 -q -q martin 6005 5996 29 154532 203188 1 13:33 ? 00:06:37 /usr/bin/mythfrontend.real --syslog local7 -q -q

And here's the same video without subtitles: UID PID PPID C SZ RSS PSR STIME TTY TIME CMD martin 6005 5996 30 152253 203092 0 13:33 ? 00:07:16 /usr/bin/mythfrontend.real --syslog local7 -q -q martin 6005 5996 30 152509 203164 0 13:33 ? 00:07:19 /usr/bin/mythfrontend.real --syslog local7 -q -q martin 6005 5996 30 152509 203212 0 13:33 ? 00:07:23 /usr/bin/mythfrontend.real --syslog local7 -q -q martin 6005 5996 30 152509 203272 1 13:33 ? 00:07:26 /usr/bin/mythfrontend.real --syslog local7 -q -q martin 6005 5996 30 152509 203272 1 13:33 ? 00:07:30 /usr/bin/mythfrontend.real --syslog local7 -q -q martin 6005 5996 30 152509 203272 0 13:33 ? 00:07:33 /usr/bin/mythfrontend.real --syslog local7 -q -q martin 6005 5996 30 152509 203272 1 13:33 ? 00:07:37 /usr/bin/mythfrontend.real --syslog local7 -q -q martin 6005 5996 30 152509 203292 1 13:33 ? 00:07:41 /usr/bin/mythfrontend.real --syslog local7 -q -q martin 6005 5996 30 152509 203292 1 13:33 ? 00:07:44 /usr/bin/mythfrontend.real --syslog local7 -q -q martin 6005 5996 30 152509 203292 0 13:33 ? 00:07:47 /usr/bin/mythfrontend.real --syslog local7 -q -q martin 6005 5996 30 152509 203292 0 13:33 ? 00:07:51 /usr/bin/mythfrontend.real --syslog local7 -q -q martin 6005 5996 30 152509 203292 1 13:33 ? 00:07:54 /usr/bin/mythfrontend.real --syslog local7 -q -q martin 6005 5996 30 152509 203292 1 13:33 ? 00:07:58 /usr/bin/mythfrontend.real --syslog local7 -q -q martin 6005 5996 30 152509 203292 1 13:33 ? 00:08:01 /usr/bin/mythfrontend.real --syslog local7 -q -q martin 6005 5996 30 152509 203292 0 13:33 ? 00:08:05 /usr/bin/mythfrontend.real --syslog local7 -q -q martin 6005 5996 30 152509 203292 0 13:33 ? 00:08:08 /usr/bin/mythfrontend.real --syslog local7 -q -q martin 6005 5996 30 152509 203292 0 13:33 ? 00:08:12 /usr/bin/mythfrontend.real --syslog local7 -q -q

I'm running the ubuntu 0.27-fixes repository and just upgraded this morning (0.27.0+fixes.20140105.fac84fa)

Change History (5)

comment:1 Changed 6 years ago by Jim Stichnoth

Component: MythTV - Video LibraryMythTV - Captions
Owner: set to Jim Stichnoth
Status: newaccepted
Type: Bug Report - CrashBug Report - Memory Leak

comment:2 Changed 6 years ago by Jim Stichnoth <jstichnoth@…>

In 8082116cc3a13e7fdc8d40eaf33ae0e572cb9648/mythtv:

Subtitles: Fix memory leak from displaying text captions/subtitles.

Delete the FormattedTextSubtitle? object after it has been consumed and
displayed. This applies to SRT, cc608, and cc708 subtitles that are
actively displayed during playback. Refs #12005.

comment:3 Changed 6 years ago by Jim Stichnoth

Valgrind found a definite leak in Master subtitle code. This was the result of a refactor that is not part of 0.27-fixes.

I ran valgrind on 0.27-fixes in the following way:

valgrind --log-file=/tmp/srt.log --leak-check=full --error-limit=no mythfrontend

There were a couple of one-time leaks related to font loading, but I didn't see anything systematic related to subtitles.

It's possible you're seeing the effect of the image cache warming up. On my system, I noticed that the memory footprint grows for a while and then stabilizes after it has grown by ~100MB. (I can accelerate the growth by maximizing subtitle zoom and playing in fast-forward mode.) Can you check whether this is also the case for you?

comment:4 Changed 6 years ago by martin@…

I can't test your hypothesis since mythfrontend is OOM killed before the footprint can stabilize as described in the report.

comment:5 Changed 6 years ago by JYA

Milestone: 0.27.1
Resolution: Fixed
Status: acceptedclosed
Note: See TracTickets for help on using tickets.