[x264-devel] Delete the huge memory leak in x264.

alexander tian tian.alexandertian at gmail.com
Tue Nov 27 05:05:59 CET 2007


Hi Yohann,

It still has memory leak if you use ST(single-thread). You could test it by
some tools like "Boundschecker". The MT has more memory leak than ST has.

I am very busy this day. I am sorry to put unfinished work. So I think
someone could optimize the way first. Then put in patch file if you have
better ideas. Welcome for the discussion.

2007/11/26, Yohann Pitrey Helpiquet <yohann.pitrey at ens.insa-rennes.fr>:
>
> Hi,
>
> From what i saw, this memory leak seems to occur only when you use
> threads. Is
> that right? I don't use threads anymore (i erased thread stuff from the
> code),
> do you believe it's worth the time to merge modifications from your patch?
>
> Thanks a lot!
>
> Yohann.
>
>
>
> alexander tian a écrit :
> > Hi, everyone
> >
> > I found huge memory leak in the x264. There are at least 3 positions
> > which has memory leak. Such as below:
> >
> > 1. The function "x264_mb_analyse_load_costs" in file " analyse.c". Here
> > only "malloc" the buffer for the parameter "*p_cost_mv[52]". But not
> > free them in the end. It should be freed at the function
> > "x264_encoder_close".
> >
> > 2. The parameter "i_refs" in the function "x264_macroblock_cache_end"
> > should be computed like in the "x264_macroblock_cache_init". Otherwise
> > it will cause memory leak.
> >
> > 3. Not all the new "x264_frame_t" are deleted at the end of encoding. So
> > it cause huge memory leak.
> >
> > I have corrected them. But I am unable to write patch file. So I had to
> > put my changed project for windows. My way is not the best. Somebody can
> > reference from it to generate the better way. Please put in your patch
> > file if you have better ideas.
> >
> > Thank you very much.
> >
> >
> >
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > x264-devel mailing list
> > x264-devel at videolan.org
> > http://mailman.videolan.org/listinfo/x264-devel
>
>
> _______________________________________________
> x264-devel mailing list
> x264-devel at videolan.org
> http://mailman.videolan.org/listinfo/x264-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.videolan.org/pipermail/x264-devel/attachments/20071127/f0b9be45/attachment.htm 


More information about the x264-devel mailing list