当前位置:网站首页>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对象
边栏推荐
- Thinking about agile development
- 【力扣刷题】32. 最长有效括号
- 039. (2.8) thoughts in the ward
- Vim 基本配置和经常使用的命令
- 通过数字电视通过宽带网络取代互联网电视机顶盒应用
- After working for 5 years, this experience is left when you reach P7. You have helped your friends get 10 offers
- js中,字符串和数组互转(一)——字符串转为数组的方法
- 基于深度学习的参考帧生成
- Pat 1085 perfect sequence (25 points) perfect sequence
- C # use Oracle stored procedure to obtain result set instance
猜你喜欢

袁小林:安全不只是标准,更是沃尔沃不变的信仰和追求

快讯:飞书玩家大会线上举行;微信支付推出“教培服务工具箱”

3D face reconstruction: from basic knowledge to recognition / reconstruction methods!

每个程序员必须掌握的常用英语词汇(建议收藏)

Study notes of grain Mall - phase I: Project Introduction

None of the strongest kings in the monitoring industry!

Summary of cross partition scheme

HMS Core 机器学习服务打造同传翻译新“声”态,AI让国际交流更顺畅

039. (2.8) thoughts in the ward

966 minimum path sum
随机推荐
Divide candy
ROS error: could not find a package configuration file provided by "move_base“
document. Usage of write () - write text - modify style and position control
【mysql】触发器
20220211 failure - maximum amount of data supported by mongodb
How do I remove duplicates from the list- How to remove duplicates from a list?
R3live notes: image processing section
Set up a time server
Deployment of external server area and dual machine hot standby of firewall Foundation
Tips for web development: skillfully use ThreadLocal to avoid layer by layer value transmission
Quick access to video links at station B
OSPF multi zone configuration
Why do job hopping take more than promotion?
Math symbols in lists
[sliding window] group B of the 9th Landbridge cup provincial tournament: log statistics
string的底层实现
Redistemplate common collection instructions opsforzset (VI)
C # use Oracle stored procedure to obtain result set instance
Absolute primes (C language)
Is this the feeling of being spoiled by bytes?