Skip to content

Conversation

@slavapestov
Copy link
Contributor

On macOS 26, malloc_zone_statistics() always returns a malloc_statistics_t with the max_size_in_use field set to zero. This was an intentional change, so let's remove calls to this API.

Instead, use the proc_pid_rusage() API and return the ri_lifetime_max_phys_footprint field of rusage_info_v4.

Finally, remove the llvm::sys::Process::GetMallocUsage() call on other platforms altogether. It returns the current value and not the max value, so its misleading.

On macOS 26, malloc_zone_statistics() always returns
a malloc_statistics_t with the max_size_in_use field
set to zero. This was an intentional change, so let's
remove calls to this API.

Instead, use the proc_pid_rusage() API and return the
ri_lifetime_max_phys_footprint field of rusage_info_v4.

Finally, remove the llvm::sys::Process::GetMallocUsage()
call on other platforms altogether. It returns the
current value and not the max value, so its misleading.
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@slavapestov
Copy link
Contributor Author

@swift-ci Please test Windows

@slavapestov slavapestov merged commit c3e07c6 into swiftlang:main Nov 12, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant