Skip to content

[Bug] #92

Closed
Closed

Description

@ydq

Describe the bug
The size statistics of the app are incorrect

Screenshots

Image

Environment

  • macOS version: 26.5
  • PureMac version: 2.2.0
  • Install method: DMG

Activity

  1. added
    bug
    on May 15, 2026
  2. momenbasel commented on May 23, 2026

    @momenbasel
    Owner

    Thanks for the report. The screenshot shows the size displayed for a specific app — to investigate I need a bit more context:

    1. Which app is the one with the incorrect size? (the screenshot is cropped above the app name)
    2. What size does Finder show for the app bundle (right-click → Get Info)?
    3. What size does PureMac report?
    4. Does PureMac's number include the bundle only, or also the app's per-user files (Application Support, Caches, Containers)? The 'Installed Apps' list shows the bundle size; the 'Files for this app' panel adds the related files. The discrepancy between the two is expected.

    If you confirm the number differs from du -sh /Applications/<App>.app by more than the per-user files would account for, I can reproduce locally.

  3. momenbasel commented on May 23, 2026

    @momenbasel
    Owner

    Fixed on main by commit b50a8a8.

    Root cause: AppInfoFetcher.appSize(at:) had a 'fast path' that read totalFileAllocatedSizeKey on the bundle directory URL and returned it if non-zero. On APFS that resource value, when queried on a directory, returns only the size of the directory inode itself (~4 KB) - not the recursive sum of everything in the bundle. The size > 0 guard always passed, so the function exited early with the directory inode size and never enumerated the contents. Every installed app reported as a few kilobytes.

    Changes in PureMac/Logic/Scanning/AppInfoFetcher.swift:

    • Dropped the broken fast-path entirely. The function now always enumerates the bundle.
    • Sums totalFileAllocatedSize per regular file (falls back to fileAllocatedSize) so the number matches Finder's 'Size on disk' rather than logical size, which is what users expect when comparing against macOS Storage Management.
    • Skips symlinks to avoid double-counting and to stop following links that escape the bundle.
    • Removed the 10 000-file enumeration cap. Xcode, MS Office, Adobe apps and JetBrains IDEs all exceed it; capping silently underreported them.

    After the next release, the displayed size should match du -sh /Applications/<App>.app within filesystem rounding (APFS allocation block size).

    Will ship in v2.3.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions