Alt Text

A screenshot of a file manager preview window for my ~/.cache folder, which takes up 164.3 GiB and has 246,049 files and 15,126 folders. The folder was first created about 1.75 years ago with my system

  • bizdelnick@lemmy.ml
    link
    fedilink
    arrow-up
    22
    ·
    edit-2
    11 months ago

    You don’t have to clean your ~/.cache every now and then. You have to figure out which program eats so much space there, ensure that it is not misconfigured and file a bugreport.

    • redd@discuss.tchncs.de
      link
      fedilink
      arrow-up
      6
      arrow-down
      1
      ·
      11 months ago

      So OP’s headline should be saying instead: Reminder to CHECK your ~/.cache folder every now and then

      • bizdelnick@lemmy.ml
        link
        fedilink
        arrow-up
        0
        ·
        11 months ago

        Check? Why?

        % du -sh ~/.cache
        1,6G    /home/bizdelnick/.cache
        

        I don’t remember if I ever cleaned it up. Probably a couple years ago when I moved my old HDD to new PC with freshly installed OS. It does not grow accidentally. Only in some very rare cases. As well as some other dirs under ~ and var. If it is a critical system, set up monitoring of free filesystem space. If not, you will notice if it becomes full (I can’t remember when this happened to me last time, maybe ~15 years ago when some log file started to grow because of endless error messages).

        • redd@discuss.tchncs.de
          link
          fedilink
          arrow-up
          0
          ·
          edit-2
          11 months ago

          Because some users experienced accidential grows like OP had 160 Gbyte. So general advice for linux users can be stated as: Check your ~/.cache every now and then

          Critical systems/servers shall better be monitored as you suggest.

          • bizdelnick@lemmy.ml
            link
            fedilink
            arrow-up
            3
            ·
            11 months ago

            Some users experienced accidential growth of /var/log. Some users experienced accidential growth of /var/cache. Some users experienced accidential growth of /var/lib. Some users experienced accidential growth of ~/.xsession-errors. Shall I continue?

            Does every user need to begin his day checking all that places? No, he does not. It is waste of time. Such situations are extremely rare. If you are paranoid, check df to see if you have enough free space, and only if it unpredictably shrinked begin to ivestigate which directory has grown.

            • redd@discuss.tchncs.de
              link
              fedilink
              English
              arrow-up
              2
              ·
              11 months ago

              I don’t get your point. Why should somebody do this every day?

              As the experience from other users in this thread, it seems not extremely rare to have an overgrown ~/.cache/ folder. So checking it from time to time is a good advice. If we all do this for a time, and create bug tickets for software which is not cleaning up. Then this problem will hopefully go away with future software releases.

              • bizdelnick@lemmy.ml
                link
                fedilink
                arrow-up
                1
                arrow-down
                1
                ·
                11 months ago

                Why should somebody do this every day?

                Why should somebody do this ever?

                As the experience from other users in this thread, it seems not extremely rare to have an overgrown ~/.cache/ folder.

                It is the first thread about overgrown ~/.cache directory I see since I use Linux (~16 years or so). But, as I wrote above, this sometimes (rarely) happens with log files and some other directories. Checking each of them is a waste of time, if not automated, checking just one or few of them makes sense only if you are testing some app and looking for files it creates.

  • ryannathans@aussie.zone
    link
    fedilink
    arrow-up
    5
    ·
    11 months ago

    I did this and now my games have no icons in lutris, some of my gnome settings got reset and my proton email bridge stopped working

  • voxel@sopuli.xyz
    link
    fedilink
    arrow-up
    4
    ·
    edit-2
    11 months ago

    seems like a bug in one of rhe programs you’re using.
    modt software automatically manages it’s cache…
    are you using build caching tools such as Mozilla sccache? These tend to create 20gb+ cache directories, especially if used with debug builds

  • Pantherina@feddit.de
    link
    fedilink
    arrow-up
    2
    ·
    11 months ago

    Your Distro should normally do that for you.

    Advising for this means people will delete random cache and download stuff always.

    Are multiple files in there? If yes you could add a script that only deletes files of certain age.

    • Takios@feddit.de
      link
      fedilink
      arrow-up
      2
      arrow-down
      1
      ·
      11 months ago

      I’m not aware of any distro that automatically clears a user’s .cache in their home directories. Maybe you’re thinking of /var/cache?

  • Marxism-Fennekinism@lemmy.ml
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    11 months ago

    I just map both the user cache and the /tmp directory to a RAM drive. I allocated 4 GB but in practice it never gets even close to that much, and Linux seems to not be reserving the entire 4 GB at boot so I would assume how much RAM is used depends on how much is actually in your cache.

    It also defers cache and tempfile related problems to turning it off and on again.

  • ArcaneSlime@lemmy.dbzer0.com
    link
    fedilink
    arrow-up
    0
    ·
    edit-2
    11 months ago

    …yeah let me go check that…

    13,574 totaling 1.7gb, not too bad. Hey OP how do you get to this view? It looks like we both use nautilus but when I select “properties” on the .cache folder it looks different.

  • Jinn@sh.itjust.works
    link
    fedilink
    arrow-up
    0
    arrow-down
    3
    ·
    11 months ago

    This is one of those things that makes me shake my head about Linux. It’s these small dumb problems that make Linux inaccessible to the common person.

    • TheWoozy@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      11 months ago

      I’ve been running Linux as my primary OS since the late 90s and have never run into this problem.

      • Jinn@sh.itjust.works
        link
        fedilink
        arrow-up
        0
        arrow-down
        1
        ·
        11 months ago

        They do have small annoying issues. This is not one of them. This is something that would completely baffle a non-tech literate person. They’d just observe their computer becoming slow or not having space and say “well, Linux must have broken my computer.”

    • PixxlMan@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      11 months ago

      Windows famously never generates any garbage files. It’s so reliable all servers run windows. Right?