当前位置:网站首页>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对象
边栏推荐
- Reference frame generation based on deep learning
- JS operation DOM element (I) -- six ways to obtain DOM nodes
- 【滑动窗口】第九届蓝桥杯省赛B组:日志统计
- Nodejs tutorial let's create your first expressjs application with typescript
- @PathVariable
- Math symbols in lists
- 分糖果
- el-table表格——sortable排序 & 出现小数、%时排序错乱
- MySQL - 事务(Transaction)详解
- Study notes of grain Mall - phase I: Project Introduction
猜你喜欢

【论文解读】用于白内障分级/分类的机器学习技术

This year, Jianzhi Tencent

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

Data Lake (VIII): Iceberg data storage format

LLVM之父Chris Lattner:为什么我们要重建AI基础设施软件

【力扣刷题】32. 最长有效括号

【mysql】触发器

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

Why do job hopping take more than promotion?

Caching strategies overview
随机推荐
js中,字符串和数组互转(一)——字符串转为数组的方法
KDD 2022 | 通过知识增强的提示学习实现统一的对话式推荐
快讯:飞书玩家大会线上举行;微信支付推出“教培服务工具箱”
None of the strongest kings in the monitoring industry!
Seven original sins of embedded development
OneNote in-depth evaluation: using resources, plug-ins, templates
Is this the feeling of being spoiled by bytes?
JS operation DOM element (I) -- six ways to obtain DOM nodes
Binary tree node at the longest distance
字符串的使用方法之startwith()-以XX开头、endsWith()-以XX结尾、trim()-删除两端空格
【深度学习】PyTorch 1.12发布,正式支持苹果M1芯片GPU加速,修复众多Bug
Dialogue with Jia Yangqing, vice president of Alibaba: pursuing a big model is not a bad thing
Z function (extended KMP)
3D face reconstruction: from basic knowledge to recognition / reconstruction methods!
Study notes of grain Mall - phase I: Project Introduction
分糖果
【力扣刷题】32. 最长有效括号
js 根据汉字首字母排序(省份排序) 或 根据英文首字母排序——za排序 & az排序
C # use Oracle stored procedure to obtain result set instance
愛可可AI前沿推介(7.6)