Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#2322 closed defect (fixed)

Memory leak in muxing.c

Reported by: burek Owned by:
Priority: normal Component: documentation
Version: git-master Keywords: leak
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:
http://ffmpeg.gusari.org/viewtopic.php?f=25&t=836

A guy used muxing.c example source code to test this situation:

void main( void )
{
repeat for 30 seconds...
{
encoding open.
data encoding.
encoding close.
}
}

and he encounter a memory leak, so this might be investigated a little bit and possibly fixed.

Attachments (2)

Muxing.cpp (18.4 KB) - added by mytree 5 years ago.
memory leak test cpp file
FFMpegEncodingMemoryLeakCheck.zip (709.3 KB) - added by mytree 5 years ago.
test project ( with test cpp file, vc 2010 project )

Download all attachments as: .zip

Change History (9)

comment:1 Changed 5 years ago by cehoyos

  • Keywords leak added

Please provide valgrind output for memory leaks.

comment:2 Changed 5 years ago by burek

It's not my issue and I don't have such an output. I just redirected a user's suggestion from the forum to bug tracker. It shouldn't be too hard to reproduce, if you read the ticket's description, I guess.

comment:3 Changed 5 years ago by cehoyos

Unfortunately, all necessary information needed to reproduce a ticket has to be posted here in the tracker, no ticket must rely on external resources.

Generally, you should only open tickets that you either can reproduce yourself or - in specific cases where this is impossible, this is definitely not such a case - where you collected all information that is available with reasonable effort. I opened a not so small number of tickets because of posts on ffmpeg-user and several third-party bug tracker, so it is safe to say that this is not unreasonable to ask.

comment:4 Changed 5 years ago by cehoyos

  • Component changed from undetermined to documentation
  • Resolution set to fixed
  • Status changed from new to closed
  • Version changed from unspecified to git-master

Fixed by Nicolas George.

comment:5 Changed 5 years ago by burek

Wow Nicolas, this was fast! Thanks and congratulations! :)

Changed 5 years ago by mytree

memory leak test cpp file

Changed 5 years ago by mytree

test project ( with test cpp file, vc 2010 project )

comment:6 Changed 5 years ago by mytree

Hi.
First, I appreciate your interest.
Also, It must be understood that I am not class enough to write English well.

I'm using ffmpeg library in windows platform,
so I downloaded ffmpeg library from Zeranoe FFmpeg builds site.

I wanted to how to encode files in ffmpeg,
and I found FFmpeg example muxing.c file.

Here is my test environment

OS : Windows 7
Platform : Visual Sutdio 2010
FFmpeg version : 2013-03-02 git-4f0d4ac ( Zeranoe's FFmpeg Builds Home Page )

I modified a muxing.c file to adapt itself to windows os.
and I repeated the encoding process for a period of time.

Test code are composed following structure.

void main( void )
{

repeat for 30 seconds...
{

encoding open.
data encoding.
encoding close.

}

}

I used muxing.c example's functions for test.

It works well and there was no memory leak.
But I found that memory was increased gradually in windows task manager

during repeating encoding process.

In my opinion, this program will terminate some time,

if encoding process is repeated for long time.


I wonder why this is happenning.
Is there any way to solve this problem?

I attached the source and project to this issue.

The project zip file is left off ffmpeg library files.

folder directory structure is

Bin : .exe .dll files ( ffmpeg library )
Build : vc solution files
ffmpeg : ffmpeg source
MuxingMemoryLeakCheck? : vc project files
Obj : object files


In Zeranoe's FFmpeg Builds Home Page, you will get the ffmpeg libarary files.
( swscale-x.dll, avutil-xx.dll, avcodec-xx.dll, avformat-xx.dll, etc... )

Add these files to Bin directory, and open the .sln file in visual studio.
you will compile the source.

Any advice will go far toward solving the problem.

comment:7 Changed 5 years ago by mytree

Sorry, I was wrong.
I tried again, and I found avcodec_get_context_defaults3 function,
but this function was founded anywhere in the muxing.c example.

Note: See TracTickets for help on using tickets.