Set memory and multiprocessing preferences by choosing Edit > Preferences > Memory (Windows) or After Effects > Preferences > Memory (Mac OS).
As you modify settings in the Memory & Multiprocessing dialog box, After Effects dynamically updates helpful text in the dialog box that reports how it will allocate and use memory and CPUs.
The RAM Reserved For Other Applications preference is relevant whether or not Render Multiple Frames Simultaneously is selected. The settings in the After Effects Multiprocessing category are relevant only if Render Multiple Frames Simultaneously is selected.
Todd Kopriva provides information about optimum memory and processor settings on the Adobe website.
RAM Reserved For Other Applications
Increase this value to leave more RAM available for the operating system and for applications other than After Effects and the application with which it shares a memory pool. (See Memory pool shared between After Effects, Premiere Pro, and Adobe Media Encoder.) If you know that you will be using a specific application along with After Effects, check its system requirements and set this value to at least the minimum amount of RAM required for that application. Because performance is best when adequate memory is left for the operating system, you can’t set this value below a minimum baseline value.
Memory pool shared between After Effects, Premiere Pro, Prelude, Media Encoder, Photoshop, SpeedGrade, and Audition
After Effects shares a memory pool with Adobe CC applications. This is indicated in the Memory preferences panel by the icons for each of these applications at the top of the panel. The icons are dimmed for the applications that are not running.
A memory balancer prevents swapping of RAM to disk by dynamically managing the memory allocated to each of the applications. Each application registers with the memory balancer with some basic information: minimum memory requirements, maximum memory able to be used, current memory in use, and a priority. The priority has three settings: low, normal, and highest. Highest is currently reserved for After Effects and Premiere
An example of a practical result of the shared memory pool is that starting Premiere Pro will decrease the amount of RAM available to After Effects for previews; quitting Premiere Pro will immediately free RAM for After Effects and extend the possible duration of previews.
The Memory Details dialog box contains additional information about installed RAM and current and allowed RAM usage. It also includes a multicolumn table listing processes related to the applications. The table includes information about each process, such as ID, Application Name, Minimum Needed Memory, Maximum Usable Memory, Maximum Allowed Memory, Current Memory, and Current Priority.
To open the dialog box, choose Edit > Preferences > Memory (Windows) or After Effects > Preferences > Memory (Mac OS), and click the Details button at the bottom of the preferences dialog box.
You can copy the information to the clipboard with the Copy button.
Memory requirements for rendering of a frame (either for previews or for final output) increase with the memory requirement of the most memory-intensive layer in the composition.
After Effects renders each frame of a composition one layer at a time. For this reason, the memory requirement of each individual layer is more relevant than the duration of the composition or the number of layers in the composition when determining whether a given frame can be rendered with the available memory. The memory requirement for a composition is equivalent to the memory requirement for the most memory-intensive single layer in the composition.
The memory requirements of a layer increase under several circumstances, including the following:
Increasing the project’s color bit depth
Increasing the composition resolution
Using a larger source image
Enabling color management
Adding a mask
Adding per-character 3D properties
Precomposing without collapsing transformations
Using certain blending modes, layer styles, or effects, especially those involving multiple layers
Applying certain output options, such as 3:2 pulldown, cropping, and resizing
Adding shadows or depth-of-field effects when using 3D layers
After Effects requires a contiguous block of memory to store each frame; it cannot store a frame in pieces in fragmented memory. For information about how much RAM is required to store an uncompressed frame, see Storage requirements for output files.
For tips on decreasing memory requirements and increasing performance, see Improve performance by simplifying your project.
Occasionally, After Effects may display an alert message indicating that it requires more memory to display or render a composition. If you receive an out-of-memory alert, free memory or reduce the memory requirements of the most memory-intensive layers, and then try again.
You can free memory immediately with commands from the Edit > Purge menu:
- All Memory
- Image Cache Memory
- All Memory & Disk Cache
Purging memory is faster for large projects. Purging memory do not synchronize the project database; If you want force synchronization of the project database, press the Option (Mac OS) or Alt (Windows) key and choose Edit >Purge > All Memory. You can do this if you see that the Composition panel fails to update correctly and the Purge> All Memory or All Memory & Disk Cache commands do not help.
The maximum amount of memory that one frame can occupy is 2 GB.
The maximum size for any single memory allocation is 2 GB.
Use the following formula to determine the number of megabytes required to store one uncompressed frame at full resolution:
(height in pixels) x (width in pixels) x (number of bits per channel) / 2,097,152
The value 2,097,152 is a conversion factor that accounts for the number of bytes per megabyte (220), the number of bits per byte (8), and the number of channels per pixel (4).
DV NTSC (720x480) frame in an 8-bpc project: 1.3 MB
D1/DV PAL (720x576) frame in an 8-bpc project: 1.6 MB
HDTV (1920x1080) frame in a 16-bpc project: 16 MB
4K digital cinema (4096x2304) frame in a 32-bpc project: 144 MB
Because video is typically compressed during encoding when you render to final output, you can’t just multiply the amount of memory required for a single frame by the frame rate and composition duration to determine the amount of disk space required to store your final output movie. However, such a calculation can give you a rough idea of the maximum storage space you may need. For example, one second (approximately 30 frames) of uncompressed standard-definition 8-bpc video requires approximately 40 MB. A feature-length movie at that data rate would require more than 200 GB to store. Even with DV compression, which reduces file size to 3.6 MB per second of video, this storage requirement translates to more than 20 GB for a typical feature-length movie.
It is not unusual for a feature-film project—with its higher color bit depth, greater frame size, and much lower compression ratios—to require terabytes of storage for footage and rendered output movies.
As you work on a composition, After Effects temporarily stores some rendered frames and source images in RAM, so that previewing and editing can occur more quickly. After Effects does not cache frames that require little time to render. Frames remain uncompressed in the image cache.
After Effects also caches at the footage and layer levels for faster previews; layers that have been modified are rendered during the preview, and unmodified layers are composited from the cache.
When the RAM cache is full, any new frame added to the RAM cache replaces a frame cached earlier. When After Effects renders frames for previews, it stops adding frames to the image cache when the cache is full and begins playing only the frames that could fit in the RAM cache.
Green bars in the time ruler of the Timeline, Layer and Footage panels mark frames that are cached to RAM. Blue bars in the Timeline panel mark frames that are cached to disk.
Layer Cache Indicators
Layer cache indicators allow you to visualize cached frames on a per-layer basis. This is helpful when trying to determine which layers are cached in a composition.
Enable the Layer Cache Indicators option by pressing Ctrl (Windows) or Command (Mac), and then choose Show Cache Indicators in the Timeline panel menu. The Show Cache Indicators option must be enabled in the menu to see the indicators.
Showing the cache indicators decreases performance slightly.
The RAM cache is automatically purged when you quit After Effects.
You can choose to purge the RAM cache, or the RAM cache and the disk cache from the Edit > Purge menu.
Choose Edit > Purge > All Memory & Disk Cache to purge the contents of all RAM caches (like the existing All Memory command) and the contents of the disk cache (like the existing Empty Disk Cache button in the Media & Disk Cache preferences).
After Effects purges memory faster for large projects. Purging memory do not synchronize the project database. If you want force synchronization of the project database, press the Option (Mac OS) or Alt (Windows) key and choose Edit >Purge > All Memory. You can do this if you see that the Composition panel fails to update correctly and the Purge> All Memory or All Memory & Disk Cache commands do not help.
Purging the disk cache for one version of After Effects doesn't purge the cache for other versions. For example, purging the disk cache from After Effects CC won't affect the disk cache for After Effects CS6.
The global performance cache consists of the following:
Global RAM cache: When you modify a composition, frames in the RAM cache are not automatically erased and are reused if you undo the change or restore the previous state of the composition. The oldest frames in the RAM cache are erased when the RAM cache is full and After Effects needs to cache new frames.
Persistent disk cache: Frames cached to disk are still available, even after closing After Effects.
For more information about the global performance cache, see the blog post entitled, "GPU (CUDA, OpenGL) features in After Effects" on the After Effects Team blog.
Video: Global performance cache
In this video by Todd Kopriva and video2brain, learn about the global performance cache and persistent disk cache, and see how these features make rendering and re-rendering layers much quicker and easier.
The disk cache is not used for previews. It is only used for previews without real time playback of cached frames and audio. (See Previewing.)
Disk Cache is enabled by default. For disk cache preferences, and to enable, or disable disk caching:
Even when disk caching is enabled, each frame must be able to fit into a contiguous block of RAM. Enabling the disk cache doesn’t help with limitations regarding inadequate RAM to hold or render a single frame of your composition.
For best performance with disk caching, select a folder on a different physical hard disk than your source footage. It is best if the folder is on a hard disk that uses a different drive controller than the disk that contains your source footage. A fast hard drive or SSD with as much space allocated as possible is recommended for the disk cache folder. The disk cache folder can’t be the root folder of the hard disk.
As with the RAM cache, After Effects only uses the disk cache to store a frame if it’s faster to retrieve a frame from the cache than to rerender the frame.
The Maximum Disk Cache Size setting specifies the number of gigabytes of hard disk space to use. The default disk cache size is set to 10% of the volume's total size, up to 100 GB.
The application checks to make sure that you have 10 GB free above what is set in Preferences > Media & Disk Cache. After Effects warns you if there is not enough room for the disk cache.
Global RAM cache offers these advantages:
- Cached frames are restored after an undo/redo.
- Cached frames are restored when a composition or layer is returned to a previous state, such as turning a layer's visibility off then back on.
- Reusable frames are recognized anywhere on the timeline (e.g., when using loop expressions, time remapping, or copy/paste of keyframes), not just adjacent frames.
- Reusable frames are recognized on duplicated layers or duplicated compositions;
- Cache is not automatically destroyed by a render queue rendering using anything other than Current Settings.
In this video by Learn by Video you'll see how the RAM and disk caches are used to save time, and how you can render compositions in the background so that you don't need to wait for a preview to be rendered before you can resume work.
Once you save a project, frames in the disk cache are retained even after you close the project or quit After Effects. This protocol is called persistent disk cache.The disk cache is no longer emptied at the end of a session. With the persistent disk cache feature, frames stored in the disk cache is retained between sessions. This saves rendering time as you work on a project or other projects that use the same cached frames.
Upon opening a project, the disk cache is scanned looking for frames matching those in the project, and makes them available for use. The disk cache contains frames from all projects you've opened in the same or earlier sessions, so disk-cached frames from one project will be retrieved for reuse in other projects that need those same frames. As the cache is scanned, blue marks gradually fill in on your timeline.
Because previous versions of After Effects didn't store everything on disk needed for this feature, resave CS5.5 and earlier projects, to experience persistent caching.
Roto Brush frames are not persistently cached.
Cache Work Area in background also uses the disk cache to store frames. See Improve performance using Global Performance Cache.
Video tutorial: How to Optimize After Effects for High Performance
You can fill the disk cache for a composition's work area (or multiple work areas in the same or multiple compositions) while continuing to work. When you do not expect to make changes to a composition, especially if it is used in downstream compositions, you can render the frames to the disk cache in the background. Normally, the application tries to identify appropriate expensive-to-render frames that should be placed in the disk cache, but this command will force those frames to be rendered to the disk cache for quicker retrieval next time they are needed.
To cache to a composition to disk in the background:
Make sure that disk caching is enabled in Edit > Preferences > Media & Disk Cache (Windows) or Premiere Pro > Preferences > Media & Disk Cache (MacOS).
For best results, use a large disk cache on a fast drive that is different from the source footage drive. SSD drives work well for disk caching.
The project is saved to a temporary file on disk, and then a background instance of After Effects is launched to render it. Rendering progress appears in the Info panel. Rendered frames appear as blue cache marks because they are in the disk cache. Layer caches and nested compositions will only get disk cached if worthwhile (expensive enough to render).
You can queue different sections of the same composition or different compositions or from even a different project, but only one work area is being rendered at a time in the background.
If you make a change to a queued work area, the existing render continues to use its previous settings. Blue cache indicators will not reappear until you undo back to that state.
If multiple background jobs are running, the number of jobs will appear as part of the menu command.
When After Effects imports video and audio in some formats, it processes and caches versions of these items that it can readily access when generating previews. Imported audio files are each conformed to a new .cfa file, and MPEG files are indexed to a new .mpgindex file. The media cache greatly improves performance for previews, because the video and audio items are not reprocessed for each preview.
When you first import a file, you may experience a delay while the media is being processed and cached.
A database retains links to each of the cached media files. This media cache database is shared with Adobe Media Encoder, Premiere Pro, Encore, Soundbooth, so each of these applications can each read from and write to the same set of cached media files. If you change the location of the database from within any of these applications, the location is updated for the other applications, too. Each application can use its own cache folder, but the same database keeps track of them all.
Choose Edit > Preferences > Media & Disk Cache (Windows) or After Effects > Preferences > Media & Disk Cache (Mac OS), and do one of the following:
- Click one of the Choose Folder buttons to change the location of the media cache database or the media cache itself.
- Click Clean Database & Cache to remove conformed and indexed files from the cache and to remove their entries from the database. This command only removes files associated with footage items for which the source file is no longer available.
Before clicking the Clean Database & Cache button, make sure that any storage devices that contain your currently used source media are connected to your computer. If footage is determined to be missing because the storage device on which it is located is not connected, the associated files in the media cache will be removed. This removal results in the need to reconform or re-index the footage when you attempt to use the footage later.
Cleaning the database and cache with the Clean Database & Cache button does not remove files that are associated with footage items for which the source files are still available. To manually remove conformed files and index files, navigate to the media cache folder and delete the files. The location of the media cache folder is shown in the Conformed Media Cache preferences. If the path is truncated, click the Choose Folder button to show the path.