Skip to content

Add FreeBSD case to gcenv. - #91524

Merged
jkotas merged 4 commits into
dotnet:mainfrom
Thefrank:freebsd-sysinfo-mem
Sep 5, 2023
Merged

jkotas merged 4 commits into
dotnet:mainfrom
Thefrank:freebsd-sysinfo-mem

Conversation

@Thefrank

@Thefrank Thefrank commented Sep 3, 2023

Copy link
Copy Markdown
Contributor

Closes #64935

@ghost ghost added area-GC-coreclr community-contribution Indicates that the PR has been added by a community member labels Sep 3, 2023
@ghost

ghost commented Sep 3, 2023

Copy link
Copy Markdown

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

Thefrank commented Sep 3, 2023

Copy link
Copy Markdown
Contributor Author

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:

Comment thread src/coreclr/pal/src/misc/sysinfo.cpp Outdated
if (lpBuffer->ullTotalPhys > 0)
{
#ifndef __APPLE__
#if defined (__APPLE__)

@am11 am11 Sep 4, 2023 •

Copy link
Copy Markdown
Member

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
Copy Markdown
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.

@jkotas jkotas left a comment

Copy link
Copy Markdown
Member

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

Thefrank commented Sep 4, 2023

Copy link
Copy Markdown
Contributor Author

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
@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