<p>At work we have an application to play 2K (2048*1556px) OpenEXR film sequences. It works well.. apart from when sequences that are over 3GB (quite common), then it has to unload old frames from memory, despite the fact all machines have 8-16GB of memory (which is addressable via the linux BIGMEM stuff).</p>

<p>The frames have to he cached into memory to play back in realtime. The OS is a several-year old 32-bit Fedora Distro (not possible to upgradable to 64bit, for the foreseeable future). The per-process limitation is 3GB per process.</p>

<p>Basically, is it possible to cache more than 3GB of data in memory, somehow? My initial idea was to spread the data between multiple processes, but I've no idea if this is possible..</p>

[{'answer_id': 41661, 'author': 'Rob Walker', 'author_id': 3631, 'author_profile': 'https://Stackoverflow.com/users/3631', 'pm_score': 3, 'selected': True, 'text': '<p>How about creating a RAM drive and loading the file into that ... assuming the RAM drive supports the BIGMEM stuff for you.</p>\n\n<p>You could use multiple processes: each process loads a view of the file as a shared memory segment, and the player process then maps the segments in turn as needed.</p>\n'}, {'answer_id': 41962, 'author': 'KeithB', 'author_id': 2298, 'author_profile': 'https://Stackoverflow.com/users/2298', 'pm_score': 2, 'selected': False, 'text': '<p>One possibility may be to use mmap.  You would map/unmap different parts of your data into the same virtual memory region.  You could only have one set mapped at a time, but as long as there was enough physical memory, the data should stay resident.</p>\n'}, {'answer_id': 42007, 'author': 'Adam Davis', 'author_id': 2915, 'author_profile': 'https://Stackoverflow.com/users/2915', 'pm_score': 1, 'selected': False, 'text': '<p>I assume you can modify the application.  If so, the easiest thing would be to start the application several times (once for each 3GB chunk of video), have each one hold a chunk of video, and use another program to synchronize them so they each take control of the framebuffer (or other video output) in turn.  </p>\n\n<p>The synchronization is going to be a little messy, perhaps, but it can be simplified if each app has its own framebuffer and the sync program points the video controller to the correct framebuffer inbetween frames when switching to the next app.</p>\n'}, {'answer_id': 42105, 'author': 'Stu Thompson', 'author_id': 2961, 'author_profile': 'https://Stackoverflow.com/users/2961', 'pm_score': 1, 'selected': False, 'text': '<p>My, what an interesting problem :)</p>\n\n<p>(<strong>EDIT</strong>: Oh, I just read Rob\'s ram drive post...I got all excited by the problem...but have a bit more to suggest, so I won\'t delete)</p>\n\n<p>Would it be possible to... </p>\n\n<ol>\n<li>setup a multi-gigabyte ram disk, and then</li>\n<li>modify the program to do all it\'s reading from the "disk"?</li>\n</ol>\n\n<p>I\'d guess the ram disk part is where all the problem would be, since the size of the ram disk would be OS and file system dependent.  You might have to create multiple ram disks and have your code jump between them.  Or maybe you could setup a RAID-0 stripe set over multiple ram disks.  Or, if there are still OS limitations and you can afford to drop a couple grand (4k?), setup a hardware RAID-0 strip set with some of those new blazing fast solid state drives.  Or...</p>\n\n<p>Fun, fun, fun.</p>\n\n<p>Be sure to follow up!</p>\n'}, {'answer_id': 46619, 'author': 'Stu Thompson', 'author_id': 2961, 'author_profile': 'https://Stackoverflow.com/users/2961', 'pm_score': 0, 'selected': False, 'text': "<p>@dbr said:</p>\n\n<blockquote>\n  <p>There is a review machine with an absurd fiber-channel-RAID-array that can play 2K files direct from the array easily. The issue is with the artist-workstations, so it wouldn't be one $4000 RAID array, it'd be hundreds..</p>\n</blockquote>\n\n<p>Well, if you can accept a limit of ~30GB, then maybe a single 36GB SSD drive would be enough?  Those go for ~US$1k each I think, and the data rates might be enough.  That very well maybe cheaper than a pure RAM approach.  There are smaller sizes available, too.  If ~60GB is enough you could probably get away with a JBOD array of 2 for double the cost, and skip the RAID controller.  Be sure only to look at the higher end SSD options--the low end is filled with glorified memory sticks.  :P</p>\n"}]
['https://Stackoverflow.com/questions/41643', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/745/']