Opened 11 years ago

Closed 9 years ago

#3441 closed defect (expired)

memory leak

Reported by: Milhaus Owned by:
Priority: major Component: General
Severity: high Keywords: memory, leak, 8917
Cc: Sensitive: no

Description

Revision

8917, i have tested also 8915 with the same results

Issue Description

Memory leak in oscam ( compiled with MIPSEL ASUS WL toolchain ). Oscam process slowly increase in size - after 16 hours the process reach 10MB.

oscam.conf
[global]
logfile = /dev/null
disablelog = 1
disableuserfile = 1

oscam is started with oscam -b -r 2 -c /opt > /dev/null 2>&1

When the issue occurs

after several hours of running

How the issue is reproducable

Attachments (5)

oscam-svn8917-ASUSWL-DEFAULT-LIBUSB-WEBIF (1.3 MB ) - added by Milhaus 11 years ago.
Oscam 8917 - binary
oscam.log (7.0 KB ) - added by chocholousek 11 years ago.
valgrind.zip (8.8 KB ) - added by chocholousek 11 years ago.
valgrind0928.log (62.8 KB ) - added by chocholousek 11 years ago.
memory-leak.patch (275 bytes ) - added by berdyansk 10 years ago.
Memory leak tryfix

Download all attachments as: .zip

Change History (31)

by Milhaus, 11 years ago

Oscam 8917 - binary

comment:1 by chocholousek, 11 years ago

To same problem with r8914 after 5 day VSZ size = 165000

Last edited 11 years ago by chocholousek (previous) (diff)

comment:2 by horizon1, 11 years ago

I use r8894, memory leak is present. Memory usage, slowly and surely growing.

comment:3 by blueven, 11 years ago

Run oscam with valgrind so we can check if there are mem leaks and where they are.

by chocholousek, 11 years ago

Attachment: oscam.log added

in reply to:  3 comment:4 by chocholousek, 11 years ago

log for oscam with valgrind.

comment:5 by nm1, 11 years ago

oscam must be compiled with
cmake -DCMAKE_BUILD_TYPE=Debug

your debug log is unusable

comment:6 by Gorgone Impertinence, 11 years ago

memleaks can only detected by valgrind on runtime (not possible on routers, less power & ram)

comment:7 by blueven, 11 years ago

Check #8920 and report.

comment:8 by horizon1, 11 years ago

Now is better. Runs considerably more economical, but still, within 6 hours, oscam used twice more memory than usual.

comment:9 by Milhaus, 11 years ago

I have forget to mention in the initial post that i dont use Cache-ex feature, so this fix does not help. I will try to use valgrind today.

Result:
I have failed to cross-compile valgrind for Broadcom BCM3302 V2.9 cpu ( ASUS WL500gp V2 router ), so i am not able to run it in my router.

Last edited 11 years ago by Milhaus (previous) (diff)

comment:10 by horizon1, 11 years ago

I tested on ubuntu 32 bit without cacheex and 64 bit with cahce. On both platforms memory leak is still ongoing.

P.S.
Unfortunately I do not know how to do valgrind log

comment:11 by Milhaus, 11 years ago

horizon1:
install valgrind: sudo apt-get install valgrind

run oscam with valgrind:
valgrind -v --leak-check=full --show-reachable=yes --error-limit=no --undef-value-errors=no --log-file=valgrind.log oscam -r0 -c /var/oscam

post valgrind.log here

comment:13 by chocholousek, 11 years ago

Memory Leak is continue present Build r8922

==2290== LEAK SUMMARY:
==2290== definitely lost: 23,355,353 bytes in 127,872 blocks
==2290== indirectly lost: 1,242 bytes in 13 blocks
==2290== possibly lost: 27,540 bytes in 87 blocks
==2290== still reachable: 3,866,548 bytes in 73,230 blocks
==2290== suppressed: 0 bytes in 0 blocks

Last edited 11 years ago by chocholousek (previous) (diff)

by chocholousek, 11 years ago

Attachment: valgrind.zip added

comment:14 by Admin, 11 years ago

This is not a debug version of OSCam. That's why there are only lines like
by 0x80C4420: ??? (in /bin/oscam)
in it. Normally, we would see source file names and code lines instead of the ???...

in reply to:  14 comment:15 by chocholousek, 11 years ago

OK Ill try later

by chocholousek, 11 years ago

Attachment: valgrind0928.log added

comment:16 by chocholousek, 11 years ago

now it OK?

comment:17 by Gorgone Impertinence, 11 years ago

log is ok

by berdyansk, 10 years ago

Attachment: memory-leak.patch added

Memory leak tryfix

comment:18 by berdyansk, 10 years ago

I had this very issue with 9014. Please try the attached patch.

comment:19 by horizon1, 10 years ago

Patch does not solve the problem. Memory leak is still present.

comment:20 by chocholousek, 10 years ago

Path problem resolve, but oscam now contains more mem leak. Please add path to svn.

comment:21 by japie, 10 years ago

patch solves problem as I posted in http://www.streamboard.tv/wbb2/thread.php?threadid=31968&page=12 @ 20 october in emm handling, please add to trunk...

comment:22 by horizon1, 10 years ago

Tonight I tested build 9026 (which is said to solve the problem), on Ubuntu 12.04 64bits and Ubuntu 10.04 32bits. Unfortunately memory leaks continued in both platforms

comment:23 by THeM1971, 10 years ago

I have also tryed the 9026, on ubuntu 12.04 x86 the memleak is still there.
Slowly the mem start growing, when i constant change the tabs on the webpage the memleak grows faster and not goes down again only restart of oscam does.
Now back to 8833 and have no problems.

comment:24 by horizon1, 10 years ago

I do not know exactly when and how the problem was solved, but in recent builds no memory leaks.

comment:25 by schamen, 10 years ago

OSCam r9693 os debian 7 64 bit memory leak still presents.
i think it was growing after refreshing users db.
i'm not using cachex and where is no any physical cardreader

comment:26 by Deas, 9 years ago

Resolution: expired
Status: newclosed
Note: See TracTickets for help on using tickets.