How Arena uses RAM

Post your questions here and we'll all try to help.
User avatar
Arvol
Knows Resolume better than the devs
Posts: 1401
Joined: Thu Jun 18, 2015 17:36
Location: Oklahoma, USA

Re: How Arena uses RAM

Post by Arvol »

AEK wrote: Wed Jan 22, 2020 21:43 We just recently started working on Resolume. Now we are doing as many tests as possible in order to avoid surprises during concert work. Therefore, we try to understand the logic of the operation of such an important element as loading footages. Our computer has 2 SSHD drives of 1 TB each and 16GB RAM. We want to know that such a configuration will be sufficient for normal operation without lags. If this is not the case, will the increase in RAM improve the situation or is it necessary to prepare for the change of SSHD to SSD. Our immediate tasks are output in 1 or 2 streams with FULL HD resolution
I have 16GB of ram, a nvme and a gtx1080 and can run content on any stage without issues.

If you want to use more than 2 outputs, having a beefier gpu will help.

User avatar
AEK
Is taking Resolume on a second date
Posts: 28
Joined: Tue Jan 07, 2020 18:50

Re: How Arena uses RAM

Post by AEK »

Our Dell computer has a GeForce GTX 1050Ti installed. But I'm more concerned with the process of loading footages from disk. How does Arena pump footage - at what time and how does it use RAM?

Zoltán
Team Resolume
Posts: 4714
Joined: Thu Jan 09, 2014 13:08
Location: Székesfehérvár, Hungary

Re: How Arena uses RAM

Post by Zoltán »

If you plan to play more than one footage file at a time, I'd recommend using an SSD.
There is some caching on the OS level for frequently accessed files, your SSHD would also do some caching, but if you play a file which is not cached, it will have to be read form the HDD, at HDD speeds and latency.
Theatre sound engineer, photographer, programmer, aka ravensc.
Control Your show with ”Enter” - multiple Resolume servers at once - SMPTE/MTC column launch
try for free: http://programs.palffyzoltan.hu
VJ footage: https://goo.gl/58oHy7

User avatar
AEK
Is taking Resolume on a second date
Posts: 28
Joined: Tue Jan 07, 2020 18:50

Re: How Arena uses RAM

Post by AEK »

How the system cache works I understand. I don’t understand how Arena works by organizing video streaming. Does it display footage in blocks directly from the disk, or does it proactively load footages into RAM? The footage that is being output to the projector is currently not completely in RAM?

Menno
Team Resolume
Posts: 103
Joined: Tue Mar 12, 2013 13:56

Re: How Arena uses RAM

Post by Menno »

Hi AEK,

our memory usage actually varies per codec, platform, resolume version and gpu architecture. I'll be explaining how it works when playing back dxv2 on windows in resolume 7 width a dedicated graphics card.

As you've already noticed, Resolume does not load the entire file into memory. Our users tend to create gigantic decks, up to the point where having everything in ram just doesn't fit. We could in theory load as much as possible, however this has several problems:
  • The first problem is that Resolume is mostly used in environments where multiple applications are used simultaneously to run the show. If we were to hog the entire memory that wouldn't leave anything for other applications. We cannot detect which applications you intend to run, so we would never know how much we should leave free.
  • Another issue would be unpredictability of playback. If we were to load the first half of your deck into memory, you would get an unexplainable performance hit when playing something from the second half.
  • The last issue is one where memory throughput actually becomes a bottleneck for us is some scenarios. This is related to all the memory based operations we need to do in order to get the frame to be visible on screen. It's a complex scenario to describe, but sometimes having a fast ssd in combination with ram can net us faster results than having just ram.
So rather than loading the entire file into memory we've tuned our video engine for streaming video data one frame at a time. In order to stream a single frame we need several buffers of ram.
  • First we need a buffer to read the frame's cpu compressed data into. Depending on having alpha available this buffer's size is somewhere around (width*height*4 / 8 / ~1.4) for rgb and (width*height*4 / 4 / ~1.4) for rgba.
  • Once we've read in the frame from file we need to apply the cpu decompression step. This buffer will remove the ~1.4 compression factor, so it'll be that much bigger
  • Then it's time to upload the frame because the /4 and /8 compression factors are for gpu based compression. In order to upload texture data we need another buffer of the previous size but from the pinned memory pool. This is special driver memory that cannot be paged out to disk by the os.
At this point the video frame is present on the gpu and we'll be recycling the buffers for next frame.

Now it's time to tell you i lied :twisted:. During a trigger of a single video file we're actually doing this for two frames simultaneously. Once for the frame that has to show up immediately and once for the next frame. After the initial trigger only the 'next frame' buffers are required and the 'current frame' buffers are free to be recycled for other clips, if not for the next system...

As final step we've introduced an overarching system in v7. v7 inspects the current contents in the deck and tries to preallocate the maximum amount/size of buffers that could ever be used in that deck. For example it looks inside of each layer and determines the two largest clips that could be playing inside that layer (depending on trigger target and transition usage). It'll also look at how much memory will be used by outputs as well as do the same thing for video memory. Al of these requirements are added up and will be made ready over time if memory allows (up to 80%)


All of this is just for the video frames themselves. But as you can see it's already highly dynamic and hard to predict how much memory will be used. For example the 1.4 compression factor may be different if the frame is easier/harder to compress. The /4 and /8 factors may change depending on codec, eg dxv3 uses a different setup of buffers. The intermediate buffer is not required on macos so will be skipped altogether. The memory preallocation system is not present in v6 so then buffers are allocated when they're needed but not present (eg triggers)
On top of this you probably already know the OS also has a way of using 'unused' memory. If you want more details you could use a tool like RamMap to see how much of your memory is actually not used during a show.

Sorry i wasn't able to give you an exact answer, but i hope this gives you a general idea as to what's going on.

User avatar
AEK
Is taking Resolume on a second date
Posts: 28
Joined: Tue Jan 07, 2020 18:50

Re: How Arena uses RAM

Post by AEK »

Hi Menno,

I did not expect to get such a professional answer. Many thanks! Now I know a lot more and I feel good about it ....:D
I understand what kind of free RAM planning problems you encounter. But, you are not the first to do this. Maybe it makes sense to take advantage of the experience of Adobe? In its legendary Photoshop program, Adobe provided the user with RAM allocation. This is done in % of the total memory. It seems to me that if Resolume at start up knows exactly how much RAM is available to it, then footage loading algorithms may be more effective than those that you have to use now.

User avatar
francoe
Is seriously in love with Resolume. Met the parents and everything
Posts: 362
Joined: Thu Nov 27, 2008 23:30

Re: How Arena uses RAM

Post by francoe »

Oh Menno, this is the kind of stuff I allways wanted to read. This enlight a couple of things for me. I will love some day to have a global idea of how h264 is managed on osx, but that's another question.

AEk, I use to think the adobe memory management is just a disaster! Don't you?

User avatar
AEK
Is taking Resolume on a second date
Posts: 28
Joined: Tue Jan 07, 2020 18:50

Re: How Arena uses RAM

Post by AEK »

Hi francoe.
I have no complaints about Adobe's memory management. But, it should be a lot .... A lot!
And there will always be few .... 8-) :lol:

User avatar
francoe
Is seriously in love with Resolume. Met the parents and everything
Posts: 362
Joined: Thu Nov 27, 2008 23:30

Re: How Arena uses RAM

Post by francoe »

I can't undestand that lot/few thing (sorry, bad english, missed the joke!).
But when you talk about photoshop memory allocation, think it just stores snapshots and clipboard stuff.
Then when you look at AE or Premiere, when dynamic caching and memory allocation comes to play, crashes are the order of the day. That's why we see steps foward and backward between versions. I can't think another piece of software with so many launching bugs (need a bug icon here :lol: ).

Post Reply