Opened 11 years ago

Closed 11 years ago

Last modified 11 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 Tae-Kwan. Park. 11 years ago.
memory leak test cpp file
FFMpegEncodingMemoryLeakCheck.zip (709.3 KB ) - added by Tae-Kwan. Park. 11 years ago.
test project ( with test cpp file, vc 2010 project )

Download all attachments as: .zip

Change History (9)

comment:1 by Carl Eugen Hoyos, 11 years ago

Keywords: leak added

Please provide valgrind output for memory leaks.

comment:2 by burek, 11 years ago

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 by Carl Eugen Hoyos, 11 years ago

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 by Carl Eugen Hoyos, 11 years ago

Component: undetermineddocumentation
Resolution: fixed
Status: newclosed
Version: unspecifiedgit-master

Fixed by Nicolas George.

comment:5 by burek, 11 years ago

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

by Tae-Kwan. Park., 11 years ago

Attachment: Muxing.cpp added

memory leak test cpp file

by Tae-Kwan. Park., 11 years ago

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

comment:6 by Tae-Kwan. Park., 11 years ago

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 by Tae-Kwan. Park., 11 years ago

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.