-
Notifications
You must be signed in to change notification settings - Fork 223
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
[Bug]: 尝试DisposeDomain(),提示异常 #294
Comments
未检测到合适的 ISSUE 推荐给您。感谢您的反馈!
|
试试这个。 var func = NDelegate
.RandomDomain()
.ConfigBuilder(opt => opt.UseSmartMode()) 或者 var func = NDelegate
.RandomDomain()
.ConfigBuilder(opt => opt.ConfigLoadContext(ctx=>ctx.AddReferenceAndUsingCode<object>())) |
var func = NDelegate.RandomDomain().Func<int, int>(code); 把 func 存起来用就可以了。这个需要自己缓存起来。 |
我尝试 1.第一个版本,我尝试 2.当我用上面的方法初始化编译单元,并且主动DisposeDomain的时候,发现内存会一直增长
3.当我只使用 |
@Ramoshuai 卸载原理是,没有元数据保持引用。如果 func 被存起来,或者有相关元数据参与引用会导致无法卸载。 回收检测目前每出现问题,内存有下降,考虑是否是上述问题。 |
另外卸载域与当前方法有关,不可以在main方法里做测试。 |
测试了下可以了,感谢 |
⚙️ OS
Windows (Default)
⚙️ Architecture
Any (Default)
⚙️ .NET Version
.NET6(LTS)
📄 请描述您的问题(Describe the bug).
尝试DisposeDomain(),提示
找不到 RuntimeMetadataVersion 的值。找不到包含 System.Object 的程序集,或未通过选项为 RuntimeMetadataVersion 指定值。
DotNetCore.Natasha.CSharp.Compiler.Domain 8.0.0
DotNetCore.Natasha.CSharp.Template.Core 8.0.0
还有个问题,如果code一样情况下,NDelegate.RandomDomain().Func<int, int>(code)会每次都去创建。
这个是需要自行做缓存控制,还是说后续版本考虑内部优化
⭕ BUG 重现(To Reproduce).
No response
📞 您的联系方式(Contact Details).
No response
The text was updated successfully, but these errors were encountered: