Thread: Avisynth+
View Single Post
Old 6th July 2016, 15:21   #2008  |  Link
ultim
AVS+ Dev
 
ultim's Avatar
 
Join Date: Aug 2013
Posts: 359
Quote:
Originally Posted by pinterf View Post

Quote:
Originally Posted by Groucho2004 View Post
I'm aware of how much memory these frame sizes need (more or less).
I'm not sure if you realize that the point of that script is simply to force Avisynth to run out of memory and see how it behaves.

So, the only question is why the new version behaves differently.
Accidental.
Now (maybe the running programs changed the memory consumption a bit) my test even did not return from a simple malloc.
While there is intensive memory swapping in the background.

So frame reservation error is caught, C++ object reservations and internals can cause C0000005 in the VC runtime, or other buffer reservations (Avisynth BufferPool for temporary buffers) can result in silent death in malloc when it cannot reserve e.g. a 2G memory area.
Here is a quick guess, but I will only be able to check it later in the evening.

The new resizers in the MT-branch use the IScriptEnv2->Allocate() to request temporary storage instead of requesting frame buffers (this is both faster and more memory-efficient). But if I remember correctly, Allocate() returns a NULL pointer when it runs out of memory instead of throwing an exception. My bet is that the resizers don't inspect the return value for error and so you get an access violation due to NULL-pointer dereference. If this guess is correct, the fix is to check the return value of allocate inside the resizer for NULL, and if NULL, call env->Throw().
__________________
AviSynth+

Last edited by ultim; 6th July 2016 at 15:25.
ultim is offline