DLR的内存占用量是多少? [英] What's the memory footprint of the DLR?

查看:179
本文介绍了DLR的内存占用量是多少?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在考虑限制使用C#的动态关键字。我的初始时间试用令人惊讶 - 表演命中对于100,000次迭代(可能是由于DLR缓存),不到一秒钟。

I'm considering making limited use of C#'s dynamic keyword. My initial time trials were astonishing - a performance hit of less than a second for 100,000 iterations (likely due to DLR caching).

尽管如此,我无法访问内存分析器,而埃里普·皮珀特写道:

I don't have access to a memory profiler, though, and Eric Lippert wrote:

然后启动DLR [...] DLR
然后启动一个特殊版本的
C#编译器...

Then it starts up the DLR [...] The DLR then starts up a special version of the C# compiler...

这是什么内存占用,当动态代码被垃圾收集时,它是否被卸载?

What's the memory footprint of this, and is it unloaded when the dynamic code is garbage-collected?

推荐答案


是否在动态代码垃圾收集时卸载?

is it unloaded when the dynamic code is garbage-collected?



这个问题是假设一个不正确的前提;动态生成的代码不是在当前实现中收集垃圾。缓存并缓存直到appdomain被拆除。我们不知道上一次何时将要调用一个特定的代码路径。

The question presupposes an incorrect premise; the dynamically generated code isn't garbage collected in the current implementation. It is cached and the caches live until the appdomain is torn down. We don't know when the last time a particular code path is going to be called.

如果你想知道对虚拟的影响内存,堆内存,专用字节,共享字节等,那么我的建议是使用内存分析器来回答这些具体问题。有可能感兴趣的六个不同的记忆足迹,我不知道哪一个与你有关系。使用适当的工具来测量任何对你有意义的工具,然后你会知道。

If you want to know the impact on virtual memory, heap memory, private bytes, shared bytes, and so on, then my suggestion is that you use a memory profiler to answer those specific questions. There are a half a dozen different "memory footprints" you could be interested in, and I don't know which one is relevant to you. Use the appropriate tool to measure whatever is interesting to you, and then you'll know.

这篇关于DLR的内存占用量是多少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆