当前位置:网站首页>记一次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虽然使用起来非常方便,但也正因如此,如果对其原理不了解,还是会踩不少坑的。
使用虽易,原理不易,且用且珍惜。
边栏推荐
- The empirical asset pricing package (EAP) can be installed through pypi
- fiddler的使用
- A new path for enterprise mid Platform Construction -- low code platform
- wzoi 1~200
- Use of fiddler
- STM32 project -- Topic sharing (part)
- [C # notes] reading and writing of the contents of text files
- Pioneer of Web3: virtual human
- 3 -- Xintang nuc980 kernel supports JFFS2, JFFS2 file system production, kernel mount JFFS2, uboot network port settings, and uboot supports TFTP
- CDB PDB 用户权限管理
猜你喜欢
[unity notes] screen coordinates to ugui coordinates
postgresql之整體查詢大致過程
Recommended collection!! Which is the best flutter status management plug-in? Please look at the ranking list of yard farmers on the island!
Integerset of PostgreSQL
低代码平台中的数据连接方式(上)
[paper reading | deep reading] graphsage:inductive representation learning on large graphs
FLIR blackfly s usb3 industrial camera: how to use counters and timers
1个月增长900w+播放!总结B站顶流恰饭的2个新趋势
Web3对法律的需求
15million employees are easy to manage, and the cloud native database gaussdb makes HR office more efficient
随机推荐
MFC Windows 程序设计[147]之ODBC数据库连接(附源码)
Infrared camera: juge infrared mag32 product introduction
postgresql之整體查詢大致過程
安德鲁斯—-多媒体编程
The mega version model of dall-e MINI has been released and is open for download
4 -- Xintang nuc980 mount initramfs NFS file system
Here comes a white paper to uncover the technology behind Clickhouse, a node with 10000 bytes!
unity中跟随鼠标浮动的面板,并可以自适应文字内容的大小
Google Earth Engine(GEE)——Landsat 全球土地调查 1975年数据集
Collection recommandée!! Quel plug - in de gestion d'état flutter est le plus fort? Regardez le classement des manons de l'île, s'il vous plaît!
C#/VB.NET 删除Word文檔中的水印
Rethinking of investment
Draco - gltf model compression tool
leetcode:5. Longest palindrome substring [DP + holding the tail of timeout]
pgpool-II和pgpoolAdmin的使用
argo workflows源码解析
Several classes and functions that must be clarified when using Ceres to slam
【Node学习笔记】chokidar模块实现文件监听
所谓的消费互联网仅仅只是做行业信息的撮合和对接,并不改变产业本身
unity webgl自适应网页尺寸