Opened 13 years ago

Closed 13 years ago

#9459 closed Bug Report (Fixed)

Mythfrontend Memory Leak while watching BBC HD / BBC1 HD only

Reported by: sijones2010@… Owned by: stuartm
Priority: major Milestone: unknown
Component: MythTV - General Version: 0.24-fixes
Severity: medium Keywords: memory leak bbc hd
Cc: Ticket locked: no

Description

When watching BBC HD or BBC1 HD the frontend uses up memory causing the frontend to use all the memory up on the system, I have seen my own go to the region of 2Gb for frontend requiring a restart due to the system going slow and swapping to disk.

Attachments (3)

logfile.rar (164.5 KB) - added by sijones2010@… 13 years ago.
valgrind log of mythfrontend
dvbsubdec.patch (650 bytes) - added by v0466@… 13 years ago.
memory leak fix for dvbsubdec.c
mpegts.patch (700 bytes) - added by v0466@… 13 years ago.
memory leak fix for mpegts.c

Download all attachments as: .zip

Change History (10)

Changed 13 years ago by sijones2010@…

Attachment: logfile.rar added

valgrind log of mythfrontend

comment:1 Changed 13 years ago by sijones2010@…

valgind ran with

valgrind --leak-check=full --error-limit=no --show-reachable=yes

nvidia drivers version 260.19.29

comment:2 Changed 13 years ago by Stuart Auchterlonie

From the valgrind logs it looks like it's in the subtitle handling.

Stuart

comment:3 Changed 13 years ago by stuartm

Owner: set to markk
Status: newassigned

comment:4 Changed 13 years ago by stuartm

Owner: changed from markk to stuartm
Status: assignedaccepted

comment:5 Changed 13 years ago by v0466@…

I noticed this problem a few weeks ago and tracked it down. I was intending to file a bug report but completely forgot about it (sorry).

I found two leaks. The first is in the subtitle handling code and is caused by a missing break statement in mythtv/external/FFmpeg/libavcodec/dvbsubdec.c after case DVBSUB_DISPLAYDEFINITION_SEGMENT.

The other leak is in mythtv/external/FFmpeg/libavformat/mpegts.c where it was reallocating a packet without freeing the old one. The fix is to add a call to av_free_packet().

I have been running with these two fixes for a few weeks and can watch BBC HD and BBC1 HD all day without running out of memory. I will attach patches shortly.

Changed 13 years ago by v0466@…

Attachment: dvbsubdec.patch added

memory leak fix for dvbsubdec.c

Changed 13 years ago by v0466@…

Attachment: mpegts.patch added

memory leak fix for mpegts.c

comment:6 Changed 13 years ago by sphery

In: af0f68e09e6311daee5a

Add missing break statement in dvbsubdec.c

Mea culpa - those are my mods to the dvb subtitle decoder.

mark-kendall (author)

comment:7 Changed 13 years ago by markk

Resolution: Fixed
Status: acceptedclosed

Fixed in af0f68e09e6311daee5a and 61c78f53245cbbaf6d15

If there is still an issue, please re-open.

Note: See TracTickets for help on using tickets.