Opened 12 years ago
Closed 12 years ago
Last modified 12 years ago
#10630 closed Bug Report - General (Fixed)
Memory leak when subtitles are "on"
Reported by: | Owned by: | Jim Stichnoth | |
---|---|---|---|
Priority: | minor | Milestone: | 0.25.1 |
Component: | MythTV - Captions | Version: | 0.25-fixes |
Severity: | medium | Keywords: | subtitles memory leak |
Cc: | Ticket locked: | no |
Description
Most of the channels that I get ignore the "Subtitles Font" setting (which is fine by me). However, I get memory leaks on the channels that do use the "Subtitles Font", specified on the "Playback OSD" screen, when the subtitles are on.
The memory used by the FE increases until the FE becomes unusable. On some programmes this can happen in less than an hour on a machine with 4GB of ram. Happens with both LiveTV and Recordings. Stopping playback (i.e. going back to the main menu) does not free up the memory.
Also seen in 0.24.
To reproduce:
- Watch a channel that sets the subtitle font according to the setting on the "Playback OSD" page (or watch a recording made on such a channel).
- Turn the subtitles on, if they are not already on.
- Observe the FE memory usage (e.g. "top")
Expected results: FE memory usage does not increase significantly while the programme is being watched/played back.
Actual Results: FE memory usage increases proportionally to the amount of subtitles shown on screen until all available memory is used up. Stopping playback back does not free up memory.
Attachments (4)
Change History (11)
Changed 12 years ago by
Attachment: | version.txt added |
---|
comment:1 Changed 12 years ago by
FE launched like this:
valgrind --log-file=/home/mossy/log/vglog.log --leak-check=full --error-limit=no --show-reachable=yes /usr/bin/mythfrontend -O UIPainter=qt
I played a 40 minute recording, subtitles "on", then let the FE idle for about 9 hours before shutting it down again.
comment:2 Changed 12 years ago by
In case it helps this is a short recording from one of the relevant channels (5 mins, 100MB):
comment:3 Changed 12 years ago by
Milestone: | unknown → 0.26 |
---|---|
Status: | new → accepted |
I'm surprised at the memory leak, as it appears that the teletextscreen.cpp code is correctly cleaning up after itself, yet I see the mythfrontend memory size grow as I play the sample several times.
I am planning to refactor the teletextscreen.cpp and subtitlescreen.cpp into a common code base, and I expect that will fix the leak.
comment:4 Changed 12 years ago by
The memory leak was from objects that are stored in teletextscreen.cpp in a hash.
TeletextScreen::ClearScreen?() processed the hash as if it were a list, resulting in few, if any, of the objects being deleted.
The patch above fixes this.
I should have spotted the problem when I first looked at the code, your comment prompted me to look again.
comment:5 Changed 12 years ago by
Hah! You spotted this at exactly the same time I did, I was about to commit the fix.
comment:6 Changed 12 years ago by
Milestone: | 0.26 → 0.25.1 |
---|---|
Resolution: | → Fixed |
Status: | accepted → closed |
[master dc63336] Fix leak in TeletextScreen::ClearScreen?. Fixes #10630
comment:7 Changed 12 years ago by
[fixes/0.25 c171fe9] Fix leak in TeletextScreen::ClearScreen?. Fixes #10630 (cherry picked from commit d5b6760f1cf3a6eb031c96a7b340fbcbd1bb2358)
version