当前位置:网站首页>记一次JAP查询导致OOM的问题分析
记一次JAP查询导致OOM的问题分析
2022-07-06 18:52:00 【码拉松】
背景
前段时间线上遇到OOM问题,经排查分析发现是由于有一个接口一次性返回的数据量过多导致(大约200W个结果集),不过对于问题接口数据量虽然较多,但返回的数据只有一个长度为7的string类型的字段,所以200W条大约也就十几M,这还不至于造成OOM。
具体分析
直接分析无法解释导致OOM的原因了,那只有模拟了,于是本地启了一 个接口模拟返回的数据量,发现内存消耗巨大,远远超过十几M,于是将堆内存导出来分析。
通过堆内存分析可以看出,原本7个字节的string类型,被包装成各种对象,并且被包装后占用空间剧增,最终达到1G多。
结论
最终由于JPA的各种对象封装产生了1G多的内存消耗,最终导致OOM。
所以,JPA虽然使用起来非常方便,但也正因如此,如果对其原理不了解,还是会踩不少坑的。
使用虽易,原理不易,且用且珍惜。
边栏推荐
- MySQL
- unity webgl自适应网页尺寸
- Summer Challenge database Xueba notes (Part 2)~
- Zhang Ping'an: accelerate cloud digital innovation and jointly build an industrial smart ecosystem
- [paper reading | deep reading] graphsage:inductive representation learning on large graphs
- The cities research center of New York University recruits master of science and postdoctoral students
- A new path for enterprise mid Platform Construction -- low code platform
- go swagger使用
- Argo workflows source code analysis
- MySQL
猜你喜欢
Processing image files uploaded by streamlit Library
3 -- Xintang nuc980 kernel supports JFFS2, JFFS2 file system production, kernel mount JFFS2, uboot network port settings, and uboot supports TFTP
This week's hot open source project!
【论文阅读|深读】ANRL: Attributed Network Representation Learning via Deep Neural Networks
Application analysis of face recognition
Infrared camera: juge infrared mag32 product introduction
go swagger使用
Integerset of PostgreSQL
argo workflows源码解析
Lumion 11.0 software installation package download and installation tutorial
随机推荐
PCL 常用拟合模型及使用方法
3--新唐nuc980 kernel支持jffs2, Jffs2文件系统制作, 内核挂载jffs2, uboot网口设置,uboot支持tftp
Halcon实例转OpenCvSharp(C# OpenCV)实现--瓶口缺陷检测(附源码)
[leetcode] day97 remove linked list elements
Argo workflows source code analysis
The boss is quarantined
Chang'an chain learning notes - certificate model of certificate research
The last line of defense of cloud primary mixing department: node waterline design
阿里云易立:云原生如何破解企业降本提效难题?
leetcode:736. LISP syntax parsing [flowery + stack + status enumaotu + slots]
ZABBIX 5.0: automatically monitor Alibaba cloud RDS through LLD
New generation cloud native message queue (I)
Increase 900w+ playback in 1 month! Summarize 2 new trends of top flow qiafan in station B
Metaforce force meta universe development and construction - fossage 2.0 system development
CDB PDB user rights management
MySQL
[paper reading | deep reading] graphsage:inductive representation learning on large graphs
Google Earth Engine(GEE)——Landsat 全球土地调查 1975年数据集
普通测试年薪15w,测试开发年薪30w+,二者差距在哪?
FLIR blackfly s usb3 industrial camera: how to use counters and timers