This new Canvas+ exclusive feature exposes the “setMaxMemory” utility method. When the max memory threshold is set, Cocoon checks the total amount of texture sizes (images and canvases). When the runtime memory size reaches the max memory threshold, Cocoon disposes of the least recently used textures until the memory fits the threshold. It disposes of textures used for JS Image objects (which can be reloaded later if needed or are drawn again). It doesn’t dispose of canvas objects because they cannot be reconstructed if they are used again in a render operation. This extension is designed to be used in 2D contexts, because in WebGL contexts the developer is the one responsible for memory disposal.

Check out the API documentation.