Use this property to define the maximum resource cache size for a given runtime allocation type. It can be set to either an int value representing the maximum cache size in bytes or a list of cache sizes for each AllocationType.

The resource cache is used to cache resources with the "OnDemand" cache policy. This includes all compressed resources and resources with the "OnDemand" policy. When such resources are visible, they are copied to the resource cache depending on the resource's runtime allocation type. If the cache is full, resources that have been in the cache for the longest time without being used are removed in order to accommodate the new resource.

Ensure that the maximum cache size is larger than the size of the biggest resource with the "OnDemand" cache policy. An ideal cache size should accommodate all the "OnDemand" images, which are visible at the same time. This avoids the need to decompress or copy the resources to RAM on each frame update.

For example, a 400x300 image with 32 bpp color depth occupies up to 480,000 bytes of RAM. If there could be two such images visible at the same time, and their cache policy is "OnDemand", a reasonable cache size would be 960,000 bytes.

Note: Depending on the memory allocator used, and heap memory fragmentation caused by a series of allocations and deallocations, the physical memory usage might be slightly larger than the given maximum cache size.


MCU.Config {
    // single value
    // maxResourceCacheSize: CacheSize
    maxResourceCacheSize: 3000
MCU.Config {
    // list of cache sizes per (optional) allocation type
    // maxResourceCacheSize: [ [ CacheSize, (AllocationType) ] , ... ]
    maxResourceCacheSize: [
        [1000, 128],
        [2000, 129],


This property was introduced in QmlProject API 1.3.

See also qul_set_maximum_resource_cache_size.

Available under certain Qt licenses.
Find out more.