Skip to content

Commit

Permalink
Using MADV_FREE in jl_gc_free_page(), with fallback to MADV_DONTNEED. (
Browse files Browse the repository at this point in the history
…#46362)

Co-authored-by: Keno Fischer <keno@alumni.harvard.edu>
  • Loading branch information
apaz-cli and Keno authored Aug 16, 2022
1 parent ec98087 commit ee37ef9
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/gc-pages.c
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,17 @@ void jl_gc_free_page(void *p) JL_NOTSAFEPOINT
}
#ifdef _OS_WINDOWS_
VirtualFree(p, decommit_size, MEM_DECOMMIT);
#elif defined(MADV_FREE)
static int supports_madv_free = 1;
if (supports_madv_free) {
if (madvise(p, decommit_size, MADV_FREE) == -1) {
assert(errno == EINVAL);
supports_madv_free = 0;
}
}
if (!supports_madv_free) {
madvise(p, decommit_size, MADV_DONTNEED);
}
#else
madvise(p, decommit_size, MADV_DONTNEED);
#endif
Expand Down

2 comments on commit ee37ef9

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

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

Executing the daily package evaluation, I will reply here when finished:

@nanosoldier runtests(ALL, isdaily = true)

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

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

Your package evaluation job has completed - possible new issues were detected. A full report can be found here.

Please sign in to comment.