当前位置:网站首页>记一次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虽然使用起来非常方便,但也正因如此,如果对其原理不了解,还是会踩不少坑的。
使用虽易,原理不易,且用且珍惜。
边栏推荐
- Compress JS code with terser
- 遇到慢SQL该怎么办?(下)
- Why am I warned that the 'CMAKE_ TOOLCHAIN_ FILE' variable is not used by the project?
- 慧通编程入门课程 - 2A闯关
- ZABBIX 5.0: automatically monitor Alibaba cloud RDS through LLD
- Tips for web development: skillfully use ThreadLocal to avoid layer by layer value transmission
- Integerset of PostgreSQL
- [Mori city] random talk on GIS data (II)
- Recommended collection!! Which is the best flutter status management plug-in? Please look at the ranking list of yard farmers on the island!
- wzoi 1~200
猜你喜欢

Web3对法律的需求

Go swagger use

Alibaba cloud middleware open source past

3 -- Xintang nuc980 kernel supports JFFS2, JFFS2 file system production, kernel mount JFFS2, uboot network port settings, and uboot supports TFTP
![[paper reading | deep reading] dngr:deep neural networks for learning graph representations](/img/8e/41a80131c6ec7a7cdffe4a77012fed.png)
[paper reading | deep reading] dngr:deep neural networks for learning graph representations
![[paper reading | deep reading] graphsage:inductive representation learning on large graphs](/img/fe/3d4ccfa79a9624ac4901feeea1e69f.png)
[paper reading | deep reading] graphsage:inductive representation learning on large graphs

建議收藏!!Flutter狀態管理插件哪家强?請看島上碼農的排行榜!

Web3的先锋兵:虚拟人

postgresql之integerset

软件测试——Jmeter接口测试之常用断言
随机推荐
Decryption function calculates "task state and lifecycle management" of asynchronous task capability
Rethinking of investment
3--新唐nuc980 kernel支持jffs2, Jffs2文件系统制作, 内核挂载jffs2, uboot网口设置,uboot支持tftp
C#/VB.NET 删除Word文档中的水印
3 -- Xintang nuc980 kernel supports JFFS2, JFFS2 file system production, kernel mount JFFS2, uboot network port settings, and uboot supports TFTP
GEE升级,可以实现一件run tasks
你不可不知道的Selenium 8种元素定位方法,简单且实用
Infrared camera: juge infrared mag32 product introduction
15million employees are easy to manage, and the cloud native database gaussdb makes HR office more efficient
一本揭秘字节万台节点ClickHouse背后技术实现的白皮书来了!
Freeswitch dials extension number source code tracking
#夏日挑战赛#数据库学霸笔记(下)~
Lombok同时使⽤@Data和@Builder 的坑
慧通编程入门课程 - 2A闯关
Here comes a white paper to uncover the technology behind Clickhouse, a node with 10000 bytes!
Apifox,你的API接口文档卷成这样了吗?
用全连接+softmax对图片的feature进行分类
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!
leetcode:736. Lisp 语法解析【花里胡哨 + 栈 + 状态enumaotu + slots】
[paper reading | deep reading] graphsage:inductive representation learning on large graphs