当前位置:网站首页>jvm:大对象在老年代的分配
jvm:大对象在老年代的分配
2022-07-06 13:10:00 【amadeus_liu2】
一、需要指定2个jvm参数:
-XX:PretenureSizeThreshold=字节数
-XX:+UserSerialGC
完整参数如下:
-Xms20m
-Xmx20m
-verbose:gc
-Xmn10m
-XX:+PrintGCDetails
-XX:SurvivorRatio=8
-XX:+UseSerialGC
-XX:PretenureSizeThreshold=4000000
程序代码:
package com.example.app;
public class GcTest2 {
public static void main(String[] args) {
int size = 1024 * 1024;
byte[] bytes=new byte[5*size];
}
}
运行结果

可以看到老年代使用了5M,即为bytes对象
边栏推荐
- Pat 1078 hashing (25 points) ⼆ times ⽅ exploration method
- 数据湖(八):Iceberg数据存储格式
- First batch selected! Tencent security tianyufeng control has obtained the business security capability certification of the ICT Institute
- How to implement common frameworks
- Forward maximum matching method
- JS学习笔记-OO创建怀疑的对象
- el-table表格——获取单击的是第几行和第几列 & 表格排序之el-table与sort-change、el-table-column与sort-method & 清除排序-clearSort
- 代理和反向代理
- Pat 1085 perfect sequence (25 points) perfect sequence
- Replace Internet TV set-top box application through digital TV and broadband network
猜你喜欢

【mysql】触发器

审稿人dis整个研究方向已经不仅仅是在审我的稿子了怎么办?

Aiko ai Frontier promotion (7.6)

Deployment of external server area and dual machine hot standby of firewall Foundation

Study notes of grain Mall - phase I: Project Introduction

None of the strongest kings in the monitoring industry!

面试官:Redis中有序集合的内部实现方式是什么?

Four common ways and performance comparison of ArrayList de duplication (jmh performance analysis)

3D人脸重建:从基础知识到识别/重建方法!
![[redis design and implementation] part I: summary of redis data structure and objects](/img/2e/b147aa1e23757519a5d049c88113fe.png)
[redis design and implementation] part I: summary of redis data structure and objects
随机推荐
Divide candy
Acdreamoj1110 (multiple backpacks)
在最长的距离二叉树结点
Why does MySQL index fail? When do I use indexes?
防火墙基础之外网服务器区部署和双机热备
2022 fields Award Announced! The first Korean Xu Long'er was on the list, and four post-80s women won the prize. Ukrainian female mathematicians became the only two women to win the prize in history
Swagger UI tutorial API document artifact
ICML 2022 | Flowformer: 任务通用的线性复杂度Transformer
SDL2来源分析7:演出(SDL_RenderPresent())
Manifest of SAP ui5 framework json
Proxy and reverse proxy
Introduction to the use of SAP Fiori application index tool and SAP Fiori tools
Nodejs tutorial expressjs article quick start
如何实现常见框架
JS operation DOM element (I) -- six ways to obtain DOM nodes
JS学习笔记-OO创建怀疑的对象
3D人脸重建:从基础知识到识别/重建方法!
The biggest pain point of traffic management - the resource utilization rate cannot go up
Reflection operation exercise
Sdl2 source analysis 7: performance (sdl_renderpresent())