当前位置:网站首页>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对象
边栏推荐
- [Li Kou brushing questions] one dimensional dynamic planning record (53 change exchanges, 300 longest increasing subsequence, 53 largest subarray and)
- @PathVariable
- 3D face reconstruction: from basic knowledge to recognition / reconstruction methods!
- Common English vocabulary that every programmer must master (recommended Collection)
- js通过数组内容来获取数组下标
- 【mysql】游标的基本使用
- 基于深度学习的参考帧生成
- [in depth learning] pytorch 1.12 was released, officially supporting Apple M1 chip GPU acceleration and repairing many bugs
- Interviewer: what is the internal implementation of ordered collection in redis?
- c#使用oracle存储过程获取结果集实例
猜你喜欢

愛可可AI前沿推介(7.6)

PHP saves session data to MySQL database

HMS core machine learning service creates a new "sound" state of simultaneous interpreting translation, and AI makes international exchanges smoother

Swagger UI教程 API 文档神器

The biggest pain point of traffic management - the resource utilization rate cannot go up

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

Summary of cross partition scheme

Internet News: Geely officially acquired Meizu; Intensive insulin purchase was fully implemented in 31 provinces

Interviewer: what is the internal implementation of ordered collection in redis?

ICML 2022 | Flowformer: 任务通用的线性复杂度Transformer
随机推荐
Aiko ai Frontier promotion (7.6)
968 edit distance
@PathVariable
Reviewer dis's whole research direction is not just reviewing my manuscript. What should I do?
每个程序员必须掌握的常用英语词汇(建议收藏)
js中,字符串和数组互转(一)——字符串转为数组的方法
Three schemes of SVM to realize multi classification
What are RDB and AOF
Reference frame generation based on deep learning
对话阿里巴巴副总裁贾扬清:追求大模型,并不是一件坏事
Web开发小妙招:巧用ThreadLocal规避层层传值
js 根据汉字首字母排序(省份排序) 或 根据英文首字母排序——za排序 & az排序
快过年了,心也懒了
Pat 1085 perfect sequence (25 points) perfect sequence
In JS, string and array are converted to each other (II) -- the method of converting array into string
启动嵌入式间:资源有限的系统启动
Nodejs tutorial let's create your first expressjs application with typescript
Dialogue with Jia Yangqing, vice president of Alibaba: pursuing a big model is not a bad thing
document.write()的用法-写入文本——修改样式、位置控制
Swagger UI教程 API 文档神器