View Full Version : Add setmemorymax for 3 scripts running together ?
Music Fan
20th August 2015, 11:07
Hi,
I'd like to run 3 scripts at the same time (because CPU usage is around 30 % for each) and I'd like to know if there is a crash or bug risk if I don't add setmemorymax function.
What could be a good value in this case ?
I have Windows 7 64b with 4 GB of RAM.
foxyshadis
20th August 2015, 11:56
As long as each individual script doesn't crash, running them side-by-side won't crash or change the output (barring plugin bugs). Watch your memory use, though, because if you exceed your free physical memory you'll get a lot of disk churn, which will hugely degrade your encoding speed.
Music Fan
20th August 2015, 13:22
Ok thanks, the memory used by Virtual Dub when encoding 1 of these scripts in Lagarith is around 620 MB.
In which case is it recommended to use setmemorymax ?
foxyshadis
22nd August 2015, 01:04
Even 4-5 of that would comfortably fit into 4GB, so no worries.
SetMemoryMax only restricts AviSynth's caching, not any plugins, so it's only a small difference in many scripts. You shouldn't mess with SetMemoryMax unless you actually are running out of space; a reasonably large cache is helpful in most scripts.
Music Fan
22nd August 2015, 09:50
Ok, does it mean AviSynth 32bit is Large Address Aware ? If it isn't, is each script limited to 2GB max, even if several scripts running together can use more than 2GB ?
Groucho2004
22nd August 2015, 10:31
Ok, does it mean AviSynth 32bit is Large Address Aware ? If it isn't, is each script limited to 2GB max, even if several scripts running together can use more than 2GB ?
32 Bit Avisynth (i.e. avisynth.dll) itself isn't Large Address Aware. A 32 Bit application that uses Avisynth needs to be LAA in order to address up to 4 GB (on a 64 Bit OS).
When you run 2 or more encodes simultaneously, they all have their own address space and are therefore independent. How many simultaneous encodes you can run is largely determined by the available memory.
Music Fan
22nd August 2015, 13:04
Thanks, a few more questions to be sure I understand correctly ;
A 32 Bit application that uses Avisynth needs to be LAA in order to address up to 4 GB (on a 64 Bit OS).
Ok, thus if Virtual Dub is LAA, a single script can use more than 2 GB, even with Avisynth 32 bit ?
But if I specify setmemorymax(512), the script won't use more than 512 MB, whatever Virtual Dub is LAA or not ?
And I guess that the program using the script (Virtual Dub for example) also needs some memory that is added to the quantity of memory used by the script (for a total of 512 + this quantity), right ?
Groucho2004
22nd August 2015, 13:42
Ok, thus if Virtual Dub is LAA, a single script can use more than 2 GB, even with Avisynth 32 bit ?
Yes, but only on a 64 Bit OS.
But if I specify setmemorymax(512), the script won't use more than 512 MB, whatever Virtual Dub is LAA or not ?
Read foxyshadis' reply again -> "SetMemoryMax only restricts AviSynth's caching". Some filters use a lot more than that.
And I guess that the program using the script (Virtual Dub for example) also needs some memory that is added to the quantity of memory used by the script (for a total of 512 + this quantity), right ?
Correct.
Music Fan
22nd August 2015, 13:49
Read foxyshadis' reply again -> "SetMemoryMax only restricts AviSynth's caching". Some filters use a lot more than that.
Ok, I didn't realize filters were not included in this total.
And when I look at the quantity of memory used by Virtual Dub in the task manager, does it include everything used by avisynth, the script (and its filters) and Virtual Dub ?
Groucho2004
22nd August 2015, 13:56
Ok, I didn't realize filters were not included in this total.They are as far as I know but I have seen scripts using 2 GB of memory even though SetMemoryMax was at the default 512 MB, especially with SEt's AVSMT.
I'm not sure why, have not tried to figure it out (yet) and I never use these monster scripts like MCTD.
Groucho2004
22nd August 2015, 13:57
And when I look at the quantity of memory used by Virtual Dub in the task manager, does it include everything used by avisynth, the script (and its filters) and Virtual Dub ?
Yes, it does. For a detailed process analysis I recommend you use ProcessExplorer.
Music Fan
22nd August 2015, 14:04
Thanks, last question : how to know the maximum quantity of memory that will be used by Virtual Dub (I mean for one script) ? Because in the task manager, when playing a script in Virtual Dub, this quantity increases. Does it reach a limit after a certain period ?
Groucho2004
22nd August 2015, 14:07
Thanks, last question : how to know the maximum quantity of memory that will be used by Virtual Dub (I mean for one script) ?
No way to know in advance, too many variables - script, filters, resolution, threads,...
Because in the task manager, when playing a script in Virtual Dub, this quantity increases. Does it reach a limit after a certain period ?
One can only hope. :D
Music Fan
22nd August 2015, 16:43
Yeah, fortunately my pc hasn't yet exploded :scared: ;)
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.