Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add FreeBSD case to gcenv. #91524

Merged
merged 4 commits into from
Sep 5, 2023
Merged

Add FreeBSD case to gcenv. #91524

merged 4 commits into from
Sep 5, 2023

Conversation

Thefrank
Copy link
Contributor

@Thefrank Thefrank commented Sep 3, 2023

Closes #64935

@ghost ghost added the community-contribution Indicates that the PR has been added by a community member label Sep 3, 2023
@ghost
Copy link

ghost commented Sep 3, 2023

Tagging subscribers to this area: @dotnet/gc
See info in area-owners.md if you want to be subscribed.

Issue Details

Closes #64935

Author: Thefrank
Assignees: -
Labels:

area-GC-coreclr, community-contribution

Milestone: -

@Thefrank
Copy link
Contributor Author

Thefrank commented Sep 3, 2023

Calculated based on #64935 (comment) and reworked from #64935 (comment). I used vm.stats.vm.v_laundry_count as cache always returned 0 for me

sysctl -d vm.stats.vm.v_inactive_count vm.stats.vm.v_free_count vm.stats.vm.v_laundry_count vm.stats.vm.v_cache_count
vm.stats.vm.v_inactive_count: Inactive pages
vm.stats.vm.v_free_count: Free pages
vm.stats.vm.v_laundry_count: Pages eligible for laundering
vm.stats.vm.v_cache_count: Dummy for compatibility
sysctl -h vm.stats.vm.v_inactive_count vm.stats.vm.v_free_count vm.stats.vm.v_laundry_count vm.stats.vm.v_cache_count
vm.stats.vm.v_inactive_count: 8,474,860
vm.stats.vm.v_free_count: 14,076,453
vm.stats.vm.v_laundry_count: 48,202
vm.stats.vm.v_cache_count: 0

Notes for future users:

@@ -431,7 +431,39 @@ GlobalMemoryStatusEx(
// We do this only when we have the total physical memory available.
if (lpBuffer->ullTotalPhys > 0)
{
#ifndef __APPLE__
#if defined (__APPLE__)
Copy link
Member

@am11 am11 Sep 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GlobalMemoryStatusEx in PAL is unused (outside of PAL tests); good candidate of deletion?
i.e. everything this query reports: git grep GlobalMemoryStatusEx ':/src/coreclr/pal'

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have submitted the cleanup in separate PR: #91554

@Thefrank Could you please revert changes in this file? It is dead code.

Copy link
Member

@jkotas jkotas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you!

@Thefrank Thefrank changed the title Add FreeBSD cases to sysinfo and gcenv. Add FreeBSD case to gcenv. Sep 4, 2023
@Thefrank
Copy link
Contributor Author

Thefrank commented Sep 4, 2023

Updated title to reflect changed files.

@jkotas @am11 Thank you both for your continued assistance with community platforms!

@jkotas jkotas merged commit 46d8834 into dotnet:main Sep 5, 2023
147 checks passed
@Thefrank Thefrank deleted the freebsd-sysinfo-mem branch September 29, 2023 20:38
@ghost ghost locked as resolved and limited conversation to collaborators Oct 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-GC-coreclr community-contribution Indicates that the PR has been added by a community member os-freebsd FreeBSD OS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GCMemoryInfo.MemoryLoadBytes is not implemented on FreeBSD
3 participants