Clean Lenses repository cache

Options
Jorge Costa
Jorge Costa Posts: 13 🔥

How can we clean programmatically the lenses repository cache?

Also, is it memory cache, disk cache, or both?

Thanks in advance!

Tagged:

Comments

  • stevenxu
    stevenxu Posts: 598 👻
    Options

    @arashp when you get a chance!

  • arashp
    arashp Posts: 52 🔥🔥
    Options

    Thanks @stevenxu, @Jorge Costa

    The lens repository is written to disk. It is refreshed every 12 hours or on every app launch. There is an API for determining the size of the cache: SCCameraKitCacheConfig. But there is no API for cleaning or invalidating the cache.

    Could you tell us a little more about the use case?

  • Jorge Costa
    Jorge Costa Posts: 13 🔥
    Options

    Thanks.

    Yes, SCCameraKitCacheConfig was the only thing I found related, but it doesn't help.

    We started monitoring our memory usage on the app better, and since we have a ScrollView for our users to preview our lenses, it's possible to load and apply several lenses in a matter of seconds.

    We notice that SCCameraKit doesn't clean everything from memory when we change from one lens to another. We also tried to use the `clear´ method from the lens processor; it helped a bit, but we still see the memory increasing and not being totally cleaned.

    We see the same behavior on the CameraKitSample.

    That's why I'm asking if it's possible to add a method to get a better cleaning.

  • arashp
    arashp Posts: 52 🔥🔥
    edited April 16 #5
    Options

    Hi @Jorge Costa -- thanks for explaining the use case. We do expect the overall memory footprint to increase until all Lenses are cached or until the app hits the Lens cache size limit. And yes clear does just clears the currently applied Lens.

    We will need to investigate further if you find the memory footprint increases beyond the cache size limit.

    I will pass on the request for clearing the cache to the team. Thanks again!