JVM HOT交换 [英] JVM HOT Swapping

查看:75
本文介绍了JVM HOT交换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是JVM热插拔?

许多定义都说这个功能允许在调试过程中动态更新代码。

Many definitions say that this feature allows code to updated on the fly during de-bugging.

热插拔等一些限制仅限于更新方法体,并且尝试向类添加方法和字段不会成功。

And a few restrictions such as hot swapping is limited to updating method bodies only, and trying to add methods and fields to classes would not succeed.

任何人都可以用代码来解释这个。

Can anyone explain this with code.

推荐答案

这意味着你可以在中间对代码进行某些更改调试会话,并使这些更改立即生效,而无需重新启动应用程序。

All it means is that you can make certain changes to your code while in the middle of a debugging session, and have those changes take effect immediately, without having to restart the application.

在某些情况下,这可能是一个非常方便的功能。但是,您通常会限制哪些类型的代码更改可以热插入正在运行的应用程序中。限制的确切性质取决于您的工具链。

This can be a very handy feature in some circumstances. However, you're typically restricted in what kinds of code changes can be hotswapped into a running application. The exact nature of the restrictions depends on your toolchain.

这篇关于JVM HOT交换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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