4

我正在寻找一个您可以链接到的 DLL,这将使您的 .Net 应用程序分析能力等同于 jconsole。具体来说,我想象的是这样的:

  1. 将 DLL 添加到项目中
  2. 你调用了一些初始化方法
  3. 这暴露了一组端点(Web、TCP、命名管道等)。
  4. 这不会影响您的应用程序的性能,因此您可以在生产中使用它。
  5. 遇到麻烦时,您可以连接到端点并配置文件。您可以看到 GC 根、占用内存的内容(保留集)、触发 GC、...

有这样的事情吗?

4

2 回答 2

2

OP: There really isn't.

Simon: Jconsole is a side argument to what is really the difference between java and .net. Java readily presents to the user information which .net obfuscates. Perhaps because of their differing ideologies and goals, java is designed to be a common virtual environment that operates on any host os where .net is principally designed with windows in mind.

.Net processes aren't designed to run in an ambiguous vacuum; they run as component services or parts of iis, and they run on windows, so the virtual environment makes no provisions to provide for remote monitoring because you'll get some degree of that free from wmi.

Java doesn't work that way, because java can't make any assumptions about the underlying os or what information it will provide, and whatever java does must be done equally for all systems. So java offers an enormous amount of data about its memory and thread activity to the user, and provides an infrastructure for handling and discovering managed objects in user code (mbeans). Jconsole and jvisualvm allow the user to remote connect to a java process (either locally or over a network with jmx, although jmx requires a flag to be active on the target java process), and then they can see all this data and browse all available mbeans. On top of that, all of this is core functionality and the programs are free.

.Net flat out doesn't have any of this. It's on the developer from the very onset to build remote management into their application code, and there isn't a convenient viewer that helps users discover what management objects even exist.

Further, java code can be trivially reversed back to source, reconstituted into a project, and then debugged with remote breakpoints against a production system. That much is possible with .net but they certainly don't make it easy to do.

于 2012-03-20T19:36:43.897 回答
1

您是否查看过 .NET Framework 2.0 的 CLR Profiler

作为一个 .NET 人,或者试图成为 -:) 我不确定是否与 jconsole 进行了完全比较,但您可以对事物进行分析。您可以在“CLR 内存分析器”或“.NET 分析器”上找到其他商业工具。

于 2010-12-06T21:19:53.077 回答