当前位置:网站首页>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对象
边栏推荐
- string的底层实现
- Forward maximum matching method
- In JS, string and array are converted to each other (II) -- the method of converting array into string
- MySQL - 事务(Transaction)详解
- Study notes of grain Mall - phase I: Project Introduction
- C # use Oracle stored procedure to obtain result set instance
- Data Lake (VIII): Iceberg data storage format
- Common English vocabulary that every programmer must master (recommended Collection)
- The difference between break and continue in the for loop -- break completely end the loop & continue terminate this loop
- 【mysql】触发器
猜你喜欢

The most comprehensive new database in the whole network, multidimensional table platform inventory note, flowus, airtable, seatable, Vig table Vika, flying Book Multidimensional table, heipayun, Zhix
![[Li Kou brushing questions] one dimensional dynamic planning record (53 change exchanges, 300 longest increasing subsequence, 53 largest subarray and)](/img/1c/973f824f061d470a4079487d75f0d0.png)
[Li Kou brushing questions] one dimensional dynamic planning record (53 change exchanges, 300 longest increasing subsequence, 53 largest subarray and)

Quick news: the flybook players' conference is held online; Wechat payment launched "education and training service toolbox"

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

ICML 2022 | Flowformer: 任务通用的线性复杂度Transformer

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

Fastjson parses JSON strings (deserialized to list, map)

Caching strategies overview
Why does MySQL index fail? When do I use indexes?

互联网快讯:吉利正式收购魅族;胰岛素集采在31省全面落地
随机推荐
Quick news: the flybook players' conference is held online; Wechat payment launched "education and training service toolbox"
[Li Kou brushing questions] one dimensional dynamic planning record (53 change exchanges, 300 longest increasing subsequence, 53 largest subarray and)
对话阿里巴巴副总裁贾扬清:追求大模型,并不是一件坏事
JS according to the Chinese Alphabet (province) or according to the English alphabet - Za sort &az sort
KDD 2022 | realize unified conversational recommendation through knowledge enhanced prompt learning
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
3D人脸重建:从基础知识到识别/重建方法!
Web开发小妙招:巧用ThreadLocal规避层层传值
js 根据汉字首字母排序(省份排序) 或 根据英文首字母排序——za排序 & az排序
[sliding window] group B of the 9th Landbridge cup provincial tournament: log statistics
How to implement common frameworks
KDD 2022 | 通过知识增强的提示学习实现统一的对话式推荐
js中,字符串和数组互转(一)——字符串转为数组的方法
El table table - get the row and column you click & the sort of El table and sort change, El table column and sort method & clear sort clearsort
Binary tree node at the longest distance
for循环中break与continue的区别——break-完全结束循环 & continue-终止本次循环
审稿人dis整个研究方向已经不仅仅是在审我的稿子了怎么办?
FZU 1686 龙之谜 重复覆盖
Interviewer: what is the internal implementation of ordered collection in redis?
Is this the feeling of being spoiled by bytes?