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

Implement Julia GC Heuristics for v1.9.2 #133

Merged
merged 5 commits into from
Feb 22, 2024

Conversation

qinsoon
Copy link
Member

@qinsoon qinsoon commented Feb 20, 2024

No description provided.

@qinsoon qinsoon requested a review from udesou February 20, 2024 23:28
Copy link
Contributor

@udesou udesou left a comment

Choose a reason for hiding this comment

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

LGTM.

}
}

let live_bytes = conversions::pages_to_bytes(reserved_pages_now);
Copy link
Contributor

@udesou udesou Feb 21, 2024

Choose a reason for hiding this comment

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

Could we use the count_live_bytes_in_gc feature and have a fairer comparison with stock Julia? Not that we want to do that necessarily, just wondering if it's as simple as that. I'm also wondering how much their heuristics are dependent on the live bytes instead of live pages.

Copy link
Member Author

Choose a reason for hiding this comment

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

Basically the heuristics use these stats: live bytes/pages, allocated bytes/pages, and freed bytes/pages. We can replace live pages with live bytes in the implementation, but we do not have allocated bytes and freed bytes. I don't think it is a good idea to use live bytes with other page-granularity stats.

Copy link
Member Author

Choose a reason for hiding this comment

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

Also I listed the difference between this implementation and the stock Julia's heuristics here:

/// This tries to implement Julia-style GC triggering heuristics. However, it is still siginificantly different
/// from the Julia's GC heuristics.
/// 1. Julia counts allocation per thread and compares with a per-thread interval, while this impl counts global
/// allocation and compares that with an estimated global interval. For Julia, the first thread that allocates
/// the amount of bytes that exceeds the interval will trigger a GC. For us, as MMTk does not count allocation
/// per thread, we calculate an estiamted global interval (using thread interval * n_mutator / 2), and compare
/// global allocation with it.
/// 2. Julia makes the decision of full heap GC after marking and before sweeping (they call it full sweep), while
/// MMTk makes such decisions before a GC. So for us, we use Julia's decision, but force a full heap GC in the next
/// next GC (not the current one).
/// 3. Julia counts the pointers in the remembered set, and if the remembered set is too large (large_frontier),
/// they will do full heap GC. MMTk does not collect such information about remembered set, so we do not have the heuristic
/// based on the remembered set.
. They are different in many ways.

@udesou udesou merged commit 4a348c0 into mmtk:v1.9.2+RAI Feb 22, 2024
17 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.

2 participants