简体   繁体   English

同时在多个Java实例上自动执行JAVA内存分析

[英]Automate JAVA memory profiling on multiple java instances at the same time

I'm relatively unexperienced in developing JAVA and I was hoping on getting some advice. 我在开发JAVA方面相对缺乏经验,我希望得到一些建议。

I have a modular JAVA server application setup in which a high level service that acts as a front-end interface which communicates with 8 lower level services. 我有一个模块化的JAVA服务器应用程序设置,其中一个高级服务充当前端接口,与8个较低级别的服务进行通信。

In production, each service is hosted on its own machine. 在生产中,每个服务都托管在自己的机器上。

I'm looking to profile a standard SE development environment which launches all instances locally. 我正在寻找一个标准的SE开发环境,它可以在本地启动所有实例。 I am currently using eclipse and JVMmonitor. 我目前正在使用eclipse和JVMmonitor。

My current workflow involves manually starting each service, followed by triggering the monitoring process on each service manually through eclipse. 我当前的工作流程涉及手动启动每个服务,然后通过eclipse手动触发每个服务的监控过程。 This workflow gets the job done, but I'm sure there is a more intelligent solution someone has come across. 这个工作流程完成了工作,但我确信有人遇到过更智能的解决方案。 Most forum postings only solve monitoring one java instance. 大多数论坛帖子只解决监控一个java实例。

Are there any other stand alone JAVA applications that anyone would suggest? 有没有人会建议其他任何独立的JAVA应用程序? I would like to avoid adding profiling code if possible. 如果可能的话,我想避免添加分析代码。

Most profilers allow you to profile JVMs without the need to manually start the profiler. 大多数分析器允许您分析JVM而无需手动启动分析器。

For example, JProfiler calls this "offline profiling" and the integration wizards in the JProfiler GUI have an option for it: 例如, JProfiler称之为“脱机分析”,JProfiler GUI中的集成向导有一个选项:

在此输入图像描述

Disclaimer: My company develops JProfiler. 免责声明:我公司开发JProfiler。

Use visualVM.You can profile from urs local computer to different servers . 使用visualVM。您可以从本地计算机到不同服务器进行配置。 http://docs.oracle.com/javase/6/docs/technotes/guides/visualvm/applications_remote.html For profiling in different servers you need to define jstatd.all.policy file. http://docs.oracle.com/javase/6/docs/technotes/guides/visualvm/applications_remote.html要在不同服务器中进行性能分析,您需要定义jstatd.all.policy文件。 For example if you want to monitor to different servers say s1,s2,s3 then in s1,s2,s3 server define jstatd.all.policy file and run statd - Virtual Machine jstat Daemon.Then from yours local computer you can monitor 3 s1,s2,s3 servers. 例如,如果要监视到不同的服务器,请说s1,s2,s3然后在s1,s2,s3服务器定义jstatd.all.policy文件并运行statd - 虚拟机jstat Daemon。然后从你的本地计算机上你可以监视3 s1 ,s2,s3服务器。

In very easy to configure it. 在非常容易配置它。

1.Run visualVm you can get eclipe pluging for it. 1.Run visualVm你可以得到eclipe。

2.Run jstatd -J-Djava.security.policy=D:\\jstatd.all.policy // location of yours jstatd.all.policy file in yours servers 2.Run jstatd -J-Djava.security.policy = D:\\ jstatd.all.policy //你的服务器jstatd.all.policy文件的位置

3.In jstatd.all.policy define grant codebase "file:${java.home}/../lib/tools.jar" { 3.在jstatd.all.policy中定义grant codebase“file:$ {java.home} /../ lib / tools.jar”{

permission java.security.AllPermission; permission java.security.AllPermission;

}; };

4.Now connect to yours servers and monitor from local . 4.现在从本地连接到您的服务器和监视器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM