CINXE.COM
什么是 JVM?JVM 为什么是开发者必须了解的核心技术?-腾讯云开发者社区-腾讯云
<!DOCTYPE html><html lang="zh" munual-autotracker-init="" qct-uid="" qct-pv-id="4HXP9UHawNQ-lTFG21X4q" qct-ip="8.222.208.146"><head><meta charSet="UTF-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><meta name="format-detection" content="telephone=no"/><title>什么是 JVM?JVM 为什么是开发者必须了解的核心技术?-腾讯云开发者社区-腾讯云</title><meta name="subject" content="其他-空类-开发者,其他-空类-内存,通用技术-服务器技术-jvm,其他-空类-编译,其他-空类-程序"/><meta name="subjectTime" content="2024-11-26 08:48:05"/><meta name="articleSource" content="W"/><meta name="magicSource" content="N"/><meta name="authorType" content="Z,O"/><meta name="productSlug" content="cos"/><meta name="keywords" content="开发者,内存,jvm,编译,程序"/><meta name="description" content="Java 虚拟机(Java Virtual Machine,JVM)是 Java 技术体系的核心组成部分,它使得 Java 程序能够实现“一次编译,到处运行”的跨平台特性。"/><meta property="og:title" content="什么是 JVM?JVM 为什么是开发者必须了解的核心技术?-腾讯云开发者社区-腾讯云"/><meta property="og:description" content="Java 虚拟机(Java Virtual Machine,JVM)是 Java 技术体系的核心组成部分,它使得 Java 程序能够实现“一次编译,到处运行”的跨平台特性。"/><meta property="og:image" content="https://cloudcache.tencentcs.com/open_proj/proj_qcloud_v2/gateway/shareicons/cloud.png"/><meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1, viewport-fit=cover"/><link rel="dns-prefetch" href="//qccommunity.qcloudimg.com"/><link rel="dns-prefetch" href="//ask.qcloudimg.com"/><link rel="dns-prefetch" href="//cloudcache.tencentcs.com"/><link rel="canonical" href="https://cloud.tencent.com/developer/article/2471010"/><meta name="next-head-count" content="20"/><link rel="stylesheet" href="https://imgcache.qq.com/open_proj/proj_qcloud_v2/gateway/portal/css/base.css"/><link rel="stylesheet" href="https://cloudcache.tencentcs.cn/qcloud/ui/cloud-community/build/base/base-202411191502.css"/><style type="text/css"> .rno-markdown p * { white-space: pre-wrap; word-break: break-all; } .tea-overlay { z-index: 99999!important; } </style><link rel="stylesheet" href="https://cloudcache.tencentcs.cn/qcloud/ui/cloud-community/build/Article/Article-202411221814.css"/><link rel="stylesheet" href="https://cloudcache.tencent-cloud.cn/qcloud/draft-master/dist/draft-master-v2.0.161.d4s2ddo9sb.css"/><link rel="stylesheet" href="https://qccommunity-1258344699.cos.ap-guangzhou.myqcloud.com/tc_player/releasev5.1.0/tcplayer.min.css"/><script src="https://tam.cdn-go.cn/aegis-sdk/latest/aegis.min.js"></script><script> if (Aegis) { new Aegis({ id: 'dWlmyFvjDnalkbZO8q', env: 'production', onError: true, pagePerformance: true, reportAssetSpeed: true, api: { reportRequest: true, resHeaders: ['x-req-id'], }, reportApiSpeed: true, beforeRequest: function (data) { // load js failed if (data.logType === 'log') { if (data.logs.level === '32' && data.logs.msg.indexOf('google') > -1) return false; } var ignoreKeys = [ 'Script error', 'chrome-extension', 'qq.com', 'queryWeappQrcodeStatus', 'login/ajax/info', 'woa.com', 'trafficCollect.php', 'google', 'dscache', 'act-api', 'set_qc_cookie', 'opc.cloud.tencent.com', 'uc_gre_ad_buss', 'eb.xcj.pub', 'UCShellJava', '/developer/labs/quick/loader', 'edgeImmersiveReaderDOM', 'sendBeacon', 'error-decoder.html', 'qcloud-community-track.min.js' ]; var alarmMsg = [data.logs.url, data.logs.msg].join('|'); for (var i = 0; i < ignoreKeys.length; i++) { if (alarmMsg.indexOf(ignoreKeys[i]) != -1) return false; } if (/bot|wechatdevtools|spider/i.test(navigator.userAgent)) { return false; } if (location.hostname.indexOf('cloud.tencent.') === -1) { return false; } }, }); } </script><link rel="preload" href="https://qccommunity.qcloudimg.com/community/_next/static/css/15864e0bbdb1e0dc.css" as="style"/><link rel="stylesheet" href="https://qccommunity.qcloudimg.com/community/_next/static/css/15864e0bbdb1e0dc.css" data-n-g=""/><link rel="preload" href="https://qccommunity.qcloudimg.com/community/_next/static/css/76e9fe126c1f99d5.css" as="style"/><link rel="stylesheet" href="https://qccommunity.qcloudimg.com/community/_next/static/css/76e9fe126c1f99d5.css" data-n-p=""/><link rel="preload" href="https://qccommunity.qcloudimg.com/community/_next/static/css/02f6d1504ece9578.css" as="style"/><link rel="stylesheet" href="https://qccommunity.qcloudimg.com/community/_next/static/css/02f6d1504ece9578.css" data-n-p=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="https://qccommunity.qcloudimg.com/community/_next/static/chunks/polyfills-c67a75d1b6f99dc8.js"></script><script src="https://qccommunity.qcloudimg.com/community/_next/static/chunks/webpack-ae9e1b1faf57d1c1.js" defer=""></script><script src="https://qccommunity.qcloudimg.com/community/_next/static/chunks/framework-bae252e255276064.js" defer=""></script><script src="https://qccommunity.qcloudimg.com/community/_next/static/chunks/main-05fe3e9ebcc3b2a5.js" defer=""></script><script src="https://qccommunity.qcloudimg.com/community/_next/static/chunks/pages/_app-11e3892fe3b1999e.js" defer=""></script><script src="https://qccommunity.qcloudimg.com/community/_next/static/chunks/1001-2e1adf6d088ee502.js" defer=""></script><script src="https://qccommunity.qcloudimg.com/community/_next/static/chunks/900-71009a4f9d961db7.js" defer=""></script><script src="https://qccommunity.qcloudimg.com/community/_next/static/chunks/743-1dcf6b0fcebaa4b8.js" defer=""></script><script src="https://qccommunity.qcloudimg.com/community/_next/static/chunks/2191-2e402fdba497a1f2.js" defer=""></script><script src="https://qccommunity.qcloudimg.com/community/_next/static/chunks/4031-e3e3905dc88f3f92.js" defer=""></script><script src="https://qccommunity.qcloudimg.com/community/_next/static/chunks/9966-3be3b289121a48f8.js" defer=""></script><script src="https://qccommunity.qcloudimg.com/community/_next/static/chunks/552-eb32205d1d3e17d7.js" defer=""></script><script src="https://qccommunity.qcloudimg.com/community/_next/static/chunks/2391-e1b083c8280dce67.js" defer=""></script><script src="https://qccommunity.qcloudimg.com/community/_next/static/chunks/4117-79ab33e3944a99db.js" defer=""></script><script src="https://qccommunity.qcloudimg.com/community/_next/static/chunks/113-3bf2d483b3691b04.js" defer=""></script><script src="https://qccommunity.qcloudimg.com/community/_next/static/chunks/5305-6c6287588b89e496.js" defer=""></script><script src="https://qccommunity.qcloudimg.com/community/_next/static/chunks/9987-50fa00be52ea0a59.js" defer=""></script><script src="https://qccommunity.qcloudimg.com/community/_next/static/chunks/6995-71865d1b014e8b9a.js" defer=""></script><script src="https://qccommunity.qcloudimg.com/community/_next/static/chunks/9179-2e29732c010e5e5b.js" defer=""></script><script src="https://qccommunity.qcloudimg.com/community/_next/static/chunks/5039-d174dd09ec91e23e.js" defer=""></script><script src="https://qccommunity.qcloudimg.com/community/_next/static/chunks/7205-b99bdebd8fec36ca.js" defer=""></script><script src="https://qccommunity.qcloudimg.com/community/_next/static/chunks/787-c20307b99a7c9e79.js" defer=""></script><script src="https://qccommunity.qcloudimg.com/community/_next/static/chunks/6474-2c0e1629f7738528.js" defer=""></script><script src="https://qccommunity.qcloudimg.com/community/_next/static/chunks/5650-649e162b184be571.js" defer=""></script><script src="https://qccommunity.qcloudimg.com/community/_next/static/chunks/9626-02550f5f9bc8270d.js" defer=""></script><script src="https://qccommunity.qcloudimg.com/community/_next/static/chunks/3346-4ae0fd6a10f06673.js" defer=""></script><script src="https://qccommunity.qcloudimg.com/community/_next/static/chunks/1794-98cf5488519ada56.js" defer=""></script><script src="https://qccommunity.qcloudimg.com/community/_next/static/chunks/3270-57ce21952a43da02.js" defer=""></script><script src="https://qccommunity.qcloudimg.com/community/_next/static/chunks/8876-96e7c886daac8884.js" defer=""></script><script src="https://qccommunity.qcloudimg.com/community/_next/static/chunks/pages/article/%5BarticleId%5D-a157d6c1cbac751b.js" defer=""></script><script src="https://qccommunity.qcloudimg.com/community/_next/static/E1BjsJMhAQmac8QBO6qJ5/_buildManifest.js" defer=""></script><script src="https://qccommunity.qcloudimg.com/community/_next/static/E1BjsJMhAQmac8QBO6qJ5/_ssgManifest.js" defer=""></script></head><body class=""><div id="__next"><script src="https://dscache.tencent-cloud.cn/ecache/qcstat/qcloud/qcloudStatApi.js"></script><script src="https://qccommunity.qcloudimg.com/common/exposure-plugin-4.1.15.min.js"></script><script src="https://qccommunity.qcloudimg.com/community-track/qcloud-community-track.min.js"></script><div class="cdc-responsive-layout" aegis-first-screen-timing="true" qct-area="文章详情页"><div class="cdc-article-page cdc-global"><div class="cdc-sticky-header mod-sticky-header is-hidden" style="left:0"><div id="community-top-sticky-header-product-container"></div><div class="cdc-sticky-header__inner"><div class="cdc-sticky-header__main"><div class="mod-sticky-header__main"><div class="mod-sticky-header__author"><span class="cdc-avatar circle"><a class="cdc-avatar__inner" style="background-image:url(https://developer.qcloudimg.com/http-save/10011/1b9c3652fd10c71666f670e276e212aa.jpg)" href="/developer/user/2253892" target="_blank"></a></span><div class="author-info"><a class="author-info__name" href="/developer/user/2253892" target="_blank"><span class="name-text">码哥字节</span></a></div></div><div class="mod-sticky-header__split"></div><div class="mod-sticky-header__title"><div class="mod-sticky-header__title-content"><h2 class="title-text">什么是 JVM?JVM 为什么是开发者必须了解的核心技术?</h2></div></div></div></div><div class="cdc-sticky-header__extra"><div class="mod-sticky-header__operates"><button class="cdc-btn mod-sticky-header__operate btn-focus cdc-btn--primary"><i class="add-icon"></i><span>关注作者</span></button></div></div></div></div><div class="cdc-m-guider-banner"><div class="cdc-m-guider-banner__guide-mvp is-detail-page"><div class="cdc-m-guider-banner__guide-mvp-text">前往小程序,Get<em>更优</em>阅读体验!</div><div class="cdc-m-guider-banner__guide-mvp-btn">立即前往</div></div></div><div class="cdc-header cdc-header--block" track="导航"><div class="cdc-header__placeholder"></div><div class="cdc-header__inner"><div id="community-top-header-product-container"></div><div class="cdc-header__top"><div class="cdc-header__top-left"><a href="/?from=20060&from_column=20060" target="_blank" class="cdc-header__top-logo" hotrep="" track="腾讯云官网入口"><i>腾讯云</i></a><div class="cdc-header__top-line"></div><a href="/developer" class="cdc-header__top-logo community"><i>开发者社区</i></a><div class="cdc-header__activity"><div id="cloud-header-product-container"></div></div></div><div class="cdc-header__top-operates"><a href="/document/product?from=20702&from_column=20702" target="_blank" class="cdc-header__link">文档</a><a href="/voc/?from=20703&from_column=20703" target="_blank" class="cdc-header__link">建议反馈</a><a href="https://console.cloud.tencent.com?from=20063&from_column=20063" target="_blank" class="cdc-header__link" track-click="{"areaId":102001,"subAreaId":1}">控制台</a><div class="cdc-header__account"><div class="cdc-header__account-inner"><button class="cdc-btn cdc-header__account-btn cdc-btn--primary">登录/注册</button></div></div></div></div><div class="cdc-header__bottom"><div class="cdc-header__bottom-nav"><a href="/developer" class="cdc-header__bottom-home">首页</a><div class="cdc-header__nav-list"><div class="cdc-header__nav-item">学习</div><div class="cdc-header__nav-item">活动</div><div class="cdc-header__nav-item">专区</div><div class="cdc-header__nav-item">工具</div></div><a href="/tvp?from=20154&from_column=20154" class="cdc-header__tvp" target="_blank">TVP</a><div class="cdc-header__activity"><a class="cdc-header__activity-tit" href="/act?from=20061&from_column=20061" target="_blank">最新优惠活动<div class="cdc-badge"><div class="cdc-badge-inner"><div class="cdc-badge-text"></div></div></div></a></div><div id="community-header-product-container"></div></div><div class="cdc-header__bottom-operates"><div class="cdc-header__search"><div class="cdc-search__wrap"><div class="cdc-search"><span class="cdc-search__text">文章/答案/技术大牛</span><button class="cdc-search__btn">搜索<i class="cdc-search__i search"></i></button></div><div class="cdc-search__dropdown"><div class="cdc-search__bar"><input type="text" class="cdc-search__bar-input" placeholder="文章/答案/技术大牛" value=""/><div class="cdc-search__bar-btns"><button class="cdc-search__btn">搜索<i class="cdc-search__i search"></i></button><button class="cdc-search__btn">关闭<i class="cdc-search__i clear"></i></button></div></div></div></div></div><div class="cdc-header__create"><span class="cdc-header__create-btn not-logged"><span class="cdc-svg-icon-con"><span class="cdc-svg-icon" style="width:16px;height:16px"><svg width="16" height="16" viewBox="0 0 16 16" fill="currentcolor" xmlns="http://www.w3.org/2000/svg"><path d="M14.2466 12.0145C14.1698 13.6258 12.8381 14.9131 11.2129 14.9131H11.1579H4.0927H4.03772C2.4125 14.9131 1.08014 13.6258 1.00334 12.0145H1V11.8668V4.07213V4.04627V3.89922H1.00334C1.08014 2.28732 2.4125 1 4.03772 1H9.6473V1.00069H10.0786L8.7688 2.10773H8.43888H7.7916H6.37904H4.03772C2.97234 2.10773 2.10445 2.9777 2.10445 4.04629V4.41869V4.4472V6.39498V11.4269V11.4309V11.8668C2.10445 12.9354 2.97234 13.8053 4.03772 13.8053H6.37904H8.87153H11.2129C12.2782 13.8053 13.1461 12.9355 13.1461 11.8668V11.466V11.454V9.5181V6.39364L14.2506 5.3051V11.8668V12.0145H14.2466ZM10.4324 7.15226L9.63146 7.99761C9.36577 8.2693 8.69326 8.95104 8.48066 9.17631C8.26726 9.40288 8.09039 9.58901 7.95061 9.73544C7.81079 9.88188 7.72667 9.96597 7.70083 9.98656C7.63321 10.0488 7.55703 10.1144 7.47022 10.1846C7.38412 10.2542 7.29404 10.3099 7.20063 10.3516C7.10722 10.4007 6.97072 10.459 6.79049 10.5305C6.61028 10.6001 6.42213 10.6676 6.22468 10.7339C6.02792 10.8002 5.84109 10.8571 5.66484 10.9061C5.48795 10.9538 5.3561 10.9863 5.2693 11.0009C5.08977 11.0214 4.96988 10.993 4.90956 10.9168C4.84931 10.8405 4.83276 10.7107 4.85924 10.5312C4.87315 10.4331 4.9043 10.292 4.95468 10.1078C5.00431 9.92297 5.05802 9.7315 5.11431 9.53341C5.1713 9.33526 5.22629 9.15179 5.27926 8.98484C5.33297 8.8179 5.37599 8.7026 5.40978 8.64032C5.44953 8.54357 5.49463 8.45413 5.54495 8.37399C5.59465 8.29379 5.66616 8.20503 5.75965 8.10766C5.79934 8.06588 5.89281 7.96649 6.03988 7.81018C6.18624 7.65311 6.80114 7.02774 7.02104 6.79783L7.75117 6.03524L8.56212 5.1899L10.6345 3.02466L12.5214 4.93874L10.4324 7.15226ZM13.816 3.58581C13.7166 3.68987 13.6272 3.78064 13.5483 3.85883C13.4694 3.93703 13.4006 4.0066 13.3423 4.06686C13.276 4.13643 13.2144 4.19738 13.1561 4.24903L11.2785 2.33569C11.3785 2.24025 11.4965 2.12565 11.6336 1.99115C11.7707 1.85668 11.8854 1.75061 11.9761 1.67242C12.0934 1.57708 12.2133 1.51013 12.3385 1.47109C12.4525 1.43529 12.5644 1.41805 12.6751 1.41876H12.7056C12.7665 1.42139 12.8268 1.42729 12.8851 1.43724C12.8838 1.4366 12.8811 1.43724 12.8798 1.4366C12.8811 1.4366 12.8838 1.4366 12.8851 1.43724C13.1376 1.48428 13.4019 1.62009 13.6265 1.83743C13.7511 1.95871 13.8524 2.09382 13.9259 2.23296C14.0346 2.43834 14.0863 2.65304 14.0763 2.8491C14.0763 2.87294 14.0783 2.89748 14.0783 2.92201C14.0783 3.03529 14.0571 3.14789 14.0154 3.26055C13.9737 3.37314 13.9067 3.48185 13.816 3.58581Z" fill="#0052D9"></path></svg></span></span>发布<span class="cdc-svg-icon-con cdc-header__create-btn-arrow"><span class="cdc-svg-icon" style="width:16px;height:16px"><svg width="16" height="16" viewBox="0 0 16 16" fill="currentcolor" xmlns="http://www.w3.org/2000/svg"><path d="M8.16377 4L9.57798 5.41421L14.5277 10.364L13.1135 11.7782L8.1638 6.829L3.21402 11.7782L1.7998 10.364L8.16377 4Z"></path></svg></span></span></span></div></div></div></div></div><div class="cdc-m-sticky-header is-hidden is-sticky"><div class="cdc-m-sticky-header__placeholder"></div><div class="cdc-m-sticky-header__main"><div class="cdc-m-sticky-header__con"><div class="cdc-m-sticky-header__trigger"></div><div class="cdc-m-header-article__menu"><div class="cdc-m-header-article__menu-mask"></div><div class="cdc-m-header-article__menu-side"><div class="cdc-m-header__sidebar"><div class="cdc-m-header__sidebar-top"><i class="cdc-m-header__sidebar-top__logo"></i><span class="cdc-m-header__sidebar-top__back"></span></div><div class="cdc-m-header__sidebar-menus"><a href="/developer" class="cdc-m-header__sidebar-menu link">首页</a><div class="tpm1-collapse"><div class="tpm1-collapse__panel"><header class="tpm1-collapse__panel-hd"><div class="tpm1-collapse__panel-title">学习</div></header></div><div class="tpm1-collapse__panel"><header class="tpm1-collapse__panel-hd"><div class="tpm1-collapse__panel-title">活动</div></header></div><div class="tpm1-collapse__panel"><header class="tpm1-collapse__panel-hd"><div class="tpm1-collapse__panel-title">专区</div></header></div><div class="tpm1-collapse__panel"><header class="tpm1-collapse__panel-hd"><div class="tpm1-collapse__panel-title">工具</div></header></div></div><a href="/tvp?from=20154&from_column=20154" class="cdc-m-header__sidebar-menu link">TVP</a><a class="cdc-m-header__sidebar-activity" href="/act?from=20061&from_column=20061" target="_blank">最新优惠活动<div class="cdc-badge"><div class="cdc-badge-inner"><div class="cdc-badge-text"></div></div></div></a></div><div class="cdc-m-header__sidebar-back"><a href="/?from=20060&from_column=20060" class="cdc-m-header__sidebar-back__link"><i></i><span>返回腾讯云官网</span></a></div></div></div></div><div class="cdc-m-sticky-header__author"><span class="cdc-avatar large circle" style="cursor:unset"><span class="cdc-avatar__inner" style="background-image:url(https://developer.qcloudimg.com/http-save/10011/1b9c3652fd10c71666f670e276e212aa.jpg)"></span></span><div class="cdc-m-sticky-header__author-name">码哥字节</div></div></div><div class="cdc-m-sticky-header__extra"><div class="cdc-m-sticky-header__extra-icon"><i class="extra-search"></i></div><div class="cdc-m-sticky-header__extra-icon"><i class="extra-share"></i></div><div class="cdc-m-sticky-header__extra-operate"><div class="cdc-m-sticky-header__extra-icon"><i class="extra-man"></i></div></div></div></div></div><div class="cdc-m-header-article"><div class="cdc-m-header-article__placeholder"></div><div class="cdc-m-header-article__content"><div class="cdc-m-header-article__main"><div class="cdc-m-header-article__con"><div class="cdc-m-header-article__trigger"></div><div class="cdc-m-header-article__menu"><div class="cdc-m-header-article__menu-mask"></div><div class="cdc-m-header-article__menu-side"><div class="cdc-m-header__sidebar"><div class="cdc-m-header__sidebar-top"><i class="cdc-m-header__sidebar-top__logo"></i><span class="cdc-m-header__sidebar-top__back"></span></div><div class="cdc-m-header__sidebar-menus"><a href="/developer" class="cdc-m-header__sidebar-menu link">首页</a><div class="tpm1-collapse"><div class="tpm1-collapse__panel"><header class="tpm1-collapse__panel-hd"><div class="tpm1-collapse__panel-title">学习</div></header></div><div class="tpm1-collapse__panel"><header class="tpm1-collapse__panel-hd"><div class="tpm1-collapse__panel-title">活动</div></header></div><div class="tpm1-collapse__panel"><header class="tpm1-collapse__panel-hd"><div class="tpm1-collapse__panel-title">专区</div></header></div><div class="tpm1-collapse__panel"><header class="tpm1-collapse__panel-hd"><div class="tpm1-collapse__panel-title">工具</div></header></div></div><a href="/tvp?from=20154&from_column=20154" class="cdc-m-header__sidebar-menu link">TVP</a><a class="cdc-m-header__sidebar-activity" href="/act?from=20061&from_column=20061" target="_blank">最新优惠活动<div class="cdc-badge"><div class="cdc-badge-inner"><div class="cdc-badge-text"></div></div></div></a></div><div class="cdc-m-header__sidebar-back"><a href="/?from=20060&from_column=20060" class="cdc-m-header__sidebar-back__link"><i></i><span>返回腾讯云官网</span></a></div></div></div></div></div><div class="cdc-m-header-article__title"><div class="cdc-m-header-article__title-logo"></div></div><div class="cdc-m-header-article__extra"><div class="cdc-m-header-article__extra-icon"><i class="extra-search"></i></div><div class="cdc-m-header-article__extra-operate"><div class="cdc-m-header-article__extra-icon"><i class="extra-man"></i></div></div></div></div></div></div><div class="cdc-global__main"><div class="cdc-article__body"><div class="cdc-layout"><div class="cdc-layout__main"><div class="cdc-crumb mod-crumb"><div class="cdc-crumb__inner"><a class="cdc-crumb__item" href="/developer">社区首页</a><span class="cdc-crumb__split"> ></span><a class="cdc-crumb__item" href="/developer/column">专栏</a><span class="cdc-crumb__split"> ></span><span class="cdc-crumb__item current">什么是 JVM?JVM 为什么是开发者必须了解的核心技术?</span></div></div><div class="mod-article-content"><div class="mod-header"><div class="mod-header__top"><div class="mod-header__title"><h1 class="title-text">什么是 JVM?JVM 为什么是开发者必须了解的核心技术?</h1></div></div><div class="mod-article-source header"><div class="mod-article-source__main"><div class="mod-article-source__avatar"><img src="https://developer.qcloudimg.com/http-save/10011/1b9c3652fd10c71666f670e276e212aa.jpg" alt="作者头像"/></div><div class="mod-article-source__detail"><div class="mod-article-source__name"><span>码哥字节</span></div></div><button class="cdc-btn mod-article-source__operate cdc-btn--primary"><span><i></i>关注</span></button></div></div><div class="mod-header__bottom"><div class="mod-header__detail"><div class="mod-header__date"><span class="date-text">发布<!-- -->于 <!-- -->2024-11-26 08:48:05</span></div><div class="mod-header__date is-mobile"><span class="date-text">发布<!-- -->于 <!-- -->2024-11-26 08:48:05</span></div><div class="mod-header__infos"><div class="cdc-icon__list"><span class="cdc-svg-icon-con"><span class="cdc-svg-icon" style="width:16px;height:16px"><svg width="16" height="16" viewBox="0 0 16 16" fill="currentcolor" xmlns="http://www.w3.org/2000/svg"><g id="icon-view" transform="translate(0.000000, 3.000000)" fill="currentcolor" fill-rule="nonzero"><path d="M15.885,4.68036 C14.9951,3.57569 11.7987,-0.004272 7.99883,-0.004272 C4.19895,-0.004272 1.02302,3.57569 0.112682,4.68036 C0.040058,4.77107 0.000488281,4.88381 0.000488281,5 C0.000488281,5.1162 0.040058,5.22894 0.112682,5.31964 C1.00767,6.42432 4.20407,10.0043 7.99883,10.0043 C11.7936,10.0043 14.9951,6.42432 15.885,5.31964 C15.9576,5.22894 15.9972,5.1162 15.9972,5 C15.9972,4.88381 15.9576,4.77107 15.885,4.68036 Z M7.99883,8.97632 C4.93029,8.97632 2.25555,6.25043 1.17644,4.99745 C2.25555,3.74446 4.95586,1.01857 7.99883,1.01857 C11.0418,1.01857 13.7421,3.74446 14.8314,4.99745 C13.7421,6.25043 11.0418,8.97632 7.99883,8.97632 Z" id="形状"></path><path d="M7.97304,2.55286 C7.49865,2.55286 7.03491,2.69353 6.64046,2.95709 C6.24602,3.22065 5.93859,3.59525 5.75704,4.03354 C5.5755,4.47182 5.528,4.95409 5.62055,5.41937 C5.7131,5.88465 5.94154,6.31203 6.27699,6.64748 C6.61244,6.98293 7.03982,7.21137 7.5051,7.30392 C7.97038,7.39647 8.45265,7.34897 8.89093,7.16743 C9.32922,6.98588 9.70382,6.67845 9.96738,6.28401 C10.2309,5.88956 10.3716,5.42582 10.3716,4.95143 C10.3716,4.31529 10.1189,3.7052 9.66909,3.25538 C9.21927,2.80556 8.60918,2.55286 7.97304,2.55286 Z M7.97304,6.32716 C7.70095,6.32716 7.43496,6.24647 7.20872,6.09531 C6.98249,5.94414 6.80616,5.72928 6.70203,5.4779 C6.59791,5.22652 6.57066,4.94991 6.62374,4.68304 C6.67683,4.41617 6.80785,4.17104 7.00025,3.97864 C7.19265,3.78625 7.43778,3.65522 7.70465,3.60214 C7.97151,3.54905 8.24813,3.5763 8.49951,3.68042 C8.75089,3.78455 8.96575,3.96088 9.11692,4.18712 C9.26808,4.41335 9.34877,4.67934 9.34877,4.95143 C9.35012,5.13295 9.31553,5.31295 9.247,5.48104 C9.17846,5.64913 9.07734,5.802 8.94946,5.93084 C8.82158,6.05967 8.66946,6.16192 8.50188,6.2317 C8.3343,6.30147 8.15457,6.33739 7.97304,6.33739 L7.97304,6.32716 Z" id="形状"></path></g></svg></span><span class="cdc-svg-icon-text">122</span></span><span class="cdc-svg-icon-con is-comment"><span class="cdc-svg-icon" style="width:16px;height:16px"><svg width="16" height="16" viewBox="0 0 16 16" fill="currentcolor" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M8 13.414L5.58594 11H2V3H14V11H10.4141L8 13.414ZM5.17175 12L8 14.8282L10.8282 12H15V2H1V12H5.17175ZM4 6C3.44775 6 3 6.44769 3 7C3 7.55231 3.44775 8 4 8C4.55225 8 5 7.55231 5 7C5 6.44769 4.55225 6 4 6ZM7 7C7 6.44769 7.44775 6 8 6C8.55225 6 9 6.44769 9 7C9 7.55231 8.55225 8 8 8C7.44775 8 7 7.55231 7 7ZM12 6C11.4478 6 11 6.44769 11 7C11 7.55231 11.4478 8 12 8C12.5522 8 13 7.55231 13 7C13 6.44769 12.5522 6 12 6Z"></path></svg></span><span class="cdc-svg-icon-text">0</span></span></div></div></div><div class="mod-header__operates"><div class="mod-header__operate"><span class="cdc-svg-icon-con is-operate"><span class="cdc-svg-icon" style="width:16px;height:16px"><svg width="16" height="16" viewBox="0 0 16 16" fill="currentcolor" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M9.21101 2.54545C8.80733 1.81818 7.79814 1.81818 7.39446 2.54545L1.94481 12.3636C1.54113 13.0909 2.04573 14 2.85308 14H13.7524C14.5597 14 15.0643 13.0909 14.6607 12.3636L9.21101 2.54545ZM2.85308 12.9091L8.30273 3.09091L13.7524 12.9091H2.85308ZM8.00037 6H9.00037V10H8.00037V6ZM8.00037 11H9.00037V12H8.00037V11Z" fill="currentcolor"></path></svg></span><span class="cdc-svg-icon-text">举报</span></span></div></div></div><div class="mod-header__special"><div class="cdc-special-guide"><span><i class="cdc-special-guide-icon"></i>文章被收录于专栏:</span><a class="cdc-special-guide-name">Java 技术栈</a></div></div></div><div class="mod-content"><div class="mod-content__markdown"><div><div class="rno-markdown new-version rno-"><p>大家好,我是码哥。</p><p>Java 虚拟机(Java Virtual Machine,JVM)是 Java 技术体系的核心组成部分,它使得 Java 程序能够实现“一次编译,到处运行”的跨平台特性。</p><p>JVM 不仅运行 Java 程序,还承担了内存管理、垃圾回收、即时编译(JIT)等关键任务,是现代 Java 开发不可或缺的基础设施。</p><p>在本章中,我们将全面解析 JVM 的作用、设计目标、在 Java 技术体系中的地位,以及它的演变历史和主流实现,为后续深入理解 JVM 的内部工作机制打下坚实基础。</p><h3 id="7g0li" name="JVM-%E7%9A%84%E4%BD%9C%E7%94%A8%EF%BC%9A%E5%B0%B1%E5%83%8F%E4%B8%80%E4%B8%AA%E2%80%9C%E5%85%A8%E8%83%BD%E7%AE%A1%E5%AE%B6%E2%80%9D"><strong>JVM 的作用:就像一个“全能管家”</strong></h3><p>JVM 是一个运行时环境,主要负责加载字节码(.class 文件)、执行程序指令、管理内存等。其核心作用如下:</p><ol class="ol-level-0"><li><strong>跨平台支持</strong><ul class="ul-level-1"><li>Java 程序通过 <code>javac</code> 编译为平台无关的字节码,由 JVM 在目标平台上解释或编译为本地机器码运行。</li><li>实现了“一次编译,到处运行”的特性。</li></ul></li><li><strong>内存管理</strong><ul class="ul-level-1"><li>JVM 负责分配和回收 Java 程序使用的内存,开发者无需手动管理堆栈,避免了许多常见的内存泄漏问题。</li></ul></li><li><strong>安全性保障</strong><ul class="ul-level-1"><li>JVM 通过类加载器和字节码验证器确保程序运行的安全性,防止恶意代码执行。</li></ul></li><li><strong>性能优化</strong><ul class="ul-level-1"><li>JVM 内置即时编译器(JIT),在运行时将热点代码编译为高效的本地机器码。</li></ul></li></ol><p>它不仅为程序提供“房间”(内存分配),还负责打扫卫生(垃圾回收)、监督安全(类加载器)、优化生活效率(JIT 编译器)。</p><h3 id="8c9ie" name="JVM-%E7%9A%84%E6%A0%B8%E5%BF%83%E5%8A%9F%E8%83%BD"><strong>JVM 的核心功能</strong></h3><p>JVM 的功能可以分为以下几个核心模块:</p><figure class=""><div class="rno-markdown-img-url" style="text-align:center"><div class="rno-markdown-img-url-inner" style="width:100%"><div style="width:100%"><img src="https://developer.qcloudimg.com/http-save/yehe-2253892/60bd136b9f023ae108496beffb65badc.png" alt="" style="width:100%"/></div></div></div></figure><p><strong>类加载</strong></p><ul class="ul-level-0"><li>负责加载和验证 <code>.class</code> 文件。</li><li>支持自定义类加载器,灵活扩展应用的加载逻辑。</li></ul><p><strong>字节码执行</strong></p><ul class="ul-level-0"><li>JVM 可通过解释器逐行解释执行字节码。</li><li>配合 JIT 编译器,将热点代码动态编译为本地机器码,提高执行效率。</li></ul><p><strong>内存管理</strong></p><ul class="ul-level-0"><li>包括堆内存(Heap)和栈内存(Stack)管理,自动分配对象存储位置。</li></ul><p><strong>垃圾回收</strong></p><ul class="ul-level-0"><li>使用垃圾回收机制(GC)自动释放不再使用的内存,减少内存泄漏和碎片化。</li></ul><p><strong>即时编译(JIT)</strong></p><ul class="ul-level-0"><li>在运行时动态优化程序代码,将热点代码编译为高效的机器码执行,显著提升性能。</li></ul><h3 id="fh32p" name="JVM-%E7%9A%84%E8%AE%BE%E8%AE%A1%E7%9B%AE%E6%A0%87"><strong>JVM 的设计目标</strong></h3><p>JVM 的设计目标契合 Java 的技术哲学:</p><ol class="ol-level-0"><li><strong>可移植性</strong>:JVM 是字节码和底层操作系统之间的桥梁,通过屏蔽硬件和平台的差异,确保 Java 程序可以跨平台运行。</li><li><strong>高性能</strong>:JVM 引入即时编译、分代垃圾回收等机制,尽可能接近本地代码的执行效率。</li><li><strong>安全性</strong>:类加载器和字节码验证器提供了多层保护,防止运行恶意代码。</li><li><strong>多语言支持</strong>:现代 JVM(如 GraalVM)已扩展支持多种编程语言,包括 Scala、Kotlin,甚至 Python 等非 Java 语言。</li></ol><p><strong>JVM 就像一台“翻译机</strong></p><p>它能将一种“通用语言”(字节码)翻译成适合任何设备的指令,而翻译过程中还会进行优化和安全检查。</p><h3 id="4j947" name="Java-%E6%8A%80%E6%9C%AF%E4%BD%93%E7%B3%BB%E7%9A%84%E7%BB%84%E6%88%90"><strong>Java 技术体系的组成</strong></h3><p>Java 技术体系由以下三部分组成:</p><figure class=""><div class="rno-markdown-img-url" style="text-align:center"><div class="rno-markdown-img-url-inner" style="width:100%"><div style="width:100%"><img src="https://developer.qcloudimg.com/http-save/yehe-2253892/bb517cc92e6d5c31214cbd5f3f5945f0.png" alt="" style="width:100%"/></div></div></div></figure><ol class="ol-level-0"><li><strong>Java 编程语言</strong>:提供简单易用的语法规则,让开发者快速实现业务逻辑。</li><li><strong>Java 标准类库</strong>:提供丰富的功能模块,包括集合框架、并发工具、I/O 操作等。</li><li><strong>Java 虚拟机(JVM)</strong>:执行 Java 程序的运行时环境,负责字节码执行、内存管理和性能优化。</li></ol><h3 id="cij9o" name="JVM-%E7%9A%84%E5%8F%91%E5%B1%95%E5%8E%86%E7%A8%8B"><strong>JVM 的发展历程</strong></h3><p>JVM 的发展紧密伴随 Java 技术的演变:</p><figure class=""><div class="rno-markdown-img-url" style="text-align:center"><div class="rno-markdown-img-url-inner" style="width:100%"><div style="width:100%"><img src="https://developer.qcloudimg.com/http-save/yehe-2253892/1ca10f2853de6718f81ceca37d475f32.png" alt="" style="width:100%"/></div></div></div></figure><ol class="ol-level-0"><li><strong>1995 年:Sun Classic JVM</strong>,第一代 JVM,采用解释执行,性能较低。</li><li><strong>1999 年:HotSpot JVM</strong>,引入即时编译(JIT)技术,显著提升性能,成为主流实现。</li><li><strong>2000 年:BEA JRockit JVM</strong>,专注于服务器端优化,提供更高的并发支持。</li><li><strong>2006 年:OpenJDK</strong>,Sun 将 JVM 开源,推动 Java 社区的快速发展。</li><li><strong>2018 年:GraalVM</strong>,引入多语言支持和高性能编译器,扩展 JVM 的应用场景。</li></ol><p>目前,主流 JVM 包括:</p><ol class="ol-level-0"><li><strong>HotSpot JVM</strong>,Oracle JDK 的默认 JVM,适用于绝大多数应用场景。</li><li><strong>OpenJ9 JVM</strong>,IBM 开发的轻量级 JVM,专注于内存使用优化和快速启动。</li><li><strong>GraalVM</strong>,支持多语言运行和即时编译的现代 JVM,实现了更强的生态扩展性。</li></ol><h3 id="cei11" name="%E6%9C%80%E5%90%8E"><strong>最后</strong></h3><p>通过本章,我们全面了解了 JVM 的作用、功能、设计目标和发展历程。</p><p>JVM 的出现为 Java 程序提供了跨平台、高性能和安全性的保障,是 Java 技术体系的基石。</p><p>在接下来的章节中,我们将深入解析 JVM 的运行时数据区域、垃圾回收机制、类加载与字节码执行等核心模块,为高性能调优提供理论支持。</p></div></div></div><div class="mod-content__source"><div class="mod-content__source-inner"><div class="mod-content__source-title">本文参与 <a href="/developer/support-plan" target="_blank">腾讯云自媒体同步曝光计划</a>,分享自微信公众号。</div><div class="mod-content__source-desc">原始发表:2024-11-24<!-- -->,如有侵权请联系 <a href="mailto:cloudcommunity@tencent.com">cloudcommunity@tencent.com</a> 删除</div></div><div class="mod-content__source-qr"></div></div><div class="mod-statement-m"><div class="cdc-tag__list mod-content__tags" track-click=""><div class="cdc-tag" track-click="" track-exposure=""><a class="cdc-tag__inner" href="/developer/tag/17341" target="_blank">开发者</a></div><div class="cdc-tag" track-click="" track-exposure=""><a class="cdc-tag__inner" href="/developer/tag/17382" target="_blank">内存</a></div><div class="cdc-tag" track-click="" track-exposure=""><a class="cdc-tag__inner" href="/developer/tag/10688" target="_blank">jvm</a></div><div class="cdc-tag" track-click="" track-exposure=""><a class="cdc-tag__inner" href="/developer/tag/17190" target="_blank">编译</a></div><div class="cdc-tag" track-click="" track-exposure=""><a class="cdc-tag__inner" href="/developer/tag/17215" target="_blank">程序</a></div></div><div class="mod-content__statement"><p>本文分享自 <span>码哥跳动</span> 微信公众号,<span style="color:#0052d9">前往查看</span></p><p>如有侵权,请联系 <a href="mailto:cloudcommunity@tencent.com">cloudcommunity@tencent.com</a> 删除。</p><p class="mod-content__statement-tip">本文参与 <a href="/developer/support-plan" target="_blank">腾讯云自媒体同步曝光计划</a> ,欢迎热爱写作的你一起参与!</p></div></div><div class="cdc-tag__list mod-content__tags" track-click=""><div class="cdc-tag" track-click="" track-exposure=""><a class="cdc-tag__inner" href="/developer/tag/17341" target="_blank">开发者</a></div><div class="cdc-tag" track-click="" track-exposure=""><a class="cdc-tag__inner" href="/developer/tag/17382" target="_blank">内存</a></div><div class="cdc-tag" track-click="" track-exposure=""><a class="cdc-tag__inner" href="/developer/tag/10688" target="_blank">jvm</a></div><div class="cdc-tag" track-click="" track-exposure=""><a class="cdc-tag__inner" href="/developer/tag/17190" target="_blank">编译</a></div><div class="cdc-tag" track-click="" track-exposure=""><a class="cdc-tag__inner" href="/developer/tag/17215" target="_blank">程序</a></div></div></div></div><div class="mod-article-content is-pill-hidden"><div class="mod-comment"><div class="mod-relevant__title">评论</div><div class="cdc-comment-response"><div class="cdc-comment-response-single-edit not-logged"><div class="cdc-comment-response-single-edit__inner"><span class="cdc-avatar cdc-comment-response-single-edit__avatar cdc-comment__avatar circle"><span class="cdc-avatar__inner" style="background-image:url(https://qcloudimg.tencent-cloud.cn/raw/2eca91c9c29816ff056d22815949d83c.png)" target="_blank"></span></span><div class="cdc-comment-response-single-edit__main"><span>登录</span>后参与评论</div></div></div><div class="cdc-comment-response__toolbar"><div class="cdc-comment-response__number">0<!-- --> 条评论</div><div class="cdc-comment-response__segment"><div class="cdc-comment-response__segment-item is-active">热度</div><div class="cdc-comment-response__segment-item">最新</div></div></div><div class="cdc-comment-response-inner"><div class="cdc-comment-response__body"><div><div class="cdc-loading"><div class="cdc-loading__inner"><div class="cdc-loading__item one"></div><div class="cdc-loading__item two"></div><div class="cdc-loading__item three"></div></div></div></div></div></div><div class="cdc-operate-footer"><div class="cdc-operate-footer__inner"><div class="cdc-operate-footer__toggle is-logout"><div class="cdc-operate-footer__toggle-text"><span>登录 </span>后参与评论</div></div></div></div></div></div></div><div class="mod-article-content recommend"><div class="mod-relevant" qct-area="推荐阅读" qct-exposure=""><div class="mod-relevant__title recommend-read">推荐阅读</div><div class="t-divider t-divider--horizontal" style="margin-bottom:0;margin-top:10px"></div></div></div></div><div class="cdc-layout__side"><div class="cdc-personal-info2 mod-author"><div class="cdc-personal-info2__inner"><div class="cdc-personal-info2__detail"><div class="cdc-personal-info2__main"><div class="cdc-personal-info2__name"><a href="/developer/user/2253892" target="_blank" class="cdc-personal-info2__name-text"></a></div><div class="cdc-personal-info2__level"><div class="cdc-personal-info2__level-number">LV.</div><div class="cdc-emblems cdc-personal-info2__level-emblems"></div></div><div class="cdc-personal-info2__position"></div></div><div class="cdc-personal-info2__avatar"></div></div><div class="cdc-personal-info2__list"><a class="cdc-personal-info2__item" href="/developer/user/undefined/articles" target="_blank"><div class="cdc-personal-info2__item-text">文章</div><div class="cdc-personal-info2__item-number">0</div></a><a class="cdc-personal-info2__item" href="/developer/user/undefined" target="_blank"><div class="cdc-personal-info2__item-text">获赞</div><div class="cdc-personal-info2__item-number">0</div></a></div></div></div><div class="mod-sticky-act"><div class="cdc-directory is-just-commercial"><div class="cdc-directory__wrap"><div class="cdc-directory__inner"><div class="cdc-directory__hd">目录</div><div class="cdc-directory__bd"><div class="cdc-directory__bd-box"><ul class="cdc-directory__list level-1"><li class="cdc-directory__item"><span class="cdc-directory__target" id="menu-7g0li">JVM 的作用:就像一个“全能管家”</span></li><li class="cdc-directory__item"><span class="cdc-directory__target" id="menu-8c9ie">JVM 的核心功能</span></li><li class="cdc-directory__item"><span class="cdc-directory__target" id="menu-fh32p">JVM 的设计目标</span></li><li class="cdc-directory__item"><span class="cdc-directory__target" id="menu-4j947">Java 技术体系的组成</span></li><li class="cdc-directory__item"><span class="cdc-directory__target" id="menu-cij9o">JVM 的发展历程</span></li><li class="cdc-directory__item"><span class="cdc-directory__target" id="menu-cei11">最后</span></li></ul></div></div></div></div></div><div class="cdc-mod-product2"><div class="cdc-card" qct-exposure="" qct-area="相关产品与服务"><div class="cdc-card__inner"><div class="cdc-card__hd"><div class="cdc-card__title">相关产品与服务</div></div><div class="cdc-card__bd"><div class="cdc-product-info2__list"><div class="cdc-product-info2"><div class="cdc-product-info2__card-main"><div class="cdc-product-info2__card-name">对象存储</div><div class="cdc-product-info2__card-desc">对象存储(Cloud Object Storage,COS)是由腾讯云推出的无目录层次结构、无数据格式限制,可容纳海量数据且支持 HTTP/HTTPS 协议访问的分布式存储服务。腾讯云 COS 的存储桶空间无容量上限,无需分区管理,适用于 CDN 数据分发、数据万象处理或大数据计算与分析的数据湖等多种场景。</div><div class="cdc-product-info2__card-list"><a target="_blank" href="https://cloud.tencent.com/product/cos?from=21341&from_column=21341"><i class="product-icon introduce-icon"></i>产品介绍</a><a target="_blank" href="https://cloud.tencent.com/document/product/436?from=21342&from_column=21342"><i class="product-icon document-icon"></i>产品文档</a></div></div><div class="cdc-product-info2__activity"><a target="_blank" href="https://cloud.tencent.com/act/pro/cos?from=21344&from_column=21344"><i class="hot-icon"></i>对象存储COS新用户低至1元! </a></div></div></div></div></div></div></div></div></div></div></div></div><div class="cdc-widget-global"><div class="cdc-widget-global__btn announcement"></div><div class="cdc-widget-global__btn code"><div class="cdc-widget-global__btn-tag">领券</div></div><div class="cdc-widget-global__btn top" style="visibility:hidden"></div></div><div class="cdc-footer"><div class="cdc-footer__inner"><div class="cdc-footer__main"><div class="cdc-footer__website"><ul class="cdc-footer__website-group"><li class="cdc-footer__website-column"><div class="cdc-footer__website-box"><h3 class="cdc-footer__website-title">社区</h3><ul class="cdc-footer__website-list"><li class="cdc-footer__website-item"><a href="/developer/column">技术文章</a></li><li class="cdc-footer__website-item"><a href="/developer/ask">技术问答</a></li><li class="cdc-footer__website-item"><a href="/developer/salon">技术沙龙</a></li><li class="cdc-footer__website-item"><a href="/developer/video">技术视频</a></li><li class="cdc-footer__website-item"><a href="/developer/learning">学习中心</a></li><li class="cdc-footer__website-item"><a href="/developer/techpedia">技术百科</a></li><li class="cdc-footer__website-item"><a href="/developer/zone/list">技术专区</a></li></ul></div></li><li class="cdc-footer__website-column"><div class="cdc-footer__website-box"><h3 class="cdc-footer__website-title">活动</h3><ul class="cdc-footer__website-list"><li class="cdc-footer__website-item"><a href="/developer/support-plan">自媒体同步曝光计划</a></li><li class="cdc-footer__website-item"><a href="/developer/support-plan-invitation">邀请作者入驻</a></li><li class="cdc-footer__website-item"><a href="/developer/article/1535830">自荐上首页</a></li><li class="cdc-footer__website-item"><a href="/developer/competition">技术竞赛</a></li></ul></div></li><li class="cdc-footer__website-column"><div class="cdc-footer__website-box"><h3 class="cdc-footer__website-title">资源</h3><ul class="cdc-footer__website-list"><li class="cdc-footer__website-item"><a href="/developer/specials">技术周刊</a></li><li class="cdc-footer__website-item"><a href="/developer/tags">社区标签</a></li><li class="cdc-footer__website-item"><a href="/developer/devdocs">开发者手册</a></li><li class="cdc-footer__website-item"><a href="/lab?from=20064&from_column=20064">开发者实验室</a></li></ul></div></li><li class="cdc-footer__website-column"><div class="cdc-footer__website-box"><h3 class="cdc-footer__website-title">关于</h3><ul class="cdc-footer__website-list"><li class="cdc-footer__website-item"><a rel="nofollow" href="/developer/article/1006434">社区规范</a></li><li class="cdc-footer__website-item"><a rel="nofollow" href="/developer/article/1006435">免责声明</a></li><li class="cdc-footer__website-item"><a rel="nofollow" href="mailto:cloudcommunity@tencent.com">联系我们</a></li><li class="cdc-footer__website-item"><a rel="nofollow" href="/developer/friendlink">友情链接</a></li></ul></div></li></ul></div><div class="cdc-footer__qr"><h3 class="cdc-footer__qr-title">腾讯云开发者</h3><div class="cdc-footer__qr-object"><img src="https://qcloudimg.tencent-cloud.cn/raw/a8907230cd5be483497c7e90b061b861.png?imageView2/2/w/76" class="cdc-footer__qr-image" alt="扫码关注腾讯云开发者"/></div><div class="cdc-footer__qr-infos"><p class="cdc-footer__qr-info"><span class="cdc-footer__qr-text">扫码关注腾讯云开发者</span></p><p class="cdc-footer__qr-info"><span class="cdc-footer__qr-text">领取腾讯云代金券</span></p></div></div></div><div class="cdc-footer__recommend"><div class="cdc-footer__recommend-rows"><div class="cdc-footer__recommend-cell"><h3 class="cdc-footer__recommend-title">热门产品</h3><div class="cdc-footer__recommend-wrap"><ul class="cdc-footer__recommend-list"><li class="cdc-footer__recommend-item"><a class="com-2-footer-recommend-link" href="https://dnspod.cloud.tencent.com?from=20064&from_column=20064">域名注册</a></li><li class="cdc-footer__recommend-item"><a class="com-2-footer-recommend-link" href="/product/cvm?from=20064&from_column=20064">云服务器</a></li><li class="cdc-footer__recommend-item"><a class="com-2-footer-recommend-link" href="/product/tbaas?from=20064&from_column=20064">区块链服务</a></li><li class="cdc-footer__recommend-item"><a class="com-2-footer-recommend-link" href="/product/mq?from=20064&from_column=20064">消息队列</a></li><li class="cdc-footer__recommend-item"><a class="com-2-footer-recommend-link" href="/product/dsa?from=20064&from_column=20064">网络加速</a></li><li class="cdc-footer__recommend-item"><a class="com-2-footer-recommend-link" href="/product/tencentdb-catalog?from=20064&from_column=20064">云数据库</a></li><li class="cdc-footer__recommend-item"><a class="com-2-footer-recommend-link" href="/product/cns?from=20064&from_column=20064">域名解析</a></li><li class="cdc-footer__recommend-item"><a class="com-2-footer-recommend-link" href="/product/cos?from=20064&from_column=20064">云存储</a></li><li class="cdc-footer__recommend-item"><a class="com-2-footer-recommend-link" href="/product/css?from=20064&from_column=20064">视频直播</a></li></ul></div></div><div class="cdc-footer__recommend-cell"><h3 class="cdc-footer__recommend-title">热门推荐</h3><div class="cdc-footer__recommend-wrap"><ul class="cdc-footer__recommend-list"><li class="cdc-footer__recommend-item"><a class="com-2-footer-recommend-link" href="/product/facerecognition?from=20064&from_column=20064">人脸识别</a></li><li class="cdc-footer__recommend-item"><a class="com-2-footer-recommend-link" href="/product/tm?from=20064&from_column=20064">腾讯会议</a></li><li class="cdc-footer__recommend-item"><a class="com-2-footer-recommend-link" href="/act/pro/enterprise2019?from=20064&from_column=20064">企业云</a></li><li class="cdc-footer__recommend-item"><a class="com-2-footer-recommend-link" href="/product/cdn-scd?from=20064&from_column=20064">CDN加速</a></li><li class="cdc-footer__recommend-item"><a class="com-2-footer-recommend-link" href="/product/trtc?from=20064&from_column=20064">视频通话</a></li><li class="cdc-footer__recommend-item"><a class="com-2-footer-recommend-link" href="/product/tiia?from=20064&from_column=20064">图像分析</a></li><li class="cdc-footer__recommend-item"><a class="com-2-footer-recommend-link" href="/product/cdb?from=20064&from_column=20064">MySQL 数据库</a></li><li class="cdc-footer__recommend-item"><a class="com-2-footer-recommend-link" href="/product/symantecssl?from=20064&from_column=20064">SSL 证书</a></li><li class="cdc-footer__recommend-item"><a class="com-2-footer-recommend-link" href="/product/asr?from=20064&from_column=20064">语音识别</a></li></ul></div></div><div class="cdc-footer__recommend-cell"><h3 class="cdc-footer__recommend-title">更多推荐</h3><div class="cdc-footer__recommend-wrap"><ul class="cdc-footer__recommend-list"><li class="cdc-footer__recommend-item"><a class="com-2-footer-recommend-link" href="/solution/data_protection?from=20064&from_column=20064">数据安全</a></li><li class="cdc-footer__recommend-item"><a class="com-2-footer-recommend-link" href="/product/clb?from=20064&from_column=20064">负载均衡</a></li><li class="cdc-footer__recommend-item"><a class="com-2-footer-recommend-link" href="/product/sms?from=20064&from_column=20064">短信</a></li><li class="cdc-footer__recommend-item"><a class="com-2-footer-recommend-link" href="/product/ocr?from=20064&from_column=20064">文字识别</a></li><li class="cdc-footer__recommend-item"><a class="com-2-footer-recommend-link" href="/product/vod?from=20064&from_column=20064">云点播</a></li><li class="cdc-footer__recommend-item"><a class="com-2-footer-recommend-link" href="https://tm.cloud.tencent.com?from=20064&from_column=20064">商标注册</a></li><li class="cdc-footer__recommend-item"><a class="com-2-footer-recommend-link" href="/solution/la?from=20064&from_column=20064">小程序开发</a></li><li class="cdc-footer__recommend-item"><a class="com-2-footer-recommend-link" href="/product/cat?from=20064&from_column=20064">网站监控</a></li><li class="cdc-footer__recommend-item"><a class="com-2-footer-recommend-link" href="/product/cdm?from=20064&from_column=20064">数据迁移</a></li></ul></div></div></div></div><div class="cdc-footer__copyright"><div class="cdc-footer__copyright-text"><p>Copyright © 2013 - <!-- -->2024<!-- --> Tencent Cloud. All Rights Reserved. 腾讯云 版权所有 </p><p>深圳市腾讯计算机系统有限公司 ICP备案/许可证号:<a href="https://beian.miit.gov.cn/#/Integrated/index" target="_blank">粤B2-20090059 </a><a href="https://www.beian.gov.cn/portal/index.do" target="_blank">深公网安备号 44030502008569</a></p><p>腾讯云计算(北京)有限责任公司 京ICP证150476号 | <a href="https://beian.miit.gov.cn/#/Integrated/index" target="_blank">京ICP备11018762号</a> <!-- -->|<!-- --> <a href="https://www.beian.gov.cn/portal/index.do" target="_blank">京公网安备号11010802020287</a></p></div></div></div></div><div style="display:none"><a href="/developer/ask/archives.html">问题归档</a><a href="/developer/column/archives.html">专栏文章</a><a href="/developer/news/archives.html">快讯文章归档</a><a href="/developer/information/all.html">关键词归档</a><a href="/developer/devdocs/archives.html">开发者手册归档</a><a href="/developer/devdocs/sections_p1.html">开发者手册 Section 归档</a></div><div class="cdc-m-footer"><div class="cdc-m-footer__inner"><div class="cdc-m-footer__copyright"><p>Copyright © 2013 - <!-- -->2024<!-- --> Tencent Cloud.</p><p>All Rights Reserved. 腾讯云 版权所有</p></div></div></div><div class="cdc-operate-footer"><div class="cdc-operate-footer__inner"><div class="cdc-operate-footer__toggle is-logout"><div class="cdc-operate-footer__toggle-text"><span>登录 </span>后参与评论</div></div><div class="cdc-operate-footer__operations"><div class="cdc-operate-footer__operate"><i class="cdc-operate-footer__operate-icon comment"></i></div><div class="cdc-operate-footer__operate emoji"><div class="emoji-item"><span class="emoji-item-icon thank"></span></div></div><div class="cdc-operate-footer__operate"><i class="cdc-operate-footer__operate-icon book"></i></div><div class="cdc-operate-footer__operate"><i class="cdc-operate-footer__operate-icon menu"></i></div><div class="cdc-operate-footer__operate"><i class="cdc-operate-footer__operate-icon more"></i></div></div></div></div><div class="cdc-suspend-pill"><div class="cdc-suspend-pill__inner"><button class="cdc-icon-btn cdc-suspend-pill__item emoji cdc-icon-btn--text"><div class="emoji-item"><span class="emoji-item-icon update"></span></div><span class="cdc-suspend-pill__item-number">0</span></button><button class="cdc-icon-btn cdc-suspend-pill__item like cdc-icon-btn--text"><span class="cdc-svg-icon-con"><span class="cdc-svg-icon" style="width:24px;height:24px"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="currentcolor"><path fill-rule="evenodd" clip-rule="evenodd" d="M17.5 11.25C17.5 11.9404 16.9404 12.5 16.25 12.5C15.5596 12.5 15 11.9404 15 11.25C15 10.5596 15.5596 10 16.25 10C16.9404 10 17.5 10.5596 17.5 11.25Z M12.25 12.5C12.9404 12.5 13.5 11.9404 13.5 11.25C13.5 10.5596 12.9404 10 12.25 10C11.5596 10 11 10.5596 11 11.25C11 11.9404 11.5596 12.5 12.25 12.5Z M8.25 12.5C8.94036 12.5 9.5 11.9404 9.5 11.25C9.5 10.5596 8.94036 10 8.25 10C7.55964 10 7 10.5596 7 11.25C7 11.9404 7.55964 12.5 8.25 12.5Z M5 3C3.34315 3 2 4.34315 2 6V16C2 17.6569 3.34315 19 5 19H8.34311L10.5858 21.2426C11.3668 22.0237 12.6331 22.0237 13.4142 21.2426L15.6568 19H19C20.6569 19 22 17.6569 22 16V6C22 4.34315 20.6569 3 19 3H5ZM4 6C4 5.44772 4.44772 5 5 5H19C19.5523 5 20 5.44772 20 6V16C20 16.5523 19.5523 17 19 17H14.8284L12 19.8284L9.17154 17H5C4.44772 17 4 16.5523 4 16V6Z"></path></svg></span></span><span class="cdc-suspend-pill__item-number">0</span></button><button class="cdc-icon-btn cdc-suspend-pill__item collect cdc-icon-btn--text" qct-area="收藏文章" qct-click=""><span class="cdc-svg-icon-con"><span class="cdc-svg-icon" style="width:24px;height:24px"><svg width="24" height="24" viewBox="0 0 24 24" fill="currentcolor" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M10.2057 3.11487C10.9393 1.62838 13.059 1.62838 13.7927 3.11487L15.9724 7.53141L20.8463 8.23963C22.4867 8.478 23.1418 10.4939 21.9547 11.651L18.4279 15.0888L19.2605 19.9431C19.5407 21.5769 17.8258 22.8228 16.3586 22.0514L11.9992 19.7596L7.63981 22.0514C6.17255 22.8228 4.45769 21.5769 4.73791 19.9431L5.57048 15.0888L2.04366 11.651C0.856629 10.4939 1.51165 8.478 3.15209 8.23963L8.02603 7.53141L10.2057 3.11487ZM11.9992 4L9.8195 8.41654C9.52818 9.00683 8.96504 9.41597 8.31363 9.51062L3.43969 10.2188L6.9665 13.6566C7.43787 14.1161 7.65297 14.7781 7.5417 15.4269L6.70913 20.2812L11.0685 17.9893C11.6512 17.683 12.3472 17.683 12.9299 17.9893L17.2893 20.2812L16.4567 15.4269C16.3454 14.7781 16.5605 14.1161 17.0319 13.6566L20.5587 10.2188L15.6848 9.51062C15.0333 9.41597 14.4702 9.00683 14.1789 8.41654L11.9992 4Z"></path></svg></span></span><span class="cdc-suspend-pill__item-number">0</span></button><button class="cdc-icon-btn cdc-suspend-pill__item cdc-icon-btn--text"><span class="cdc-svg-icon-con"><span class="cdc-svg-icon" style="width:24px;height:24px"><svg width="24" height="24" viewBox="0 0 24 24" fill="currentcolor" xmlns="http://www.w3.org/2000/svg"><path d="M13.0001 4V6H17.5859L10.1787 13.4072L11.6043 14.81L19.0001 7.41424V12H21.0001V4H13.0001Z"></path><path d="M3 12.9996C3 8.71646 5.99202 5.13211 10 4.22266V6.28952C7.10851 7.15007 5 9.82862 5 12.9996C5 16.8656 8.13401 19.9996 12 19.9996C15.1709 19.9996 17.8494 17.8912 18.71 14.9999H20.7769C19.8674 19.0077 16.2831 21.9996 12 21.9996C7.02944 21.9996 3 17.9702 3 12.9996Z"></path></svg></span></span></button><button class="cdc-icon-btn cdc-suspend-pill__item cdc-icon-btn--text"><span class="cdc-svg-icon-con"><span class="cdc-svg-icon" style="width:24px;height:24px"><svg width="24" height="24" viewBox="0 0 24 24" fill="currentcolor" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M2 6C2 4.34315 3.34315 3 5 3H17C18.6569 3 20 4.34315 20 6V11H18V6C18 5.44772 17.5523 5 17 5H5C4.44772 5 4 5.44772 4 6V18C4 18.5523 4.44772 19 5 19H12V21H5C3.34315 21 2 19.6569 2 18V6ZM6 8H12V10H6V8ZM6 12H15V14H6V12ZM22 16H19V13H17V16H14V18H17V21H19V18H22V16Z"></path></svg></span></span></button><div class="cdc-suspend-pill__line"></div><button class="cdc-icon-btn cdc-suspend-pill__item cdc-icon-btn--text"><span class="cdc-svg-icon-con"><span class="cdc-svg-icon" style="width:24px;height:24px"><svg width="24" height="24" viewBox="0 0 24 24" fill="currentcolor" xmlns="http://www.w3.org/2000/svg"><path d="M16.5047 6H13V4H20V10.876H18V7.33313L14.4571 10.876L13.0429 9.46182L16.5047 6Z"></path><path d="M11 6.00006H7.4953L10.9571 9.46189L9.54291 10.8761L6 7.33319V10.8761H4V4.00006H11V6.00006Z"></path><path d="M7.4953 18.8761H11V20.8761H4V14.0001H6V17.543L9.54291 14.0001L10.9571 15.4143L7.4953 18.8761Z"></path><path d="M16.5047 18.8761H13V20.8761H20V14.0001H18V17.543L14.4571 14.0001L13.0429 15.4143L16.5047 18.8761Z"></path></svg></span></span></button><button class="cdc-icon-btn cdc-suspend-pill__item recommend cdc-icon-btn--text" track-click="{"areaId":106019,"recPolicyId":1002,"elementId":2}" track-exposure="{"areaId":106019,"recPolicyId":1002,"elementId":2}"><span class="cdc-svg-icon-con"><span class="cdc-svg-icon" style="width:24px;height:24px"><svg width="24" height="24" viewBox="0 0 24 24" fill="currentcolor" xmlns="http://www.w3.org/2000/svg"><path d="M5 8H10V10H5V8Z"></path><path d="M10 12H5V14H10V12Z"></path><path d="M14 8H19V10H14V8Z"></path><path d="M19 12H14V14H19V12Z"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M11 20.608L9.57047 20.1996C8.83303 19.9889 8.05701 19.9506 7.30243 20.0878L4.35777 20.6232C3.13009 20.8464 2 19.9033 2 18.6555V5.2669C2 4.2325 2.78877 3.36877 3.81893 3.27512L6.52892 3.02875C7.95704 2.89892 9.39058 3.21084 10.6356 3.9223L12 4.70194L13.3644 3.9223C14.6094 3.21084 16.043 2.89892 17.4711 3.02875L20.1811 3.27512C21.2112 3.36877 22 4.2325 22 5.2669V18.6555C22 19.9033 20.8699 20.8464 19.6422 20.6232L16.6976 20.0878C15.943 19.9506 15.167 19.9889 14.4295 20.1996L13 20.608L12.5 20.8535L12 20.8937L11.5 20.8535L11 20.608ZM6.70999 5.02054C7.73007 4.9278 8.75403 5.1506 9.64336 5.65879L11 6.43401V18.528L10.1199 18.2765C9.0875 17.9815 8.00107 17.928 6.94466 18.1201L4 18.6555V5.2669L6.70999 5.02054ZM13 18.528L13.8801 18.2765C14.9125 17.9815 15.9989 17.928 17.0553 18.1201L20 18.6555V5.2669L17.29 5.02054C16.2699 4.9278 15.246 5.1506 14.3566 5.65879L13 6.43401V18.528Z"></path></svg></span></span><span class="cdc-suspend-pill__item-text">推荐</span></button></div></div></div></div></div><script> if (!String.prototype.replaceAll) { String.prototype.replaceAll = function (str, newStr) { // If a regex pattern if (Object.prototype.toString.call(str).toLowerCase() === '[object regexp]') { return this.replace(str, newStr); } // If a string return this.replace(new RegExp(str, 'g'), newStr); }; } </script><script src="https://developer.qcloudimg.com/static/jquery.min.js"></script><script src="https://cloud.tencent.com/qccomponent/login/api.js"></script><script src="https://cloudcache.tencent-cloud.com/qcloud/main/scripts/release/common/vendors/react/react.16.8.6.min.js"></script><script src="https://qccommunity-1258344699.cos.ap-guangzhou.myqcloud.com/tc_player/releasev5.1.0/libs/TXLivePlayer-1.3.5.min.js" defer=""></script><script src="https://qccommunity-1258344699.cos.ap-guangzhou.myqcloud.com/tc_player/releasev5.1.0/libs/hls.min.1.1.7.js"></script><script src="https://qccommunity-1258344699.cos.ap-guangzhou.myqcloud.com/tc_player/releasev5.1.0/tcplayer.v5.1.0.min.js"></script><script id="__NEXT_DATA__" type="application/json">{"props":{"isMobile":false,"isSupportWebp":false,"currentDomain":"cloud.tencent.com","baseUrl":"https://cloud.tencent.com","reqId":"4HXP9UHawNQ-lTFG21X4q","query":{"articleId":"2471010"},"platform":"other","env":"production","__N_SSP":true,"pageProps":{"fallback":{"#url:\"/api/article/detail\",params:#articleId:2471010,,":{"articleData":{"articleId":2471010,"codeLineNum":0,"readingTime":401,"wordsNum":1841},"articleInfo":{"articleId":2471010,"channel":4,"commentNum":0,"content":{"blocks":[{"key":"ihv7","text":"大家好,我是码哥。","type":"unstyled","depth":0,"inlineStyleRanges":[],"entityRanges":[],"data":{}},{"key":"5n055","text":"Java 虚拟机(Java Virtual Machine,JVM)是 Java 技术体系的核心组成部分,它使得 Java 程序能够实现“一次编译,到处运行”的跨平台特性。","type":"unstyled","depth":0,"inlineStyleRanges":[],"entityRanges":[],"data":{}},{"key":"6bhm9","text":"JVM 不仅运行 Java 程序,还承担了内存管理、垃圾回收、即时编译(JIT)等关键任务,是现代 Java 开发不可或缺的基础设施。","type":"unstyled","depth":0,"inlineStyleRanges":[],"entityRanges":[],"data":{}},{"key":"b6kps","text":"在本章中,我们将全面解析 JVM 的作用、设计目标、在 Java 技术体系中的地位,以及它的演变历史和主流实现,为后续深入理解 JVM 的内部工作机制打下坚实基础。","type":"unstyled","depth":0,"inlineStyleRanges":[],"entityRanges":[],"data":{}},{"key":"7g0li","text":"JVM 的作用:就像一个“全能管家”","type":"header-two","depth":0,"inlineStyleRanges":[{"offset":0,"length":18,"style":"BOLD"}],"entityRanges":[],"data":{"text":"JVM-%E7%9A%84%E4%BD%9C%E7%94%A8%EF%BC%9A%E5%B0%B1%E5%83%8F%E4%B8%80%E4%B8%AA%E2%80%9C%E5%85%A8%E8%83%BD%E7%AE%A1%E5%AE%B6%E2%80%9D"}},{"key":"10m19","text":"JVM 是一个运行时环境,主要负责加载字节码(.class 文件)、执行程序指令、管理内存等。其核心作用如下:","type":"unstyled","depth":0,"inlineStyleRanges":[],"entityRanges":[],"data":{}},{"key":"3pi85","text":"跨平台支持","type":"ordered-list-item","depth":0,"inlineStyleRanges":[{"offset":0,"length":5,"style":"BOLD"}],"entityRanges":[],"data":{}},{"key":"fr83k","text":"Java 程序通过 javac 编译为平台无关的字节码,由 JVM 在目标平台上解释或编译为本地机器码运行。","type":"unordered-list-item","depth":1,"inlineStyleRanges":[{"offset":10,"length":5,"style":"CODE"}],"entityRanges":[],"data":{}},{"key":"a7mu0","text":"实现了“一次编译,到处运行”的特性。","type":"unordered-list-item","depth":1,"inlineStyleRanges":[],"entityRanges":[],"data":{}},{"key":"buus7","text":"内存管理","type":"ordered-list-item","depth":0,"inlineStyleRanges":[{"offset":0,"length":4,"style":"BOLD"}],"entityRanges":[],"data":{}},{"key":"41r1a","text":"JVM 负责分配和回收 Java 程序使用的内存,开发者无需手动管理堆栈,避免了许多常见的内存泄漏问题。","type":"unordered-list-item","depth":1,"inlineStyleRanges":[],"entityRanges":[],"data":{}},{"key":"8h3c0","text":"安全性保障","type":"ordered-list-item","depth":0,"inlineStyleRanges":[{"offset":0,"length":5,"style":"BOLD"}],"entityRanges":[],"data":{}},{"key":"as3gu","text":"JVM 通过类加载器和字节码验证器确保程序运行的安全性,防止恶意代码执行。","type":"unordered-list-item","depth":1,"inlineStyleRanges":[],"entityRanges":[],"data":{}},{"key":"1geau","text":"性能优化","type":"ordered-list-item","depth":0,"inlineStyleRanges":[{"offset":0,"length":4,"style":"BOLD"}],"entityRanges":[],"data":{}},{"key":"dosio","text":"JVM 内置即时编译器(JIT),在运行时将热点代码编译为高效的本地机器码。","type":"unordered-list-item","depth":1,"inlineStyleRanges":[],"entityRanges":[],"data":{}},{"key":"5gagh","text":"它不仅为程序提供“房间”(内存分配),还负责打扫卫生(垃圾回收)、监督安全(类加载器)、优化生活效率(JIT 编译器)。","type":"unstyled","depth":0,"inlineStyleRanges":[],"entityRanges":[],"data":{}},{"key":"8c9ie","text":"JVM 的核心功能","type":"header-two","depth":0,"inlineStyleRanges":[{"offset":0,"length":9,"style":"BOLD"}],"entityRanges":[],"data":{"text":"JVM-%E7%9A%84%E6%A0%B8%E5%BF%83%E5%8A%9F%E8%83%BD"}},{"key":"7ppnb","text":"JVM 的功能可以分为以下几个核心模块:","type":"unstyled","depth":0,"inlineStyleRanges":[],"entityRanges":[],"data":{}},{"key":"f414s","text":"\ud83d","type":"atomic","depth":0,"inlineStyleRanges":[],"entityRanges":[{"offset":0,"length":1,"key":0}],"data":{}},{"key":"72oak","text":"类加载","type":"unstyled","depth":0,"inlineStyleRanges":[{"offset":0,"length":3,"style":"BOLD"}],"entityRanges":[],"data":{}},{"key":"8hqh5","text":"负责加载和验证 .class 文件。","type":"unordered-list-item","depth":0,"inlineStyleRanges":[{"offset":8,"length":6,"style":"CODE"}],"entityRanges":[],"data":{}},{"key":"831vc","text":"支持自定义类加载器,灵活扩展应用的加载逻辑。","type":"unordered-list-item","depth":0,"inlineStyleRanges":[],"entityRanges":[],"data":{}},{"key":"d60j9","text":"字节码执行","type":"unstyled","depth":0,"inlineStyleRanges":[{"offset":0,"length":5,"style":"BOLD"}],"entityRanges":[],"data":{}},{"key":"2eooq","text":"JVM 可通过解释器逐行解释执行字节码。","type":"unordered-list-item","depth":0,"inlineStyleRanges":[],"entityRanges":[],"data":{}},{"key":"4g2q9","text":"配合 JIT 编译器,将热点代码动态编译为本地机器码,提高执行效率。","type":"unordered-list-item","depth":0,"inlineStyleRanges":[],"entityRanges":[],"data":{}},{"key":"9q8dj","text":"内存管理","type":"unstyled","depth":0,"inlineStyleRanges":[{"offset":0,"length":4,"style":"BOLD"}],"entityRanges":[],"data":{}},{"key":"6njj0","text":"包括堆内存(Heap)和栈内存(Stack)管理,自动分配对象存储位置。","type":"unordered-list-item","depth":0,"inlineStyleRanges":[],"entityRanges":[],"data":{}},{"key":"4n9oh","text":"垃圾回收","type":"unstyled","depth":0,"inlineStyleRanges":[{"offset":0,"length":4,"style":"BOLD"}],"entityRanges":[],"data":{}},{"key":"1nb52","text":"使用垃圾回收机制(GC)自动释放不再使用的内存,减少内存泄漏和碎片化。","type":"unordered-list-item","depth":0,"inlineStyleRanges":[],"entityRanges":[],"data":{}},{"key":"7lkeu","text":"即时编译(JIT)","type":"unstyled","depth":0,"inlineStyleRanges":[{"offset":0,"length":9,"style":"BOLD"}],"entityRanges":[],"data":{}},{"key":"7kv16","text":"在运行时动态优化程序代码,将热点代码编译为高效的机器码执行,显著提升性能。","type":"unordered-list-item","depth":0,"inlineStyleRanges":[],"entityRanges":[],"data":{}},{"key":"fh32p","text":"JVM 的设计目标","type":"header-two","depth":0,"inlineStyleRanges":[{"offset":0,"length":9,"style":"BOLD"}],"entityRanges":[],"data":{"text":"JVM-%E7%9A%84%E8%AE%BE%E8%AE%A1%E7%9B%AE%E6%A0%87"}},{"key":"1em6u","text":"JVM 的设计目标契合 Java 的技术哲学:","type":"unstyled","depth":0,"inlineStyleRanges":[],"entityRanges":[],"data":{}},{"key":"d1djq","text":"可移植性:JVM 是字节码和底层操作系统之间的桥梁,通过屏蔽硬件和平台的差异,确保 Java 程序可以跨平台运行。","type":"ordered-list-item","depth":0,"inlineStyleRanges":[{"offset":0,"length":4,"style":"BOLD"}],"entityRanges":[],"data":{}},{"key":"e85dp","text":"高性能:JVM 引入即时编译、分代垃圾回收等机制,尽可能接近本地代码的执行效率。","type":"ordered-list-item","depth":0,"inlineStyleRanges":[{"offset":0,"length":3,"style":"BOLD"}],"entityRanges":[],"data":{}},{"key":"cgu69","text":"安全性:类加载器和字节码验证器提供了多层保护,防止运行恶意代码。","type":"ordered-list-item","depth":0,"inlineStyleRanges":[{"offset":0,"length":3,"style":"BOLD"}],"entityRanges":[],"data":{}},{"key":"ca0lj","text":"多语言支持:现代 JVM(如 GraalVM)已扩展支持多种编程语言,包括 Scala、Kotlin,甚至 Python 等非 Java 语言。","type":"ordered-list-item","depth":0,"inlineStyleRanges":[{"offset":0,"length":5,"style":"BOLD"}],"entityRanges":[],"data":{}},{"key":"uvu6","text":"JVM 就像一台“翻译机","type":"unstyled","depth":0,"inlineStyleRanges":[{"offset":0,"length":12,"style":"BOLD"}],"entityRanges":[],"data":{}},{"key":"bcfud","text":"它能将一种“通用语言”(字节码)翻译成适合任何设备的指令,而翻译过程中还会进行优化和安全检查。","type":"unstyled","depth":0,"inlineStyleRanges":[],"entityRanges":[],"data":{}},{"key":"4j947","text":"Java 技术体系的组成","type":"header-two","depth":0,"inlineStyleRanges":[{"offset":0,"length":12,"style":"BOLD"}],"entityRanges":[],"data":{"text":"Java-%E6%8A%80%E6%9C%AF%E4%BD%93%E7%B3%BB%E7%9A%84%E7%BB%84%E6%88%90"}},{"key":"87k00","text":"Java 技术体系由以下三部分组成:","type":"unstyled","depth":0,"inlineStyleRanges":[],"entityRanges":[],"data":{}},{"key":"5e3hm","text":"\ud83d","type":"atomic","depth":0,"inlineStyleRanges":[],"entityRanges":[{"offset":0,"length":1,"key":1}],"data":{}},{"key":"dgn9q","text":"Java 编程语言:提供简单易用的语法规则,让开发者快速实现业务逻辑。","type":"ordered-list-item","depth":0,"inlineStyleRanges":[{"offset":0,"length":9,"style":"BOLD"}],"entityRanges":[],"data":{}},{"key":"fl2tm","text":"Java 标准类库:提供丰富的功能模块,包括集合框架、并发工具、I/O 操作等。","type":"ordered-list-item","depth":0,"inlineStyleRanges":[{"offset":0,"length":9,"style":"BOLD"}],"entityRanges":[],"data":{}},{"key":"6cuo6","text":"Java 虚拟机(JVM):执行 Java 程序的运行时环境,负责字节码执行、内存管理和性能优化。","type":"ordered-list-item","depth":0,"inlineStyleRanges":[{"offset":0,"length":13,"style":"BOLD"}],"entityRanges":[],"data":{}},{"key":"cij9o","text":"JVM 的发展历程","type":"header-two","depth":0,"inlineStyleRanges":[{"offset":0,"length":9,"style":"BOLD"}],"entityRanges":[],"data":{"text":"JVM-%E7%9A%84%E5%8F%91%E5%B1%95%E5%8E%86%E7%A8%8B"}},{"key":"aio9q","text":"JVM 的发展紧密伴随 Java 技术的演变:","type":"unstyled","depth":0,"inlineStyleRanges":[],"entityRanges":[],"data":{}},{"key":"buu8o","text":"\ud83d","type":"atomic","depth":0,"inlineStyleRanges":[],"entityRanges":[{"offset":0,"length":1,"key":2}],"data":{}},{"key":"emnu0","text":"1995 年:Sun Classic JVM,第一代 JVM,采用解释执行,性能较低。","type":"ordered-list-item","depth":0,"inlineStyleRanges":[{"offset":0,"length":22,"style":"BOLD"}],"entityRanges":[],"data":{}},{"key":"13jsg","text":"1999 年:HotSpot JVM,引入即时编译(JIT)技术,显著提升性能,成为主流实现。","type":"ordered-list-item","depth":0,"inlineStyleRanges":[{"offset":0,"length":18,"style":"BOLD"}],"entityRanges":[],"data":{}},{"key":"1ln2f","text":"2000 年:BEA JRockit JVM,专注于服务器端优化,提供更高的并发支持。","type":"ordered-list-item","depth":0,"inlineStyleRanges":[{"offset":0,"length":22,"style":"BOLD"}],"entityRanges":[],"data":{}},{"key":"6rph2","text":"2006 年:OpenJDK,Sun 将 JVM 开源,推动 Java 社区的快速发展。","type":"ordered-list-item","depth":0,"inlineStyleRanges":[{"offset":0,"length":14,"style":"BOLD"}],"entityRanges":[],"data":{}},{"key":"1ej3a","text":"2018 年:GraalVM,引入多语言支持和高性能编译器,扩展 JVM 的应用场景。","type":"ordered-list-item","depth":0,"inlineStyleRanges":[{"offset":0,"length":14,"style":"BOLD"}],"entityRanges":[],"data":{}},{"key":"e93pb","text":"目前,主流 JVM 包括:","type":"unstyled","depth":0,"inlineStyleRanges":[],"entityRanges":[],"data":{}},{"key":"agt4h","text":"HotSpot JVM,Oracle JDK 的默认 JVM,适用于绝大多数应用场景。","type":"ordered-list-item","depth":0,"inlineStyleRanges":[{"offset":0,"length":11,"style":"BOLD"}],"entityRanges":[],"data":{}},{"key":"f2vk9","text":"OpenJ9 JVM,IBM 开发的轻量级 JVM,专注于内存使用优化和快速启动。","type":"ordered-list-item","depth":0,"inlineStyleRanges":[{"offset":0,"length":10,"style":"BOLD"}],"entityRanges":[],"data":{}},{"key":"eevk5","text":"GraalVM,支持多语言运行和即时编译的现代 JVM,实现了更强的生态扩展性。","type":"ordered-list-item","depth":0,"inlineStyleRanges":[{"offset":0,"length":7,"style":"BOLD"}],"entityRanges":[],"data":{}},{"key":"cei11","text":"最后","type":"header-two","depth":0,"inlineStyleRanges":[{"offset":0,"length":2,"style":"BOLD"}],"entityRanges":[],"data":{"text":"%E6%9C%80%E5%90%8E"}},{"key":"2kpsb","text":"通过本章,我们全面了解了 JVM 的作用、功能、设计目标和发展历程。","type":"unstyled","depth":0,"inlineStyleRanges":[],"entityRanges":[],"data":{}},{"key":"9asn4","text":"JVM 的出现为 Java 程序提供了跨平台、高性能和安全性的保障,是 Java 技术体系的基石。","type":"unstyled","depth":0,"inlineStyleRanges":[],"entityRanges":[],"data":{}},{"key":"a90bs","text":"在接下来的章节中,我们将深入解析 JVM 的运行时数据区域、垃圾回收机制、类加载与字节码执行等核心模块,为高性能调优提供理论支持。","type":"unstyled","depth":0,"inlineStyleRanges":[],"entityRanges":[],"data":{}}],"entityMap":{"0":{"type":"IMAGE","mutability":"IMMUTABLE","data":{"imageUrl":"https://developer.qcloudimg.com/http-save/yehe-2253892/60bd136b9f023ae108496beffb65badc.png","imageAlt":"","name":"","blockWidth":835,"blockHeight":270}},"1":{"type":"IMAGE","mutability":"IMMUTABLE","data":{"imageUrl":"https://developer.qcloudimg.com/http-save/yehe-2253892/bb517cc92e6d5c31214cbd5f3f5945f0.png","imageAlt":"","name":"","blockWidth":694,"blockHeight":288}},"2":{"type":"IMAGE","mutability":"IMMUTABLE","data":{"imageUrl":"https://developer.qcloudimg.com/http-save/yehe-2253892/1ca10f2853de6718f81ceca37d475f32.png","imageAlt":"","name":"","blockWidth":1080,"blockHeight":549}}}},"createTime":1732582085,"ext":{"closeTextLink":0,"comment_ban":0,"description":"","focusRead":0},"favNum":0,"isOriginal":0,"likeNum":1,"pic":"https://developer.qcloudimg.com/http-save/yehe-2253892/bc4a766b9566354347a6b9ef13adf558.jpg","plain":"大家好,我是码哥。\nJava 虚拟机(Java Virtual Machine,JVM)是 Java 技术体系的核心组成部分,它使得 Java 程序能够实现“一次编译,到处运行”的跨平台特性。\nJVM 不仅运行 Java 程序,还承担了内存管理、垃圾回收、即时编译(JIT)等关键任务,是现代 Java 开发不可或缺的基础设施。\n在本章中,我们将全面解析 JVM 的作用、设计目标、在 Java 技术体系中的地位,以及它的演变历史和主流实现,为后续深入理解 JVM 的内部工作机制打下坚实基础。\nJVM 的作用:就像一个“全能管家”\nJVM 是一个运行时环境,主要负责加载字节码(.class 文件)、执行程序指令、管理内存等。其核心作用如下:\n跨平台支持\nJava 程序通过 javac 编译为平台无关的字节码,由 JVM 在目标平台上解释或编译为本地机器码运行。\n实现了“一次编译,到处运行”的特性。\n内存管理\nJVM 负责分配和回收 Java 程序使用的内存,开发者无需手动管理堆栈,避免了许多常见的内存泄漏问题。\n安全性保障\nJVM 通过类加载器和字节码验证器确保程序运行的安全性,防止恶意代码执行。\n性能优化\nJVM 内置即时编译器(JIT),在运行时将热点代码编译为高效的本地机器码。\n它不仅为程序提供“房间”(内存分配),还负责打扫卫生(垃圾回收)、监督安全(类加载器)、优化生活效率(JIT 编译器)。\nJVM 的核心功能\nJVM 的功能可以分为以下几个核心模块:\n类加载\n负责加载和验证 .class 文件。\n支持自定义类加载器,灵活扩展应用的加载逻辑。\n字节码执行\nJVM 可通过解释器逐行解释执行字节码。\n配合 JIT 编译器,将热点代码动态编译为本地机器码,提高执行效率。\n内存管理\n包括堆内存(Heap)和栈内存(Stack)管理,自动分配对象存储位置。\n垃圾回收\n使用垃圾回收机制(GC)自动释放不再使用的内存,减少内存泄漏和碎片化。\n即时编译(JIT)\n在运行时动态优化程序代码,将热点代码编译为高效的机器码执行,显著提升性能。\nJVM 的设计目标\nJVM 的设计目标契合 Java 的技术哲学:\n可移植性:JVM 是字节码和底层操作系统之间的桥梁,通过屏蔽硬件和平台的差异,确保 Java 程序可以跨平台运行。\n高性能:JVM 引入即时编译、分代垃圾回收等机制,尽可能接近本地代码的执行效率。\n安全性:类加载器和字节码验证器提供了多层保护,防止运行恶意代码。\n多语言支持:现代 JVM(如 GraalVM)已扩展支持多种编程语言,包括 Scala、Kotlin,甚至 Python 等非 Java 语言。\nJVM 就像一台“翻译机\n它能将一种“通用语言”(字节码)翻译成适合任何设备的指令,而翻译过程中还会进行优化和安全检查。\nJava 技术体系的组成\nJava 技术体系由以下三部分组成:\nJava 编程语言:提供简单易用的语法规则,让开发者快速实现业务逻辑。\nJava 标准类库:提供丰富的功能模块,包括集合框架、并发工具、I/O 操作等。\nJava 虚拟机(JVM):执行 Java 程序的运行时环境,负责字节码执行、内存管理和性能优化。\nJVM 的发展历程\nJVM 的发展紧密伴随 Java 技术的演变:\n1995 年:Sun Classic JVM,第一代 JVM,采用解释执行,性能较低。\n1999 年:HotSpot JVM,引入即时编译(JIT)技术,显著提升性能,成为主流实现。\n2000 年:BEA JRockit JVM,专注于服务器端优化,提供更高的并发支持。\n2006 年:OpenJDK,Sun 将 JVM 开源,推动 Java 社区的快速发展。\n2018 年:GraalVM,引入多语言支持和高性能编译器,扩展 JVM 的应用场景。\n目前,主流 JVM 包括:\nHotSpot JVM,Oracle JDK 的默认 JVM,适用于绝大多数应用场景。\nOpenJ9 JVM,IBM 开发的轻量级 JVM,专注于内存使用优化和快速启动。\nGraalVM,支持多语言运行和即时编译的现代 JVM,实现了更强的生态扩展性。\n最后\n通过本章,我们全面了解了 JVM 的作用、功能、设计目标和发展历程。\nJVM 的出现为 Java 程序提供了跨平台、高性能和安全性的保障,是 Java 技术体系的基石。\n在接下来的章节中,我们将深入解析 JVM 的运行时数据区域、垃圾回收机制、类加载与字节码执行等核心模块,为高性能调优提供理论支持。","showReadNum":122,"sourceDetail":null,"sourceType":99,"status":2,"summary":"Java 虚拟机(Java Virtual Machine,JVM)是 Java 技术体系的核心组成部分,它使得 Java 程序能够实现“一次编译,到处运行”的跨平台特性。","tagIds":[17341,17382,10688,17190,17215],"title":"什么是 JVM?JVM 为什么是开发者必须了解的核心技术?","uid":2253892,"updateTime":1732582085,"userSummary":"Java 虚拟机(Java Virtual Machine,JVM)是 Java 技术体系的核心组成部分,它使得 Java 程序能够实现“一次编译,到处运行”的跨平台特性。","userUpdateTime":1732582085,"isNewArticle":false},"authorInfo":{"articleNum":0,"avatarUrl":"https://developer.qcloudimg.com/http-save/10011/1b9c3652fd10c71666f670e276e212aa.jpg","company":"互联网金融","introduce":"著有《Redis 高手心法》、InfoQ 签约作者,擅长 MySQL、Spring Cloud、Kafka","isProfessionVerified":0,"nickname":"码哥字节","privilege":1,"title":"架构师","uid":2253892},"authorType":{"isBlogMoveAuthor":1,"isCoCreator":0,"isInternalAuthor":0,"isOriginalAuthor":1},"classify":[{"id":5,"name":"编程语言"},{"id":12,"name":"运维"},{"id":19,"name":"开发工具"}],"columnInfo":{"columnAvatar":"https://imgcache.qq.com/qcloud/developer/images/release/column-icons/5.png","columnDesc":"分享技术知识,提升内功心法","columnId":81086,"columnName":"Java 技术栈","createTime":1569125131,"createUid":2253892,"memberNum":1,"showArticleNum":186,"showConcernNum":34},"columnList":[{"columnAvatar":"https://imgcache.qq.com/qcloud/developer/images/release/column-icons/5.png","columnDesc":"分享技术知识,提升内功心法","columnId":81086,"columnName":"Java 技术栈","createTime":1569125131,"createUid":2253892,"memberNum":1,"showArticleNum":186,"showConcernNum":34}],"editTime":0,"isTencent":false,"longtailTags":[],"publishTime":1732582085,"sourceDetail":{"blogType":1,"blogUrl":"","channelSource":"wechat","originalTime":"2024-11-24","sourceAuthor":"码哥跳动","sourceLink":"https://mp.weixin.qq.com/s?__biz=MzkzMDI1NjcyOQ==\u0026mid=2247504727\u0026idx=1\u0026sn=dfdae0a9bf5b5558fe46585c1ea08060\u0026chksm=c27f9161f50818778e8d6f7ade06171480c62df44bbb4374c56065eb6b18bf5bc6fe5df5b598#rd","wechatNickName":"码哥跳动","wechatUserName":"gh_66e5d19675b3"},"tags":[{"categoryId":99,"createTime":"2023/03/14 11:34:56","groupId":0,"groupName":"","tagId":17341,"tagName":"开发者"},{"categoryId":99,"createTime":"2023/03/14 11:34:56","groupId":0,"groupName":"","tagId":17382,"tagName":"内存"},{"categoryId":3,"createTime":"2018/09/06 18:31:32","groupId":10136,"groupName":"服务器技术","tagId":10688,"tagName":"jvm"},{"categoryId":99,"createTime":"2023/03/14 11:34:53","groupId":0,"groupName":"","tagId":17190,"tagName":"编译"},{"categoryId":99,"createTime":"2023/03/14 11:34:54","groupId":0,"groupName":"","tagId":17215,"tagName":"程序"}],"textLink":[{"ext":{"categoryId":1005,"categoryName":"云产品 - 存储","desc":"对象存储(Cloud Object Storage,COS)是腾讯云提供的一种存储海量文件的分布式存储服务,用户可通过网络随时存储和查看数据。腾讯云 COS 使所有用户都能使用具备高扩展性、低成本、可靠和安全的数据存储服务。COS 通过控制台、API、SDK 和工具等多样化方式简单、快速地接入,实现了海量数据存储和管理。通过 COS 可以进行任意格式文件的上传、下载和管理。腾讯云提供了直观的 Web 管理界面,同时遍布全国范围的 CDN 节点可以对文件下载进行加速。","kpCount":479,"name":"对象存储","pCategoryId":1000,"termId":1039},"id":6,"link":"https://cloud.tencent.com/product/cos","sources":[1,2],"text":"对象存储"},{"ext":{"categoryId":1026,"categoryName":"通用技术 - 操作系统","desc":"内存管理是计算机系统中的一个关键功能,它负责管理计算机系统中的内存资源。内存管理的目标是确保系统中的所有程序都能够访问所需的内存,并且不会发生内存冲突或内存泄漏等问题。内存管理包括内存分配、内存回收、内存保护、内存映射等操作,这些操作需要由操作系统或应用程序进行管理。内存管理的好坏直接影响系统的性能和稳定性。","kpCount":7,"name":"内存管理","pCategoryId":1002,"termId":1996},"id":3693,"link":"https://cloud.tencent.com/developer/techpedia/1996","sources":[2],"text":"内存管理"},{"ext":{"categoryId":1020,"categoryName":"通用技术 - 云计算","desc":"服务器是一种计算机硬件和软件系统,其主要功能是为其他计算机(通常称为客户端)提供服务、资源和数据。服务器可以处理来自客户端的请求,例如文件共享、应用程序访问、数据存储和检索、网络服务等。服务器通常具有较高的处理能力、内存和存储容量,以便能够同时处理多个客户端的请求。\n\n服务器可以分为不同类型,如文件服务器、数据库服务器、Web服务器、邮件服务器等,根据其提供的服务和功能而有所不同。服务器可以部署在本地数据中心、企业内部网络或云计算环境中,以满足不同的业务需求和应用场景。","kpCount":13,"name":"服务器","pCategoryId":1002,"termId":2248},"id":374,"link":"https://cloud.tencent.com/product/cvm/","sources":[1,2],"text":"服务器"},{"ext":{"categoryId":1020,"categoryName":"通用技术 - 云计算","desc":"虚拟机(Virtual Machine,简称VM)是一种软件模拟的计算机系统,它可以在物理计算机上运行多个操作系统和应用程序。","kpCount":3,"name":"虚拟机","pCategoryId":1002,"termId":1523},"id":3285,"link":"https://cloud.tencent.com/developer/techpedia/1523","sources":[2],"text":"虚拟机"},{"ext":{"categoryId":1028,"categoryName":"通用技术 - 软件工程","desc":"编译器是一种计算机程序,用于将一种源语言(通常是高级语言)编写的程序转换成目标语言(通常是机器语言)的程序。编译器将源代码作为输入,并将其转换成目标代码,可以在计算机上直接执行。","kpCount":10,"name":"编译器","pCategoryId":1002,"termId":1908},"id":3606,"link":"https://cloud.tencent.com/developer/techpedia/1908","sources":[2],"text":"编译器"},{"ext":{"categoryId":1028,"categoryName":"通用技术 - 软件工程","desc":"解释器是一种计算机程序,用于将源代码逐行解释成计算机可执行的指令。解释器通常用于动态语言,如Python、Ruby和JavaScript等。它们可以直接运行源代码,而不需要编译成二进制代码。解释器还可以执行交互式编程,让用户可以在命令行中直接输入代码并立即看到结果。","kpCount":14,"name":"解释器","pCategoryId":1002,"termId":1910},"id":3608,"link":"https://cloud.tencent.com/developer/techpedia/1910","sources":[2],"text":"解释器"},{"ext":{"categoryId":1018,"categoryName":"通用技术 - 编程语言","desc":"Python是一种高级的、解释性的、面向对象的计算机编程语言,由Guido van Rossum于1991年开发。Python语言简单易学,具有清晰简洁的语法结构,同时具有强大的标准库和第三方库,可以轻松地实现各种功能和应用,包括Web开发、数据分析、人工智能、科学计算等领域。Python广泛应用于各种领域,是目前最受欢迎的编程语言之一。","kpCount":8,"name":"Python","pCategoryId":1002,"termId":1825},"id":3534,"link":"https://cloud.tencent.com/developer/techpedia/1825","sources":[2],"text":"Python"},{"ext":{"categoryId":1018,"categoryName":"通用技术 - 编程语言","desc":"Kotlin 是一种静态类型的编程语言,由 JetBrains 公司开发。Kotlin 最初是为了解决 Java 语言的一些问题而开发的,目标是成为一种更现代、更安全、更简洁的语言。","kpCount":7,"name":"Kotlin","pCategoryId":1002,"termId":1831},"id":3540,"link":"https://cloud.tencent.com/developer/techpedia/1831","sources":[2],"text":"Kotlin"},{"ext":{"categoryId":1018,"categoryName":"通用技术 - 编程语言","desc":"Java是一种计算机编程语言和平台,最初由Sun Microsystems于1995年发布。它是一种面向对象的语言,具有自动内存管理和垃圾回收功能,同时具有跨平台性,可以在不同的操作系统上运行。Java平台包括Java虚拟机(JVM)、Java API和Java编译器等组件,其中JVM是Java平台的核心,它可以将Java程序编译成字节码,然后在不同的操作系统上运行。Java具有简单、安全、可靠、可移植、高效等特点,被广泛应用于企业级应用开发、Web开发、游戏开发、移动应用开发等领域。","kpCount":8,"name":"Java","pCategoryId":1002,"termId":1644},"id":3376,"link":"https://cloud.tencent.com/developer/techpedia/1644","sources":[2],"text":"Java"}]},"#url:\"/api/tag/products\",params:#tagIds:@17341,17382,10688,17190,17215,,objectType:1,objectId:2471010,,":[{"adActivity":{"id":5763,"lightSpotLabel":"HOT","pageUrl":"https://cloud.tencent.com/act/pro/cos","priority":1,"startTime":"2023/12/13 17:16:19","title":"对象存储COS新用户低至1元!\n"},"cnName":"对象存储","desc":"对象存储(Cloud Object Storage,COS)是由腾讯云推出的无目录层次结构、无数据格式限制,可容纳海量数据且支持 HTTP/HTTPS 协议访问的分布式存储服务。腾讯云 COS 的存储桶空间无容量上限,无需分区管理,适用于 CDN 数据分发、数据万象处理或大数据计算与分析的数据湖等多种场景。","docURL":"https://cloud.tencent.com/document/product/436","hasActivity":false,"icon":"https://main.qcloudimg.com/image/product/2016/32_32/blue.svg","introURL":"https://cloud.tencent.com/product/cos","name":"cos","productId":110,"shortDesc":"安全稳定、海量、便捷、低延迟、低成本的云端存储服务","tagId":110}]},"tdk":{"title":"什么是 JVM?JVM 为什么是开发者必须了解的核心技术?-腾讯云开发者社区-腾讯云","keywords":"开发者,内存,jvm,编译,程序","description":"Java 虚拟机(Java Virtual Machine,JVM)是 Java 技术体系的核心组成部分,它使得 Java 程序能够实现“一次编译,到处运行”的跨平台特性。"},"meta":{"subject":"其他-空类-开发者,其他-空类-内存,通用技术-服务器技术-jvm,其他-空类-编译,其他-空类-程序","subjectTime":"2024-11-26 08:48:05","articleSource":"W","magicSource":"N","authorType":"Z,O","productSlug":"cos"},"link":{"canonical":"https://cloud.tencent.com/developer/article/2471010"},"cssName":["Article","DraftMaster","Player"],"rbConfigKeys":["groupQRKeywords"],"pvId":"4HXP9UHawNQ-lTFG21X4q","clientIp":"8.222.208.146","globalAnnounce":{"announceId":28,"content":"参加发文瓜分万元礼品池,人人皆有机会抢小米平衡车、耳机、键盘与海量鹅厂周边等。点击查看活动详情:\u003ca href=\"https://cloud.tencent.com/developer/article/2464457\" target=\"_blank\"\u003ehttps://cloud.tencent.com/developer/article/2464457\u003c/a\u003e\u003cbr/\u003e \n \u003cimg src=\"https://qcloudimg.tencent-cloud.cn/raw/2f0574d008262ef97ba6c136480b7124.png\"/\u003e","title":"21天技术创作挑战赛"},"rbConfig":{"groupQRKeywords":{"AI":{"keywords":[],"img":"https://qcloudimg.tencent-cloud.cn/raw/89b22f53dc3d4e0516d0a4f74ab01a30.png"}},"versionUpdateTipList":"","navList":[{"text":"学习","menuList":[{"iconName":"article","title":"文章","desc":"技术干货聚集地","href":"/developer/column?from=19154"},{"iconName":"ask","title":"问答","desc":"技术问题讨论区","href":"/developer/ask?from=19155"},{"iconName":"video","title":"视频","desc":"技术视频记录区","href":"/developer/video?from=19156"},{"iconName":"learn","title":"学习中心","desc":"一站式学习平台","href":"/developer/learning"},{"iconName":"lab","title":"腾讯云实验室","desc":"体验腾讯云产品功能","href":"/lab/labslist?from=20154\u0026from_column=20154\u0026channel=c1004\u0026sceneCode=dev"}]},{"text":"活动","menuList":[{"iconName":"living","title":"直播","desc":"技术大咖面对面","href":"/developer/salon?from=19161"},{"iconName":"competition","title":"竞赛","desc":"秀出你的技术影响力","href":"/developer/competition?from=19162"}]},{"text":"专区","menuList":[{"iconName":"code","title":"CODING DevOps专区","desc":"云原生开发技术实践交流","href":"/developer/zone/codingdevops?from=19163"},{"iconName":"cloudstudio","title":"Cloud Studio专区","desc":"云端IDE开发者平台","href":"/developer/zone/cloudstudio?from=19165"},{"iconName":"cloudnative","title":"腾讯云原生专区","desc":"助力业务降本增效","href":"/developer/zone/cloudnative?from=19164"},{"iconName":"https://qccommunity.qcloudimg.com/community/image/ipass.svg","title":"腾讯轻联专区 ","desc":"新一代应用与数据集成平台","href":"/developer/zone/ipaas"},{"iconName":"https://qcloudimg.tencent-cloud.cn/raw/1deae15bfe2dcdd1036f601852df7dd2.svg","title":"腾讯云数据库专区","desc":"数据智能管理专家","href":"/developer/zone/tencentdb"},{"iconName":"https://qcloudimg.tencent-cloud.cn/raw/cb0703ff9de6b664413f4ed7d31a9224.svg","title":"腾讯云大数据专区","desc":"打造专业、易用、可信赖的大数据产品","href":"/developer/zone/bigdata"},{"iconName":"https://qcloudimg.tencent-cloud.cn/raw/1d60f881ef280ea992e2e4b6490d974b.svg","title":"腾讯云TCE专区","desc":"私有化云解决方案","href":"/developer/zone/tce"},{"iconName":"https://qccommunity.qcloudimg.com/community/image/cos.svg","title":"腾讯云存储专区","desc":"安全稳定的海量分布式存储服务","href":"/developer/zone/cos"},{"iconName":"https://qccommunity.qcloudimg.com/community/image/andon.svg","title":"腾讯云安灯专区","desc":"助力企业构建IT服务管理体系","href":"/developer/zone/tcandon"},{"iconName":"https://qccommunity.qcloudimg.com/community/image/sale.svg","title":"腾讯云运维技术沙龙","desc":"聚焦运维技术与云上治理","href":"/developer/zone/tcdevopssalon"},{"iconName":"https://qccommunity.qcloudimg.com/community/image/audio.svg","title":"腾讯云音视频","desc":"提供坚实的数字化助力","href":"/developer/zone/mediaservices"},{"iconName":"https://qccommunity.qcloudimg.com/icons/tencentcloudsmartadvisor.svg","title":"腾讯云顾问","desc":"实现便捷、灵活的一站式云上治理","href":"https://cloud.tencent.com/developer/zone/tencentcloudsmartadvisor"},{"iconName":"https://qccommunity.qcloudimg.com/icons/tencenthunyuan.svg","title":"腾讯混元","desc":"具备强大的中文创作、逻辑推理、任务执行能力","href":"https://cloud.tencent.com/developer/zone/tencenthunyuan"},{"iconName":"https://qccommunity.qcloudimg.com/community/image/ai.svg","title":"腾讯云智能","desc":"数实融合,云上智能","href":"https://cloud.tencent.com/developer/zone/ai"},{"iconName":"https://qccommunity.qcloudimg.com/community/image/Dnspod.svg","title":"dnspod","desc":"专业的智能DNS解析和域名托管服","href":"https://cloud.tencent.com/developer/zone/dnspod"},{"iconName":"https://qccommunity.qcloudimg.com/community/image/lighthouse.svg","title":"轻量应用服务器","desc":"新一代开箱即用、面向轻量应用场景的云服务器","href":"https://cloud.tencent.com/developer/zone/lighthouse"},{"iconName":"https://qccommunity.qcloudimg.com/community/image/HAi.svg","title":"高性能应用服务","desc":"提供即插即用的高性能云服务","href":"https://cloud.tencent.com/developer/zone/hai"},{"iconName":"https://qccommunity.qcloudimg.com/community/image/blockchain.svg","title":"腾讯云区块链","desc":"云链聚未来,协同无边界","href":"https://cloud.tencent.com/developer/zone/tencentcouldbockchain"},{"iconName":"https://qccommunity.qcloudimg.com/community/image/OpencloudOS.svg","title":"OpenCloudOS","desc":"开源中立的国产操作系统社区","href":"https://cloud.tencent.com/developer/zone/opencloudos"},{"iconName":"https://cloudcache.tencent-cloud.com/qcloud/ui/static/static_source_business/b3e1b483-be77-4e08-827f-ef0e5cda26cf.svg","title":"边缘安全加速平台EO","desc":"下一代CDN—EdgeOne,不止加速","href":"https://cloud.tencent.com/developer/zone/tencentcloudedgeone"}]},{"text":"工具","menuList":[{"iconName":"https://qccommunity.qcloudimg.com/icons/ai-assistant.svg","title":"腾讯云AI代码助手","desc":"辅助编码工具,使研发提效增质","href":"https://cloud.tencent.com/product/acc?from=22178"},{"iconName":"coding","title":"CODING DevOps","desc":"一站式软件研发管理平台","href":"/product/coding?from=20154\u0026from_column=20154"},{"iconName":"studio","title":"Cloud Studio","desc":"随时随地在线协作开发","href":"/product/cloudstudio?from=20154\u0026from_column=20154"},{"iconName":"sdk","title":"SDK中心","desc":"开发者语言与SDK","href":"/document/sdk?from=20154\u0026from_column=20154"},{"iconName":"api","title":"API中心","desc":"API 助力快捷使用云产品","href":"/document/api?from=20154\u0026from_column=20154"},{"iconName":"tool","title":"命令行工具","desc":"可快速调用管理云资源","href":"/document/product/440/6176?from=20154\u0026from_column=20154"}]}],"activity-popup":{"mImgUrl":"https://qccommunity.qcloudimg.com/mp/images/11-11mobile.jpg","imgUrl":"https://qccommunity.qcloudimg.com/mp/images/11-11pc.jpg","beginTime":"2024/10/24 00:00:00","endTime":"2024/10/31 23:59:59"},"header-advertisement":{"imageUrl":"https://qccommunity.qcloudimg.com/image/2024-11-01-18-15.png","link":"https://cloud.tencent.com/act/pro/double11-2024?from=22374\u0026from_column=22374#miaosha"}},"isBot":false,"session":{"isLogined":false,"isQCloudLogined":false,"isQCommunityLogined":false,"isDifferentUin":false}}},"page":"/article/[articleId]","query":{"articleId":"2471010"},"buildId":"E1BjsJMhAQmac8QBO6qJ5","assetPrefix":"https://qccommunity.qcloudimg.com/community","isFallback":false,"gssp":true,"appGip":true,"scriptLoader":[]}</script></body></html>