Log in

View Full Version : Memory Leak: AVISynth 2.06, CCE 2.66


leos_janacek
7th October 2002, 19:57
I'm not sure of the appropriate place to post problems with AVISynth2, but there is a memory leak which currently renders the code unusable for encoding multiple episodes in a single CCE session.

- CCE Settings: VBR 3-Pass, No audio.
- Tried with Avisynth plugin MPEG2DEC and MPEG2DEC2.
- Does not occur when frame-serving with VFAPI.

Procedure:

- Start CCE
- Create and select a VBR Multipass template
- Create several AVISYNTH scripts for various test d2v files
- Drag multiple AVS files into the CCE encoding window

Open the Windows "Task Manager" to keep an eye on your "Memory Usage History". After each pass, the page file usage will increase until Windows runs out of swap space.

I've tried using SetMemoryMax(64) in my scripts, but it does not change the behavior.

I'm typing most of this in from memory, I can post the actual scripts later this evening if they would be helpful.

Richard Berg
7th October 2002, 23:17
Absolutely. Please post the results using a known-good client program (VDub) and try to find the shortest script that leak.

leos_janacek
8th October 2002, 02:27
Great. Here are the specifics:

1. Rip a small VOB.
2. Run DVD2AVI (1.76+) to get a d2v file.
3. Create 'n' AVS files, T1.avs through Tn.avs

Here is the AVS file:

SetMemoryMax(64)
LoadPlugin("C:\PROGRA~1\AVISYNTH2\PLUGINS\MPEG2DEC2.DLL")
mpeg2source("C:\TEST.D2V")

I've also tried it with MPEG2DEC.DLL.

Versions Information:
AVISYNTH2.DLL, version 2.0.6.0, dated 9/27/02 (size = 120,320)
MPEG2DEC.DLL, no version tag, dated 9/25/02 (size = 110,592)
MPEG2DEC2.DLL, no version tag, dated 4/8/02 (size = 421,888)

[People should really include version resources in theit DLLs! :-)]

Drag all 'n' AVS files to CCE. Select multipass VBR (I'm using three passes).

After each pass, the memory footprint of CCE increases.

This happens on Windows XP SP1 with the P4 Northwood refresh processor and on Windows 2000 with a Tualatin.

I have tried getting the AVISYNTH2 sources from the Sound Forge page, but have not been able to build the DLL in my environment: VC 6.0 SP5, MASM 6.13; otherwise I would have included a Bounds-Checker dump.

If someone wants to give me some advice getting the build environment setup, I might be able to give some additional help on this problem.

E-mail: leos_janacek@hotmail.com

Thanks!

mmgrover
8th October 2002, 07:22
I had the same problem with CCE v2.66.01.02 and AVISynth 2.06

Here is the Script:

LoadPlugin("C:\Program Files\AviSynth2\plugins\MPEG2DEC2.DLL")
mpeg2source("K:\Rookie of the Year\Rookie of the Year.d2v")
BilinearResize(480,480)
ResampleAudio(44100)

In 2.66 you can start a job and cancel it a few second after it
starts over and over again and watch the memory slowly get used up
until CCE is exited. Set up a batch with quite a few jobs and
pretty soon all memory is gone...

Ran the exact same scripts and files in CCE 2.5 and there was
no memory issues :-)

mike

Richard Berg
8th October 2002, 07:56
That's why I suggested VDub -- I can't make authoritative claims about its memory usage, but I trust Avery a lot more than the CCE folks based on the countless bugs I've seen reported here (never used it myself).

FuPP
8th October 2002, 10:15
Maybe could help : I got same problem using the avs version of virtualdub (belgabor's one). After having reloaded several times my script , I got a 'Not enough memory message' : RAM : 0.5 MB FREE, SWAP : 450 MB !

I did not have time to test with standard virtualdub (will do later in the day).

My script used :

mpeg2dec (dividee's one)
crop
convolution3d
convertyuy2
tweak
bicubicresize
Addborders

Sorry not beeing able to post exact script at this moment :(

(WIN98SE)

Cheers,

FuPP

mmgrover
8th October 2002, 15:12
I got around the mem problems with CCE 2.66 and AviSynth 2.06
on my machine :-)

I was having two problems...
First was the memory leak after each Encode job. Second was the
fact that the vob files still had a open file handle after the job
completed, and wasn't released until CCE was closed.

CCE 2.66 can open avs scripts with out the
ResampleAudio(44100) command, So I wasn't adding it back in :-(
I added this back and ran the daylights out of cce and no mem leaks!!
Vob file handles are also being closed after each job :-)


mike