PDA

View Full Version : [Avisynth 2.52 12/09] Trim eats my memory too fast!


HomiE FR
13th September 2003, 08:52
Hi,

Recently I found out that Trim was a huge memory eater (even faster than ScriptClip with some "memory leaking" filters!).
Indeed, I need Trim so that I cut the anime I want to process in many many small parts. Then I can apply different filter chains on these small parts (some parts need Dup, some others not since there is a slow cam motion that could become jerky with Dup)... That's why Trim appears many times in that script.

I thought there was no problem in using Trim that way, but it seems there is one: Trim eats my memory really fast! :eek: Here is an example of a script where Trim seems to eat everything it can:

Trim( 0, 7406) + \
Trim( 7407, 7449) + \
Trim( 7450, 13815) + \
Trim( 13816, 13893) + \
Trim( 13894, 13948) + \
Trim( 13949, 14030) + \
Trim( 14031, 17834) + \
Trim( 17835, 18049) + \
Trim( 18050, 26052) + \
Trim( 26053, 26106) + \
Trim( 26107, 28988) + \
Trim( 28989, 29101) + \
Trim( 29102, 29159) + \
Trim( 29160, 29232) + \
Trim( 29233, 29913) + \
Trim( 29914, 29949) + \
Trim( 29950, 31384) + \
Trim( 31385, 31508) + \
Trim( 31509, 33425) + \
Trim( 33426, 33477) + \
Trim( 33478, 33559) + \
Trim( 33560, 33641) + \
Trim( 33642, 34294) + \
Trim( 34295, 34345) + \
Trim( 34346, 34429) + \
Trim( 34430, 34461) + \
Trim( 34462, 34573) + \
Trim( 34574, 34603) + \
Trim( 34604, 35219) + \
Trim( 35220, 35274) + \
Trim( 35275, 35452) + \
Trim( 35453, 35488) + \
Trim( 35489, 35523) + \
Trim( 35524, 35559) + \
Trim( 35560, 0)

I used Ctrl+Alt+Del (in WinXP) so that I can easily see the memory usage that grows too fast, but it is quite easy to see that the whole system is lagging after I have done some seeks in VDubMod (latest version).

First I hadn't changed SetMemoryMax() and I had some Avisynth read errors with Dup/Deen. Then I used SetMemoryMax(256) which removed these read errors. But this memory usage seems a bit exagerated, isn't it? Maybe I'm not using Avisynth right with all these "+\" but I didn't know it was a "no go".

Is this a bug from Avisynth? A bug from my system? A limitation from Avisynth? A message from aliens? :p Anything else?

Thanks in advance. :)

Bidoche
13th September 2003, 11:31
Trim and Splice (invoked by operator +) are small filters who don't allocate memory dynamically.
I don't see how thay could eat up all that memory by themselves.

An explanation could be that due to a misdesign, avisynth 2.X doubles the number of clips by intercaling a cache clip betweeen others.
But even so the cache clip is not that big either...

You must be using other filters in your script.
IIRC each Deen instance allocates a big memory chunk as buffer, whose is not handled by MemoryMax.

clima
30th September 2003, 16:46
I have encountered exactly the same issue.
I can't apply the filter dup() to the whole source because it becomes laggy on low motion scene, etc...

I have intended to trim the part of the anime to apply the dup filter when it fits well but at the end, I have a memory access violation for avisynth. (I didn't figure it was a memory leak)