Previous topicNext topic

Odd Graphics Memory release behavior

Questions, comments, feedback, etc.
Post Reply
Terry Payman
Posts: 820
Joined: Sun Sep 14, 2014 8:15 am
Location: UK
Contact:

Odd Graphics Memory release behavior

Post by Terry Payman »

I have often noticed that large projects can take a very long time (say 15s) to unload fully, causing a long delay before another project can be loaded. This has often proved a nuisance in live performance.

I'd assumed the delay was due to some orderly memory release mechanism, but while investigating memory usage I have just discovered that unloading graphics memory can be almost instant. I hope others can reproduce the effect - I'd love a fix!

To see the effect use a large multi-scene project that almost fills graphics memory when all scenes are loaded into it.
- No scenes should have been saved with "Keep Scene in Graphics Memory"
- Ensure Magic Window Option "Load all scenes in Graphics Memory" is unticked

First
- Open the project, note free graphics memory once it's finished loading.
- Load all scenes into memory by ticking Magic Window Option "Load all scenes in Graphics Memory"
- Note free graphics memory, which will have significantly reduced.

For slow release
- Click File > New Project
- Watch the free graphics memory value - it increases very slowly to the maximum.
- Eventually you can click File > New Project

For fast release
- Untick Magic Window Option "Load all scenes in Graphics Memory"
- Watch the free graphics memory value - it maximises almost immediately.
- You can immediately click File > New Project

The same effect can be seen toggling Keep Selected in Graphics Memory" to load/unload the memory, remembering to say "No" to Save Changes.
I see this on three different Windows machines (one Win 10, two Win 11) with both 32- and 64-bit Magic.
Sadler
Posts: 1369
Joined: Sat Aug 02, 2014 7:10 pm
Location: London, UK

Re: Odd Graphics Memory release behavior

Post by Sadler »

In my 500 scene test project it takes about 6 seconds to enable LASIGM and, based on memory status, takes about 6 seconds for new project. Disabling LASIGM took about 1 second, based on watching the memory status display. LASIGM with with project uses around 6GB or memory.
Magic
Site Admin
Posts: 3701
Joined: Wed Apr 09, 2014 9:28 pm

Re: Odd Graphics Memory release behavior

Post by Magic »

How fast is it if you open a big project (without loading it into graphics memory), then immediately create a new project? Is that as fast as your last example?
Terry Payman
Posts: 820
Joined: Sun Sep 14, 2014 8:15 am
Location: UK
Contact:

Re: Odd Graphics Memory release behavior

Post by Terry Payman »

New Project was always fast (~1 sec) in my tests, provided I didn't LASIGM or KSIGM without reversing the process first. I wondered whether it mattered how the memory was used as well as how much was used, so tried changing to 4k resolution so the project would take a lot of memory with only the start scene loaded. Then memory unloaded much faster after New Project (~5x in the test below, compared to the same amount used by KSIGM).

With a 250kB project having no scenes in graphics memory

Start Magic at 854 x 480
(Free=16.413,064kB)
Open project
(Free=16,130,704kB)


Then
New Project ~ 1sec

or
Keep (some) Selected In Graphics Memory, roughly matching the memory required at 4k resolution. (TP note: - Vig FireRing folder)
(Free=10,263,824kB)
New Project ~20 seconds


or
Keep (some) Selected In Graphics Memory, roughly matching the memory required at 4k resolution.
Untick KSIGM << 1sec
New Project ~ 1sec


Same Project, but raising to 4k resolution. Memory unloads much faster than the same amount used by KSIGM.
Start Magic at 854 x 480
(Free=16,408,512kB)
Load project
(Free=16,126,152kB)
Set Graphics Resolution 4096x2160
(Free=10,919,096kB)
New Project ~4 seconds
Magic
Site Admin
Posts: 3701
Joined: Wed Apr 09, 2014 9:28 pm

Re: Odd Graphics Memory release behavior

Post by Magic »

Ok. We'll look at this for a future release. If I recall correctly, loading/unloading from graphics memory requires one frame per scene, so we'll need to run the graphics loop that many times before closing the project.
Post Reply