您的位置:首页 > 教育 > 锐评 > 福田庆三明星案例_90设计下载后怎么用_网站排名优化推广_百度指数的数据怎么导出

福田庆三明星案例_90设计下载后怎么用_网站排名优化推广_百度指数的数据怎么导出

2025/2/23 21:19:08 来源:https://blog.csdn.net/qq_44289784/article/details/142902603  浏览:    关键词:福田庆三明星案例_90设计下载后怎么用_网站排名优化推广_百度指数的数据怎么导出
福田庆三明星案例_90设计下载后怎么用_网站排名优化推广_百度指数的数据怎么导出

一. JVM架构

在这里插入图片描述

二. 运行时数据区

在这里插入图片描述

PC寄存器

在这里插入图片描述
在这里插入图片描述

Java栈

在这里插入图片描述
在这里插入图片描述

Java堆(❤❤❤)

在这里插入图片描述

方法区

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

三. Java堆内存(❤❤❤)

在这里插入图片描述

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

在这里插入图片描述
在这里插入图片描述

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

在这里插入图片描述
在这里插入图片描述

四. 实战_Java内存分配参数(❤❤❤)

日志

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

Java堆的参数

Xms:初始堆大小

官网文档

-Xms size
Sets the minimum and initial size (in bytes) of the heap. This value must be a multiple of 1024 and greater than 1 MB. Append the letter k or K to indicate kilobytes, m or M to indicate megabytes, g or G to indicate gigabytes. The following examples show how to set the size of allocated memory to 6 MB using various units:
-Xms6291456
-Xms6144k
-Xms6m
Instead of the -Xms option to set both the minimum and initial size of the heap, you can use -XX:MinHeapSize to set the minimum size and -XX:InitialHeapSize to set the initial size.
If you don’t set this option, the initial size is set as the sum of the sizes allocated for the old generation and the young generation. The initial size of the heap for the young generation can be set using the -Xmn option or the -XX:NewSize option.

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
Runtime 类 freeMemory,totalMemory,maxMemory 介绍
在这里插入图片描述

public class RuntimePrac {public static void main(String[] args) {printRuntime();byte[] b1 = new byte[3 * 1024 * 1024];printRuntime();byte[] b2 = new byte[4 * 1024 * 1024];printRuntime();}private static void printRuntime() {System.out.println("java虚拟机从操纵系统那里挖到的最大的内存   maxMemory " + Runtime.getRuntime().maxMemory() / 1024 / 1024 + "M");System.out.println("java虚拟机已经从操作系统那里挖过来的内存   totalMemory : " + Runtime.getRuntime().totalMemory() / 1024 / 1024 + "M");System.out.println("java虚拟机从操纵系统挖过来还没用上的内存   freeMemory : " + Runtime.getRuntime().freeMemory() / 1024 / 1024 + "M");System.out.println("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");}
}

在这里插入图片描述
在这里插入图片描述

Xmx

-Xmx size
Specifies the maximum size (in bytes) of the heap. This value must be a multiple of 1024 and greater than 2 MB. Append the letter k or K to indicate kilobytes, m or M to indicate megabytes, or g or G to indicate gigabytes. The default value is chosen at runtime based on system configuration. For server deployments, -Xms and -Xmx are often set to the same value. The following examples show how to set the maximum allowed size of allocated memory to 80 MB using various units:
-Xmx83886080
-Xmx81920k
-Xmx80m
The -Xmx option is equivalent to -XX:MaxHeapSize.

在这里插入图片描述

idea设置内存

在这里插入图片描述

第一种

在这里插入图片描述

第二种
-XX:MinHeapSize:最小堆内存
-XX:InitialHeapSize:初始堆内存
-XX:MaxHeapSize:最大堆内存

MaxHeapSize>=InitialHeapSize>=MinHeapSize

在这里插入图片描述

Xmn

在这里插入图片描述

-Xmn size
Sets the initial and maximum size (in bytes) of the heap for the young generation (nursery) in the generational collectors. Append the letter k or K to indicate kilobytes, m or M to indicate megabytes, or g or G to indicate gigabytes. The young generation region of the heap is used for new objects. GC is performed in this region more often than in other regions. If the size for the young generation is too small, then a lot of minor garbage collections are performed. If the size is too large, then only full garbage collections are performed, which can take a long time to complete. It is recommended that you do not set the size for the young generation for the G1 collector, and keep the size for the young generation greater than 25% and less than 50% of the overall heap size for other collectors. The following examples show how to set the initial and maximum size of young generation to 256 MB using various units:
-Xmn256m
-Xmn262144k
-Xmn268435456
Instead of the -Xmn option to set both the initial and maximum size of the heap for the young generation, you can use -XX:NewSize to set the initial size and -XX:MaxNewSize to set the maximum size.

--------------------------------------------------------

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com