Options need to be added to the standard launch of a virtual machine (VM) to enable the debugging architecture, allowing us to attach (hook in) and collect data.

-Xdebug

Enables remote debugging.

-Xnoagent

On a Sun VM, disables the proprietary debugging interface thus letting JPDA work correctly.在Sun VM上,禁用专有调试接口,从而允许JPDA正确工作。

-Djava.compiler=NONE

Disables Just-In-Time (JIT) compilation..

我们一般debug程序的时候,只是关注其中的一部分代码,而且大部分情况下是设置断点,然后单步执行,而JIT的编译单位是class,只要我们执行了class里面的代码,JIT就会对整个class进行编译,而我们实际执行的代码一般都是其中的一部分代码,所以从整个时间效率上来看,采用JIT反而更费时间。也就是说在JVM远程调试这个事情上,禁用JIT(只使用转译器,解释一行执行一条)更合理,所以通过-Djava.compiler=NONE来禁止JIT。

-Xrunjdwp:

transport=dt_socket,

server=y,

address=5000,

suspend=y

Loads JDWP (Java Debug Wire Protocol), the reference implementation of JPDA. Sub-options further specify the option.

transport=dt_socket

Sets the transport type for the connection with the debugging application; in this example, we will connect via a socket.

server=y

Tells the VM whether it must be receptive to an attaching debugging application.

address=5000

The port address for our connection; we will need 5000 for our example.

suspend=y

This option can be set depending on whether we want to suspend the exectution of the VM until a debugging application connects. This is useful if we seek to understand what happens when a server starts.

1、If we wish to make the VM wait for a connection before a full launch, we will need a command line such as this :

java …. -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,address=,suspend=y

2、If we want the VM to be fully executing and listening for a debugging application, we will require a command line such as this one :

java …. -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,address=,suspend=n

第2种模式是一种比较好的方式,VM采用侦听的方式等待调试程序的连接。

Configuring the launch of the remote virtual machine to debug的更多相关文章

  1. [SQL in Azure] Windows Azure Virtual Machine Readiness and Capacity Assessment

    http://technet.microsoft.com/en-us/solutionaccelerators/dd537566.aspx http://blogs.technet.com/b/map ...

  2. [SQL in Azure] Provisioning a SQL Server Virtual Machine on Azure

    http://azure.microsoft.com/en-us/documentation/articles/virtual-machines-provision-sql-server/ Provi ...

  3. PatentTips - Improving security in a virtual machine host

    BACKGROUND Computer viruses are a common problem for computer users. One typical mode of attack is t ...

  4. Configuring Network in CentOS 6.3 Virtual Box + Screenshots

    Configuring Network in CentOS 6.3 Virtual Box + Screenshots Posted: May 23, 2013 in Uncategorized Ta ...

  5. [译] libvirt 虚机的生命周期 (Libvirt Virtual Machine Lifecycle)

    翻译自:http://wiki.libvirt.org/page/VM_lifecycle   这篇文章描述虚机生命周期的基本概念.其目的在于在一篇文章中提供完整的关于虚机创建.运行.停止.迁移和删除 ...

  6. Internet Explorer for Mac the Easy Way: Run IE 7, IE8, & IE9 Free in a Virtual Machine

        From link: http://osxdaily.com/2011/09/04/internet-explorer-for-mac-ie7-ie8-ie-9-free/ If you’re ...

  7. 60年代进程 80年代线程 IPC How the Java Virtual Machine (JVM) Works

    小结: 1. To facilitate communication between processes, most operating systems support Inter Process C ...

  8. PatentTips - Safe general purpose virtual machine computing system

    BACKGROUND OF THE INVENTION The present invention relates to virtual machine implementations, and in ...

  9. PatentTips - System and method to deprivilege components of a virtual machine monitor

    BACKGROUND INFORMATION An embodiment of the present invention relates generally to virtualization pl ...

随机推荐

  1. End2endIT

    "C:\Program Files\Java\jdk1.8.0_112\bin\java" -ea -Didea.test.cyclic.buffer.size=1048576 & ...

  2. sql语句 update 字段=字段+字符串

    update aa set name=concat('x',name) SELECT OWNER,phone ,COUNT(fc_hc) as c from tb_p GROUP BY fc_hc H ...

  3. M2Crypto安装方法以及配置LDFLAGS、CFLAGS

    python3.7+mac环境: $ brew install openssl && brew install swig $ brew --prefix openssl /usr/lo ...

  4. iOS开发-UITextField手机号和邮箱验证

    不管是网页是手机,用户注册登录的时候绝大数时候都需要手机号码和邮箱地址,而且有些App会限制只能使用手机号注册,iOS方面邮箱正则比较简单,不过手机号码验证找了一下网上的,发现三大运营商的号码段有所变 ...

  5. Android Studio中实现AIDL

    AIDL 先来两个传送门: http://www.cnblogs.com/yydcdut/p/3961545.html Android面试,与Service交互方式 http://www.cnblog ...

  6. Java Web 生成临时文件并下载(原)

    概述:本文是  java 服务器端生成文件并下载的示例,并不完善,下载之后一般来说还需要删除临时文件. 注意:临时文件存放在 /WEB-INF/tmp 目录下,所以先要把  tmp 目录建起来. pu ...

  7. apache 错误:The system cannot find the file specified.

    在启动apache时出现了以下错误信息 Window日志里也记录了此错误信息   而出现此错误的原因是IIS占用了80端口 停止IIS再重新启动apache即可解决   参考: cannot find ...

  8. Eclipse QuickSear的插件的说明

    https://spring.io/blog/2013/07/11/eclipse-quick-search Eclipse QuickSear的插件的说明

  9. VS2013开发asmx接口根据ID查询对象

    代码如下 using System; using System.Collections.Generic; using System.Linq; using System.Web; using Syst ...

  10. Git创建分支/GIT提交分支

    git clone xxx.git cd fwspp-react git init touch README.md git add README.md git commit -m "add ...