MemoryManagementOptions

public struct MemoryManagementOptions

Memory management options.

Note: This is a beta release of this feature and may contain bugs or exhibit unexpected behaviour. Related APIs are subject to change without a deprecation process.

  • The default setting MemoryManagementStrategy.DYNAMIC is suitable for common cases. The map data cache can adjust dynamically to fit visible data. When the visible data needs extra memory, it would increase. When it’s not needed, it will reduce to a limit which is calculated internally or by using MapContext.MemoryManagementOptions.tileCacheMemoryLimitInKiB option. The MemoryManagementStrategy.FIXED would be only useful when there is very strict memory consumption requirement for the application. It potentially can have flickering visual artifacts when the map data to be visualized is very large and exceeds the cache limit.

    Declaration

    Swift

    public var memoryManagementStrategy: MapContext.MemoryManagementStrategy
  • Tile cache memory limit in kibibytes. Non-positive values or nil are ignored. Default value is nil. Low tile cache limit will lead to eviction of tiles only if MemoryManagementStrategy is set to FIXED.

    Declaration

    Swift

    public var tileCacheMemoryLimitInKiB: Int32?
  • Target video memory limit in kibibytes. Non-positive values or nil are ignored. Default value is nil.

    Declaration

    Swift

    public var videoMemoryLimitInKiB: Int32?
  • Scene load cache options. Default value is nil. When loading scenes into MapScene, an internal cache is used for speeding up subsequent loads of the same scene. The cache utilizes some amount of memory for each unique loaded scene and MapContext.SceneLoadCacheOptions allows customization according to the memory profile of the client: under memory constrained conditions the number of entries in this cache can be reduced or the cache can be disabled entirely, and for clients that circle through many scenes, the cache capacity can be increased.

    Declaration

    Swift

    public var sceneLoadCacheOptions: MapContext.SceneLoadCacheOptions?
  • Creates a new instance.

    Declaration

    Swift

    public init(memoryManagementStrategy: MapContext.MemoryManagementStrategy = MapContext.MemoryManagementStrategy.dynamic, tileCacheMemoryLimitInKiB: Int32? = nil, videoMemoryLimitInKiB: Int32? = nil, sceneLoadCacheOptions: MapContext.SceneLoadCacheOptions? = nil)