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

Garbage collection too passive on worker processes #237

Closed
MilesCranmer opened this issue Jul 26, 2023 · 3 comments
Closed

Garbage collection too passive on worker processes #237

MilesCranmer opened this issue Jul 26, 2023 · 3 comments
Labels
feature (importance: high) High-importance feature

Comments

@MilesCranmer
Copy link
Owner

This might be a Julia bug. Well, not really a bug, but just something that needs better default behavior.

Right now it seems that Julia workers don't know about the memory allocation of other Julia workers, and so garbage collection does not happen as aggressively as it should.

The solution we can implement in SymbolicRegression.jl is for worker processes internall created by addprocs to have a much smaller heap-size-limit (see https://julialang.org/blog/2023/04/julia-1.9-highlights/#memory_usage_hint_for_the_gc_with_--heap-size-hint).

The best resource allocation seems to be letting the head worker have as many threads and a large portion of memory available. But the worker processes should have a single thread and small memory available, so they garbage collect frequently. I think this could be done automatically.

@MilesCranmer MilesCranmer added the feature (importance: high) High-importance feature label Jul 26, 2023
@MilesCranmer MilesCranmer changed the title [BUG]: Garbage collection too passive on worker processes Garbage collection too passive on worker processes Jul 26, 2023
@MilesCranmer
Copy link
Owner Author

This actually might be the reason behind the various segfaults seen during the Windows CI tests... which I could just not seem to identify a root cause of in the source.

Maybe addprocs when used internally does not have great garbage collection settings?

@MilesCranmer
Copy link
Owner Author

cross-ref JuliaLang/julia#50673

@MilesCranmer
Copy link
Owner Author

Fix with #270

MilesCranmer added a commit that referenced this issue Feb 19, 2024
[Diff since v0.23.1](v0.23.1...v0.23.2)

**Merged pull requests:**
- Formatting overhaul (#278) (@MilesCranmer)
- Avoid julia-formatter on pre-commit.ci (#279) (@MilesCranmer)
- Make it easier to select expression from Pareto front for evaluation (#289) (@MilesCranmer)

**Closed issues:**
- Garbage collection too passive on worker processes (#237)
- How can I set the maximum number of nests? (#285)
MilesCranmer added a commit that referenced this issue Feb 19, 2024
[Diff since v0.23.1](v0.23.1...v0.23.2)

**Merged pull requests:**
- Formatting overhaul (#278) (@MilesCranmer)
- Avoid julia-formatter on pre-commit.ci (#279) (@MilesCranmer)
- Make it easier to select expression from Pareto front for evaluation (#289) (@MilesCranmer)

**Closed issues:**
- Garbage collection too passive on worker processes (#237)
- How can I set the maximum number of nests? (#285)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature (importance: high) High-importance feature
Projects
None yet
Development

No branches or pull requests

1 participant