有没有办法在.NET运行时中监视/记录线程交互,就像VisualVM对Java一样?我目前没有特定的需求,但我认为看看我的应用程序中的所有线程如何交互会很好.

VisualVM和Eclipse TPTP有什么区别?
我正在调查hprofVisualVM中的文件
服务器正在运行JDK 1.4.2_30并且具有1 GB堆,NewSize为200 Mb.
hprof显示由56000个实例占用的堆的71%,int[]并且当在VisualVM中查看时,这些56K阵列中没有一个具有引用
按照我们的说法,如果没有"参考",这应该是垃圾收集.所以问题是:
a)有没有办法找出这些参考文献?
b)这是一个不正确的快照 - 即采取堆转储的操作是否做了某种GC?
c)我们应该在VisualVM中查看"保留大小"对象吗?
作为更新 - 我们仍然不知道它们int[]是什么,但是下一个最大的对象是Pool中的Weblogic内部EJB引用,并且我们在其中一个中发现了一个不正确的设置,它将内存使用率降低了30%来自早期频繁的Full GC
Netbeans的内存监控工具(实际上是嵌入式VisualVm与VisualVm相同的工具)具有用于跟踪内存泄漏的有效度量标准:Surviving Generations Metric.
我对第二个定义有疑问.我知道实例在垃圾收集中存活意味着什么.但是我不确定一代人在垃圾收集中存活意味着什么.这是否意味着至少有一代实例能够在垃圾收集中幸存下来?
对不起,如果这是以前提出的问题的重复,但我已经尝试了这里和其他地方提供的解决方案,但似乎没有一个对我有效.
场景:我需要分析一个生活在防火墙后面的生产Tomcat 7服务器.我只有SSH访问此服务器.选择性能分析工具是Visualvm,这些服务器没有安装GUI.我尝试连接的服务器和机器都运行Ubuntu 10.04服务器LTS.
可能的解决方案:在SSH隧道上使用visualvm似乎是可能的,下面给出的链接提供了一个非常详细的指导:
我还在Tomcat中的/ conf目录中添加了一个jmxremote.access文件,其中包含以下两行:
monitorRole readonly
controlRole readwrite
Run Code Online (Sandbox Code Playgroud)
问题:我按照文章中提供的步骤进行操作,一切似乎都很好.我可以使用jmxterm和指南中给出的连接字符串在本地(从服务器)连接到服务器中的jmx端口.
我根据指南配置了本地tomcat作为测试,Visualvm使用连接字符串连接到这个tomcat实例没有问题.
但是,VisualVM不会通过SSH隧道连接到远程服务器.我尝试了JConsole,因为它更简单,并且具有更好的日志记录功能,我得到以下消息序列:
FINER: [javax.management.remote.rmi.RMIConnector: jmxServiceURL=service:jmx:rmi://localhost:12009/jndi/rmi://localhost:12008/jmxrmi] connecting...
FINER: [javax.management.remote.rmi.RMIConnector: jmxServiceURL=service:jmx:rmi://localhost:12009/jndi/rmi://localhost:12008/jmxrmi] finding stub...
FINER: [javax.management.remote.rmi.RMIConnector: jmxServiceURL=service:jmx:rmi://localhost:12009/jndi/rmi://localhost:12008/jmxrmi] connecting stub...
FINER: [javax.management.remote.rmi.RMIConnector: jmxServiceURL=service:jmx:rmi://localhost:12009/jndi/rmi://localhost:12008/jmxrmi] getting connection...
FINER: [javax.management.remote.rmi.RMIConnector: jmxServiceURL=service:jmx:rmi://localhost:12009/jndi/rmi://localhost:12008/jmxrmi] failed to connect: java.rmi.NoSuchObjectException: no such object in table
Run Code Online (Sandbox Code Playgroud)
关于我在这里做错了什么的任何想法?任何帮助是极大的赞赏!
谢谢.
我想知道是否有类似Java的VisualVM的Python.我需要的功能是对正在运行的Python解释器进行实时分析.
一点背景:我最近对代码库的更改大大减慢了它的速度.我想知道我的代码在做什么而不必重新开始计算.另一种方法是停止解释器并重新启动它-m cProfile,从而减少一天的CPU时间.
任何建议都非常感谢.
我运行了一个Java应用程序,几个小时后它满足了内存需求。我试图用visualvm检测内存泄漏,但是它显示了错误的数据(不知道如何发生)。
在屏幕截图中,您可以看到任务管理器显示了700Mb的内存使用情况,而visualvm显示了225 ...
有人知道这是怎么回事吗?
问候

我一直在尝试获取Spark Streaming作业,在EC2实例上运行以使用JMX向VisualVM报告.
截至目前,我有以下配置文件:
火花/ conf目录/ metrics.properties:
*.sink.jmx.class=org.apache.spark.metrics.sink.JmxSink
master.source.jvm.class=org.apache.spark.metrics.source.JvmSource
worker.source.jvm.class=org.apache.spark.metrics.source.JvmSource
driver.source.jvm.class=org.apache.spark.metrics.source.JvmSource
executor.source.jvm.class=org.apache.spark.metrics.source.JvmSource
Run Code Online (Sandbox Code Playgroud)
我开始像这样的火花流工作:(之后添加的-D位希望远程访问ec2的jmx)
终端:
spark/bin/spark-submit --class my.class.StarterApp --master local --deploy-mode client \
project-1.0-SNAPSHOT.jar \
-Dcom.sun.management.jmxremote \
-Dcom.sun.management.jmxremote.port=54321 \
-Dcom.sun.management.jmxremote.authenticate=false \
-Dcom.sun.management.jmxremote.ssl=false
Run Code Online (Sandbox Code Playgroud) 我的Spring Boot应用程序中有以下配置:
@Configuration
@EnableAsync
@Slf4j
public class AsyncConfig {
private static final int BUFFER = 1024;
@Bean
public AsyncTaskExecutor singleThreadAsyncTaskExecutor(Environment env) {
RingBufferAsyncTaskExecutor rbAsyncExecutor = new RingBufferAsyncTaskExecutor(env);
rbAsyncExecutor.setName("rb-executor");
rbAsyncExecutor.setBacklog(BUFFER);
rbAsyncExecutor.setProducerType(ProducerType.SINGLE);
rbAsyncExecutor.setWaitStrategy(new YieldingWaitStrategy());
log.info("Async task executor loaded");
return rbAsyncExecutor;
}
}
Run Code Online (Sandbox Code Playgroud)
当我运行它时,cpu使用率达到100%(有时100个):
用visualvm调查,我看到了这一点
但是,当我删除AsyncTaskExecutorCPU使用率的实例化为0.4%时,visualvm显示我仅占CPU使用率的1%.
我在使用docker部署它时发现了这个问题,我看到我的主机使用率达到了上限.
我尝试将缓冲区大小(它是2048)降低到1024但没有任何改变.
没有这个bean,我的@Async服务不会异步工作.(No TaskExecutor bean found for async processing)
我正在调查内存泄漏已有相当长的一段时间了,我无法弄清楚。
基本上,我的应用程序每分钟大约查询20次休息服务,从结果中创建POJO,并更新数据库。对于数据库更新,我会在查询过程之后使用建议(主要是)。(我使用Spring的Resttemplate进行查询)
我确实知道的事实:
我的应用程序包含围绕不同接口的3个不同方面。开始调查内存泄漏时,我完全禁用了方面(只是没有导入xml),并且一切正常。
每个方面的工作都是将代理对象收集的数据写入数据库。Hibernate用作dao框架。为确保问题不是由Hibernate引起的,我将所有DAO替换为DummyDAO,它们实现了相同的接口,但实际上什么也没做。
使用VisualVM进行2个小时的分析可以得出以下结果:
显然,两个版本都在稳步增加内存,因此我得出的结论是休眠不会引起内存泄漏。
然后,我检查了自己的代码是否会导致任何地方的内存泄漏,但是由于我仅使用spring singleton,因此可以相当安全地拒绝此操作。VisualVM显示我所有的组件都只有一个实例,模型pojos也都没有增长。
我的方面很小,配置如下:
工人方面
<bean id="aroundWorkerAspect" class="background.aspects.AroundWorkerAspect" >
<property name="afterReturningStrategies" ref="afterReturningStrategies" />
<property name="beforeStrategies" ref="beforeStrategies" />
<property name="afterThrowingStrategies" ref="afterThrowingStrategies" />
</bean>
<aop:config>
<aop:aspect ref="aroundWorkerAspect">
<aop:pointcut id="aroundEachWorker" expression="execution(* common.worker.IWorker.executeJob(common.jobs.IJob)) and args(job)" />
<aop:around pointcut-ref ="aroundEachWorker" method = "processJob" />
</aop:aspect>
</aop:config>
Run Code Online (Sandbox Code Playgroud)
工艺工厂方面
<aop:aspectj-autoproxy/>
<bean id="afterProcessFactoryFillJobAspect" class="background.aspects.AfterProcessFactoryFillJobAspect" >
<property name="startStopLogDAO" ref="startStopLogDAO" />
</bean>
<aop:config>
<aop:aspect ref="afterProcessFactoryFillJobAspect">
<aop:pointcut id="getProcessAsJobList" …Run Code Online (Sandbox Code Playgroud) visualvm ×10
java ×5
memory-leaks ×3
profiling ×3
jmx ×2
spring ×2
.net ×1
amazon-ec2 ×1
apache-spark ×1
eclipse ×1
jvm ×1
monitoring ×1
netbeans ×1
python ×1
reactor ×1
spring-aop ×1
spring-boot ×1
ssh ×1
tomcat7 ×1