Bug Report

Describe the issue: I’m pretty sure I cleared my image cache 12h ago, after it was at 4GB, and I looked at it just now at 10GB. That’s at least 6GB in 12h, if not 10GB. I did do a bit of scrolling to test some things but it wasnt a lot by any stretch.

There’s definitely something that can cause the cache to explode in size. I don’t have show NSFW enabled on my account and I was mainly scrolling All(with a heavy amount of comms blocked) so I can’t figure out what’s causing this.

In the meantime, until the cause is identified, I think having a functional cache size limit would prevent the cache from exploding in size.


Device Information

  • App Version: 1.0.321 (321)
  • Platform: android
  • OS Version: BP4A.251205.006

Modified Settings

The following settings have been changed from defaults:

  • isNotificationEnabled: 1 (default: 0)
  • commentDividers: 0 (default: 1)
  • isCommentActionsReversed: true (default: false)
  • shouldAlwaysOpenInDefaultBrowser: true (default: false)
  • shouldDisplayTitleAbove: true (default: false)
  • alwaysShowInstance: true (default: false)
  • applyUserNotesGlobally: true (default: false)
  • isEdgetoEdge: false (default: true)
  • alwaysTrustDomains: true (default: false)
  • shouldUseHighRefresh: false (default: true)
  • shouldLimitCardImages: true (default: false)
  • commentTextStyle: bodySmall (default: bodyMedium)
  • postTitleTextStyle: titleSmall (default: titleMedium)
  • customColoursPreset: 2 (default: 0)
  • enableCommentNavigator: false (default: true)
  • isTopBarFixed: true (default: false)
  • showFullVotes: true (default: false)
  • shouldAlwaysDisplayAvatars: true (default: false)
  • shouldInstanceBlockIncludeUsers: false (default: true)
  • shouldHighlightNewComments: true (default: false)
  • isImageVerticalSwipeToClose: false (default: true)
  • defaultRoute: /community?postListingType=All&hint=All (default: null)
  • defaultPostSort: New (default: Active)
  • defaultCommentSort: Top (default: Hot)
  • cardType: list (default: card)
  • swipeActionsComment: [upvote, upvote, downvote] (default: [upvote, save, reply])
  • postActions: [comment, save, share, none] (default: [comment, save, none, crosspost])
  • swipeActionsPost: [hide, none, none] (default: [upvote, save, hide])
  • shouldRemembercommentPosition: false (default: true)
  • shouldUseProfileBanner: true (default: false)
  • shouldResolveOpenGraph: true (default: false)
  • shouldDisplayCommunityBanner: false (default: true)
  • shouldForceBlackImageBackground: false (default: true)
  • theme: amoled (default: system)
  • textSizeMultiplier: 0.875 (default: 1.0)
  • sirxdaemonOP
    link
    fedilink
    arrow-up
    2
    ·
    edit-2
    15 days ago

    Again, mostly scrolling All and it’s over 2GB in under an hour. That doesn’t feel right. It’s certainly possible but seems off given the actual activity engaged. Perhaps allowing the user to view the individual files listed in the cache would provide some enlightenment. I mean what is that 1GB video? I don’t recall watching a video that big. Or any video for that matter.

    EDIT: Also, why are there so many duplicate files in the cache? They have the same file name and size. Presumably they’re from cross-posts or just posts to different communities. Is it feasible to do a checksum if the cache and gets a duplicate file name and prevent downloading duplicates, reducing storage and bandwidth?

    • kuroM
      link
      fedilink
      arrow-up
      3
      ·
      15 days ago

      You should be able to long press on the video to see it.

      I’m going to look at some sort of checksum validation in the next release, although I will only know the checksum once the file has been already downloaded so I might need to come up with a different approach. One change I did make for performance reasons is that instead of checking the total file count against the file limit on every download it’s being throttled to every thirty minutes (in theory…).

      • sirxdaemonOP
        link
        fedilink
        arrow-up
        2
        ·
        15 days ago

        Wait, it’s back in my cache already? I have never seen this video before. Is there a way to view where its coming from?

        /data/user/0/com.kuroneko.lemmy_connect/cache/customCacheKey/a0b59ea0-e510-11f0-a96a-7fc74288dac3.mp4

        • kuroM
          link
          fedilink
          arrow-up
          4
          ·
          15 days ago

          I’ll look into adding some association between a post or comment and the file. Right now I’m just iterating over files in a cache directory and showing their sizes.

          From printing checksums locally this did lead me to a race condition where we were preloading an image at the same time as displaying it and neither approach saw the other one so multiple files got cached. That’ll be fixed tonight…

        • kuroM
          link
          fedilink
          arrow-up
          3
          ·
          15 days ago

          Looking into this specific video more it’s from this guy which is on the All front-page. The thumbnail is actually the full MP4. I’ll add some checks to ensure it’s only images being preloaded in v323.

      • sirxdaemonOP
        link
        fedilink
        arrow-up
        1
        ·
        15 days ago

        Sadly, I already cleared the cache. Will try it out next time though.

  • The cache in general needs to clear itself regularly automatically. I use Lemmy a lot and have had my Connect cache get as large as 100GB before. That is fucking insane that it only seems to empty it when I do so manually.

  • Hnery@feddit.org
    link
    fedilink
    arrow-up
    2
    ·
    15 days ago

    Weird. I have never bothered cleaning any cache, but my size is around 3 GiB. I have a limit of 2 GiB set, though, which makes the behaviour even more interesting.