Log in

View Full Version : Does memory constantly increase if I go through frame by frame?


bigboss97
1st August 2010, 12:40
I'm writing a program which uses avisynth script to run a slide show. The program goes through each frame and flushes it to a "display":

Frame= Clip->GetFrame( FrameNo, Env);
BmpLine= Frame->GetReadPtr();
for( int Y= Height-1; Y > 0; Y--)
{
CurPix= (Uint8*)SlideShow->pixels +Y *SlideShow->pitch;
memcpy((void*)CurPix,(const void*)BmpLine, RowSize);
BmpLine+= Pitch;
}

I noticed the memory increases constantly. I couldn't find anywhere I increase my memory. So, I'm looking at the avisynth part of my codes. My question:
Every time I run GetFrame() to fetch a frame do I have to release something from the previous frame?

Phuoc Can HUA

Groucho2004
1st August 2010, 15:00
I don't think so. The only way I was able to limit memory usage was by setting "SetMemoryMax()" in the script itself.

Edit: Actually, there is a function SetMemoryMax() in avisynth.h but I have not tried it yet.

AVIL
1st August 2010, 21:13
Hi,

Avisynth has a memory cache where recent frames are stored. Then memory consumption grows after every frame display because newer frames are added to cache. This cache grows until reachs a limited imposed by SetMemoryMax or the default (IMHO this depend in the version of Avisynth used).