stride3d / stride3d/stride

[Post 4.0] Use AssemblyLoadContext in AssemblyContainer

Open
#981 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area-Build area-GameStudio enhancement
Dominant language
C#
Stars
7.8k
Forks
1.2k
Avg merge
2d 17h
Merged PRs (30d)
49

Description

Is your feature request related to a problem? Please describe.
Right now reloading assemblies is "fake" in that we do load a new version of the assembly, but we never unload the old version (we just forget about it and don't use it). For the most part this shouldn't be an issue (hasn't been so far) but if we can properly clean up the memory we should do it.

Describe the solution you'd like
AppDomains are no longer supported in newer frameworks and something we should look into is AssemblyLoadContext (available for .NET Core 3+), which allows to customize how dependencies of an assembly are loaded and allows proper unloading of all assemblies loaded with that context (see Unloadability).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating AssemblyContainer and its current assembly reloading path. Read the linked AssemblyLoadContext unloadability documentation, then determine the design needed to replace the existing behavior so old assemblies and their dependencies can be properly unloaded and memory reclaimed.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.