JVM系统相关

JVM系统属性(System.getProperty())和环境变量(System.getenv());

// 系统属性
  String javaVersion = System.getProperty("java.version");
  String javaVendor = System.getProperty("java.vendor");
  String javaVendorUrl = System.getProperty("java.vendor.url");
  String javaHome = System.getProperty("java.home");
  String javaVmSpecificationVersion =  System.getProperty("java.vm.specification.version");
  String javaVmSpecificationVendor = System.getProperty("java.vm.specification.vendor");
  String javaVmSpecificationName = System.getProperty("java.vm.specification.name");
  String javaVmVersion = System.getProperty("java.vm.version");
  String javaVmVendor = System.getProperty("java.vm.vendor");
  String javaVmName = System.getProperty("java.vm.name");
  String javaSpecificationVersion = System.getProperty("java.specification.version");
  String javaSpecificationVendor = System.getProperty("java.specification.vendor");
  String javaSpecificationName = System.getProperty("java.specification.name");
  String javaClassVersion = System.getProperty("java.class.version");
  String javaClassPath = System.getProperty("java.class.path");
  String javaLibraryPath = System.getProperty("java.library.path");
  String javaIoTmpdir = System.getProperty("java.io.tmpdir");
  String javaCompiler = System.getProperty("java.compiler");
  String javaExtDirs = System.getProperty("java.ext.dirs");
  String osName = System.getProperty("os.name");
  String osArch = System.getProperty("os.arch");
  String osVersion = System.getProperty("os.version");
  String fileSeparator = System.getProperty("file.separator");
  String pathSeparator = System.getProperty("path.separator");
  String lineSeparator = System.getProperty("line.separator");
  String userName = System.getProperty("user.name");
  String userHome = System.getProperty("user.home");
  String userDir = System.getProperty("user.dir");

  注解:

java.versionJava 运行时版本
java.homeJava 的安装目录
java.class.versionJava 类格式的版本号
java.class.pathJava 类的查找路径
java.io.tmpdir默认的临时目录
java.compilerJava 所使用的及时编译器
java.ext.dirsJava 扩展包的目录
os.name操作系统的名称
os.arch操作系统的体系结构
os.version操作系统的版本
file.separator文件分隔符(Unix 下为'/')
path.separator路径分隔符(Unix 下为':')
line.separator换行符(Unix 下为'/n')
user.name用户帐号名
user.home用户目录
user.dir

用户当前的工作目录

 

 

  • 取得操作系统的环境变量

注意,这次是获取操作系统的环境变量,而不是获取JVM相关的一些变量。
  也许是为了营造JVM就是操作系统平台的气氛,抑或是为了强调 Java的平台无关性,不知几时起Java已经把System.getenv(String)函数废弃了。所以一般来说Java只能获取它自己定义的一些 变量,而无法与操作系统的环境变量交互,只能在运行靠java的“-D”参数来设置要传递给它的一些变量。
  所以唯一的办法只能先判断操作系统,然后用操作系统的命令来调出环境变量列表,设法获得该输出列表。

  • 代码实现

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;

public class SystemValue {
 /**
  * 使用System获取系统相关的值
  */
 public static void getSystemProperties() {
  Properties pp = System.getProperties();
  System.out.println("System's Properties:");
  System.out.println();
  java.util.Enumeration en = pp.propertyNames();
  while (en.hasMoreElements()) {
   String nextE = (String) en.nextElement();
   System.out.print(nextE + "=" + pp.getProperty(nextE));
   System.out.println();
  }
 }

 public static void getCustomProperties(String key) {
  Map map = getEnv();
  System.out.println(key + "=" + map.get(key));
 }

 public static Map getEnv() {
  Map map = new HashMap();
  Process p = null;
  Runtime r = Runtime.getRuntime();
  String OS = System.getProperty("os.name").toLowerCase();
  System.out.println("OS="+OS);
  try {
   if (OS.indexOf("windows 9") > -1) {
    p = r.exec("command.com /c set");
   } else if ((OS.indexOf("nt") > -1)
     || (OS.indexOf("windows 20") > -1)
     || (OS.indexOf("windows xp") > -1)) {
    p = r.exec("cmd.exe /c set");
   } else {
    // Unix
    p = r.exec("env");
   }
   BufferedReader br = new BufferedReader(new InputStreamReader(p
     .getInputStream()));
   String line;
   while ((line = br.readLine()) != null) {
    String[] str = line.split("=");
    map.put(str[0], str[1]);
   }
  } catch (IOException ioe) {
   ioe.printStackTrace();
  }
  return map;
 }

 public static void main(String[] args) {
  // getSystemProperties();
  getCustomProperties("JAVA_HOME");
 }
}

获取Java虚拟机(JVM)和操作系统相关信息 在Java编程中,有时候我们需要获取关于Java虚拟机(JVM)和操作系统的信息,例如获取JVM的版本、获取操作系统的类型等。方法,我们可以方便地获取JVM和操作系统的相关信息。运行上述代码,将输出当前操作系统的类型,例如Windows、Linux等。运行上述代码,将输出当前操作系统的架构信息,例如x86、x86_64等。运行上述代码,将输出当前操作系统的版本信息。运行上述代码,将输出当前JVM的版本信息。要获取操作系统的版本信息,可以使用。要获取操作系统的架构信息,可以使用。 阅读详情

相关推荐

windows的rancherDesktop修改镜像源

Rancher Desktop中的“Allowed Images”功能(通常在 Preferences -> Container Engine -> Allowed Images 中找到)是用来定义一个允许拉取和推送的镜像列表的规则,例如,只允许从您组织或特定的受信任的仓库中获取镜像。如果问题依旧,请提供您Rancher Desktop的版本和当前选择的容器运行时,以便进一步协助。总结一下,对于Windows上的Rancher Desktop,如果您使用默认的。,镜像源的配置通常通过一个名为。

zwjapple的专栏 2700

Java虚拟机JVM参数以及JDK属性

JVM 1.jvm内存参数 参数说明-Xms3550m设置JVM初始堆内存为3550M。此值可以设置与-Xmx相同,以避免每次垃圾回收完成后JVM重新分配内存-Xmx3550m设置JVM最大堆内存为3550M。-Xss128k设置每个线程的栈大小。JDK5.0以后每个线程栈大小为1M,之前每个线程栈大小为256K。应当根据应用的线程所需内存大小进行调整。在相同物理内存下,减小这个值能生成更多的线程...

qq_42513284的博客 372

tesseract-ocr的字库学习步骤(训练自己的文库),关于ocr的对图片的解析,包括tesseract的安装(史上最全)

tesseract-ocr的字库学习步骤(训练自己的文库) 简介:在网上看了很多案列。都不是很完整。然后自己用了一天时间进行整理,第一次写文章,希望对大家有帮助。 一、安装tesseract 下载地址https://github.com/UB-Mannheim/tesseract/wiki 1.点击下面下载的这个进行运行(安装的时候有点慢) 2.点击next 3.I accept the terms of the License Agreement前的复选框打勾,点击Next。 4.Install f

HAC12的博客 2229

jvm中的一些系统属性值

java 开发过程中的一些常用属性值 package com.iflytek.zhangh; /** * System.getProperty 的常用值 * @author Administrator * */ public class SystemProperyTest { public static void main(String[] args) { ...

forever_insist的博客 415

Linux与Windows双系统,安装完linux后无法通过grub进入Windows的解决方法

先装Windows 10,Windows可正常启动,再装Kali,Kali提示装grub后照装。然而装完后重启发现无Windows选项。

sakurashockwave的博客 6455

MATLAB实战:手把手教你实现WVD信号分析(附完整代码与避坑指南)

本文通过MATLAB实战,手把手教你实现Wigner-Ville分布(WVD)信号分析。文章提供了从零构建WVD函数的完整代码,并重点解析了使用解析信号、处理交叉项、优化计算效率等关键避坑指南,帮助工程师高效处理非平稳信号,获得高分辨率的时频分析结果。

purple的博客 1083

「JVM」知识点详解一:JVM运行原理详解

JVM是Java Virtual Machine(Java虚拟机)的缩写,是通过在实际的计算机上仿真模拟各种计算机功能来实现的。由。

2401_85763843的博客 1333

Ansys Lumerical | 薄膜铌酸锂电光调制器的仿真与优化

本文详细介绍了使用Ansys Lumerical进行薄膜铌酸锂电光调制器仿真与优化的全流程。从基础原理到电学仿真、光学模拟技巧,再到设计优化实战经验,帮助工程师掌握这一先进光电器件的仿真方法。重点解析了薄膜铌酸锂的Pockels效应和Mach-Zehnder结构设计,并提供了常见问题排查指南和最新发展动态。

vulkan6gpu的博客 1200

JVM系统梳理

目录 一、内存区域 1.方法区 2.堆 3.程序计数器 4.Java 虚拟机栈 5.本地方法栈 6.直接内存 7.运行时常量池 二、类加载机制 1.类的生命周期 1.1加载 1.2验证 1.3.准备 1.4解析 一、内存区域 1.方法区 用于存放已被加载的类信息、常量、静态变量、即时编译器编译后的代码等数据。 和堆一样不需要连续的内存,并且可以动态扩展,动态扩展失败一样会抛出 OutOfMemoryError 异常。对这块区域进行垃圾...

hz123218的博客 641

DPABI实战:手把手教你处理小鼠静息态fMRI数据(从Voxel Size到SPM完整流程)

本文详细介绍了使用DPABI处理小鼠静息态fMRI数据的完整流程,从Voxel Size调整到SPM分析,涵盖预处理、质量控制和可视化等关键步骤。针对小鼠数据特有的低分辨率和信噪比问题,提供了实战建议和避坑指南,帮助研究人员高效完成数据分析。

weixin_42663213的博客 480

告别测序污染:手把手教你用Decontam+SCRUB+FEAST完成微生物组数据清洗全流程

本文详细解析了使用Decontam、SCRUB和FEAST三大工具完成微生物组数据清洗的全流程。从环境准备、数据导入到污染物识别、样本间污染校正及溯源分析,提供了一套可复用的污染校正工作流,帮助研究者提升数据质量,确保后续分析的可靠性。

weixin_33462927的博客 317

jvm学习笔记--基本结构

主要来学习jvm的基本结构 知识点1:什么是java虚拟机(你以为你知道,如果你看我下面的例子,你会发现你其实不知道) 第一步:先来写一个类: [code="java"] package test; public class JVMTestForJava { public static void main(String[] args) thro...

yangdingcai的专栏 655

CMOS图像传感器——工作原理

CMOS图像传感器的曝光与读出

沧海一升的博客 9460

java运行时获取系统参数cup、jvm、磁盘、內存、服务器相关信息

java运行时获取系统参数cup、jvm、磁盘、內存、服务器相关信息 <!-- 获取系统信息 --> <dependency> <groupId>com.github.oshi</groupId> <artifactId>oshi-core</a...

weixin_39249427的博客 1436

jre9下载 jdk9

(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】

大中型超市收银系统(可直接运行)

光步前台收银系统系统功能:商品销售、商品退货、挂单、收银员权限、会员销售、单品取消、整单取消、商品查询、脱机销售、脱机数据上传,基本资料下载,开钱箱、小票打印、收款结算,支持多币种付款方式(现金、储值卡、礼券、微信等),支持多种促销。运行环境:.net 4.0登陆信息用户名:1001 密码:123456内置商品信息,商品编码可输入00001000 - 00010000,测试效果相关功能键F5 结算 F9挂单 F11商品查询 F8退货 Insert单品取消 Del整单取消 F12开钱箱F2 会员 Ctrl+Z退出系统 Home 锁屏 相关源码待公开

JAVA获取jvm和操作系统相关信息

今日搬砖🧱时需要获取系统运行时间、版本号等相关信息,使用Java自带的类进行获取系统运行的相关信息,在这整理记录分享一下,感兴趣的小伙伴可以自己尝试尝试。首先获取jvm相关信息,包含jvm的名称、版本号、启动时间、运行时间、环境变量、进程id等等。包含jdk的版本、安装路径、当前运行jar包路径、运行jar文件名等。获取java虚拟机线程信息,包含线程的阻塞时间、次数、线程的堆栈信息等等。获取操作系统以及主机硬件信息,包含系统名称、版本、物理内存、可用内存等等。还可以获取JVM内存相关信息,例如堆内存。

胥平勇的博客 992

精雕软件(JDpaint) 5.5 绿色版

精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版

JDK获取操作系统和JVM相关信息

使用System.getProperty()方法获取JVM信息 public class TestSystemGetProperty { public static void main(String[] args) { System.out.println("java版本号:" + System.getProperty("java.version")); System.out.println("Java提供商名称:" + System.getP.

629

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

【JVM系统学习之路】垃圾回收相关算法

JVM系统学习之路系列演示代码地址: https://github.com/mtcarpenter/JavaTutorial 目录 标记阶段:引用计数算法 标记阶段:可达性分析算法 对象的 finalization 机制 MAT 与 Jprofilter 的 GC Roots 溯源 清除阶段: 标记-清除算法 清除阶段:复制算法 清除阶段:标记-压缩算法 小结 分代收集算法 标记阶段:引用计数算法 垃圾标记阶段:对象存活判断 在堆里存放着几乎所有的 Java 对象实例,在 GC 执行垃圾回收之前,.

havendream的博客 219

【JVM系统学习之路】垃圾回收相关概念

JVM系统学习之路系列演示代码地址: https://github.com/mtcarpenter/JavaTutorial 目录 System.gc() 的理解 内存溢出与内存泄漏 Stop the world 垃圾回收的并行与并发 安全点与安全区域 再谈引用 再谈引用:强引用 再谈引用:软引用 再谈引用:弱引用 再谈引用:虚引用 再谈引用:终结器引用 System.gc() 的理解 在默认情况下,通过 system.gc() 或者 Runtime.getRuntime().gc() 的调用,会.

havendream的博客 367

调用串口会造成jvm崩溃吗_【JVM系统学习之路】垃圾回收相关概念

JVM系统学习之路系列演示代码地址:https://github.com/mtcarpenter/JavaTutorial目录System.gc() 的理解内存溢出与内存泄漏Stop the world垃圾回收的并行与并发安全点与安全区域再谈引用再谈引用:强引用再谈引用:软引用再谈引用:弱引用再谈引用:虚引用再谈引用:终结器引用System.gc() 的理解在默认情况下,通过 syste...

weixin_39544333的博客 96

Java输出JVM和操作系统的相关属性

主要是利用Java提供的util包中的Properties类。废话不多说,直接看代码:import java.util.*;public class YourJavaProperties { public static void main(String args[]){ Properties props=System.getProperties(); Syst

Justin的专栏 1692

JVM虚拟机系统性学习-JVM相关工具jps、jstat、jinfo、jmap、jhat和jstack

jhat 命令会解析 Java 堆转储文件,并且启动一个 web server,再用浏览器就可以查看 dump 出来的 heap 二进制文件。用于生成 Java 虚拟机当前时刻的线程快照,生成线程快照的主要目的是定位线程出现长时间停顿的原因。查看 Java 程序运行时相关信息,可以查看运行时堆的相关情况。命令,就可以启动一个 web server,用浏览器访问即可。查看堆内存使用情况,一般结合 jhat 使用。查看正在运行的 Java 程序的扩展参数。可以在 jvm 运行时获取 dump。

qq_45260619的博客 1117

【转】Java输出JVM和操作系统的相关属性

主要是利用Java提供的util包中的Properties类。废话不多说,直接看代码:import java.util.*; public class YourJavaProperties { public static void main(String args[]){ Properties props=System.getProperties(); System.out.println("

AlphaHinex的专栏 618

002 Java 的平台无关性是因为JVM屏蔽了与具体操作系统平台相关的信息

1.java是一种技术 说起Java,人们首先想到的是Java编程语言,然而事实上,Java是一种技术,它由四方面组成:Java编程语言、Java类文件格式、Java虚拟机和Java应用程序接口(Java API)。它们的关系如下图所示: 运行期环境代表着Java平台,开发人员编写Java代码(.java文件),然后将之编译成字节码(.class文件),JVM才能识别并运行它,JVM针对每个操作系统开发其对应的解释器,所以只要其操作系统有对应版本的JVM,那么这份Java编译后的代码就能够运行起来,

从2026-09-21开始专注于AI,以前是后端研发、大数据研发等 454

JVM系统自学笔记5--垃圾回收算法、分代回收、相关配置参数

一、回收算法 1、标记清除 速度较快 会造成内存碎片化 2、标记整理 速度慢 不会有内存碎片 3、复制 不会有内存碎片 需要占用双倍内存空间 4、总结 复制算法回收速度与存活对象数量相关,数量越少,速度越快,如果存活对象过多,速度可能会比标记整理速度要慢。 实际JVM垃圾回收是根据情况配合三种算法使用,因为三种算法都有其实用的场景。 二、分代回收 对象首先分...

QilanAllen的博客 277

arthas之jvm相关命令

arthas之jvm相关命令

兮动人 1761
上一篇: 为Struts 2应用程序创建进度条(等待页面)
下一篇: 教程中心
programloverjack
博客等级 码龄17年 5粉丝 252原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值