(gc.trystartnogcregion())未实施该方法或操作。在单声道上
我试图阻止C#收集垃圾一段时间。 我发现可以使用gc.trystartnogcregion()
方法来做到这一点。 但是,这引发了以下例外:
未经治疗的例外: system.notimplemplededException:未实现该方法或操作。 在system.gc.gc.startnogcregionworker(system.int64 catsalsize,system.boolean haslohsize,system.int.int64 lohsize,system.boolean disallawallufullblockinggc)in< 1400EA11D6FD49D49D49D49D4939BE6BE6BBE686ABB4&GTB4 在system.gc.gc.trystartnogcregion(system.int64 caltalsize,system.boolean disallyfullblockinggc)[0x00000] in< 1400EA11D6FD49D49D49D4939BE686A9549549FB4
...
GC.TryStartNoGCRegion(4096, true)
I'm trying to stop C# from collecting garbage for some time.
I found that I can do this using the GC.TryStartNoGCRegion()
method.
However, this throws this exception:
Unhandled Exception:
System.NotImplementedException: The method or operation is not implemented.
at System.GC.StartNoGCRegionWorker (System.Int64 totalSize, System.Boolean hasLohSize, System.Int64 lohSize, System.Boolean disallowFullBlockingGC) [0x00000] in <1400ea11d6fd49d4939be686a9549fb4>:0
at System.GC.TryStartNoGCRegion (System.Int64 totalSize, System.Boolean disallowFullBlockingGC) [0x00000] in <1400ea11d6fd49d4939be686a9549fb4>:0 ...
I executed this line of code:
GC.TryStartNoGCRegion(4096, true)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
显然是单声道本身会导致错误。在源代码
gc.trystartnogcregion()
中抛出一个system.notimplementedexception。Apparently it is Mono itself causing the error. In the source code
GC.TryStartNoGCRegion()
throws a System.NotImplementedException.