Opened 13 years ago

Closed 13 years ago

#1982 closed defect (fixed)

Memory growth in backend

Reported by: Stuart Auchterlonie Owned by: Stuart Auchterlonie
Priority: minor Milestone: 0.20
Component: dvb Version: head
Severity: medium Keywords: mem leak
Cc: Ticket locked: no

Description

There's a memory growth in the backend. Valgrind's pointer to the most likely culprit.

==3751== 13,538,656 bytes in 90,378 blocks are still reachable in loss record 458 of 458
==3751==    at 0x401CCC9: operator new[](unsigned) (vg_replace_malloc.c:197)
==3751==    by 0x5BFEE00: QString::setLength(unsigned) (in /usr/lib/libqt-mt.so.3.3.6)
==3751==    by 0x5BFEEEF: QString::real_detach() (in /usr/lib/libqt-mt.so.3.3.6)
==3751==    by 0x8064E0A: QString::detach() (qstring.h:854)
==3751==    by 0x8065229: QDeepCopy<QString>::operator QString() (qdeepcopy.h:69)
==3751==    by 0x4592E23: ContentDescriptor::GetDescription(unsigned) const (dvbdescriptors.cpp:177)
==3751==    by 0x47A8826: EITHelper::AddEIT(DVBEventInformationTable const*) (eithelper.cpp:315)
==3751==    by 0x457F59D: DVBStreamData::HandleTables(unsigned, PSIPTable const&) (dvbstreamdata.cpp:290)
==3751==    by 0x4557982: MPEGStreamData::HandleTSTables(TSPacket const*) (mpegstreamdata.cpp:663)
==3751==    by 0x4555946: MPEGStreamData::ProcessTSPacket(TSPacket const&) (mpegstreamdata.cpp:701)
==3751==    by 0x455585C: MPEGStreamData::ProcessData(unsigned char*, int) (mpegstreamdata.cpp:686)
==3751==    by 0x486D39C: DVBSignalMonitor::RunTableMonitorTS() (dvbsignalmonitor.cpp:351)
==3751==

Attachments (1)

dvbdescriptors.diff (186 bytes) - added by anonymous 13 years ago.

Download all attachments as: .zip

Change History (10)

comment:1 Changed 13 years ago by anonymous

Yes Im seeing the backend grow to 1.5G in 7 days....... This will wipe out my server in another 6 hours.....

Using DVB and current head from 7 days ago.

Karl

comment:2 Changed 13 years ago by Janne <janne-mythtv@…>

Component: mythtvdvb

comment:3 Changed 13 years ago by karl@…

I looked at the code, and really the destructor should be called elsewhere, bat as this method is only used in libs/libmythtv/eithelper.cpp a quick fix is to change ./libs/libmythtv/mpeg/dvbdescriptors.cpp using my quick hack....

177c177 < return (QString)((*it).second); ---

return QDeepCopy<QString>((*it).second);

182c182 < return (QString)((*it).second); ---

return QDeepCopy<QString>((*it).second);

This seems to work for me.

comment:4 Changed 13 years ago by anonymous

Type: defectpatch

comment:5 Changed 13 years ago by Stuart Auchterlonie

Type: patchdefect

No patch attached.

Changed 13 years ago by anonymous

Attachment: dvbdescriptors.diff added

comment:6 Changed 13 years ago by karl.royer@…

Priority: minormajor

There are numerous other leaks....

I'll do some more searching...

Its better but after 4 days its 150Meg - seems to leak slower now...

comment:7 Changed 13 years ago by Isaac Richards

Priority: majorminor

comment:8 Changed 13 years ago by Colin Guthrie <mythtv@…>

Also, patches should be unified diff format - diff -u (or the default of "svn diff", which is preferred).

comment:9 Changed 13 years ago by Stuart Auchterlonie

Resolution: fixed
Status: newclosed

After running valgrind for the last 4 hrs on the backend this is now no longer occuring.

Note: See TracTickets for help on using tickets.