memory - Hazelcast Client Memory Leak
问题描述
We have Spring Boot 2.0.4 application. We use distributed Hazelcast 3.11 cache. In our application we configured HazelcastClient which connects to a Hazelcast server in Docker container.
In cache we store different "persons" in one map and the same "persons" but as a list in another (~900 persons in one list by one key; these persons in both maps are not the same for 100%, they both describe the person in real life but the last one in the list have less properties.). All the maps are of BINARY type.
When we made stress tests to get person by random id from the cache (1st map), everything went excellent. 5000 concurrent requests didn't influence our application HEAP at all, 10000 - slightly. In JSON format one person details has the size of 10kB.
When we made stress tests to get the list of persons from the cache (2nd map) we faced problems with the HEAP of our application where the client is configured. We made just 500 concurrent requests and the HEAP grew to 4Gb size! In JSON format the list has the size of 800kB. It is stored in the 2nd map and was requested by the same key 500 times.
Does anybody know what is going on?
HazelcastInstance configuration
hazelcast.xml configuration for the server side
500 concurrent requests (3 times in a row)
UPDATED:
I made 500 concurrent requests sequentially 23 times. Below we can see the final minutes of the test.
解决方案
@Nicolay,如果我错了,请纠正我:
第二张地图包含人员列表,约 900 人,作为条目。您提到每个人约为 10KB,因此第二张地图中的每个条目约为 9MB,即使您说它是 Json 格式的 800KB。您能否通过 Hazelcast 检查第二张地图中条目的大小。喜欢:
client.getMap(map_name).getEntryView(key).getCost()
。这将为您提供以字节为单位的入口内存成本。500 个并发请求,如果每个条目约为 9MB,则需要 4.5GB 额外堆,这与您观察到的相符。
通过查看数字,一切似乎都很好,除了 Json 大小为 800KB。
你能检查那些数字吗?
推荐阅读
- javascript - 使用 Async 和 MongoDb 按顺序填充集合文档
- android - 房间查询:在列表中查找总是返回 null
- ffmpeg - 解码/编码 mp4 视频时丢弃 P 帧
- python - python:读取内联标签txt文件并将其格式化为列
- microsoft-cognitive - 如何通过发送到认知服务来防止保留或重复使用数据?
- c# - 我需要有关功能的帮助
- c# - C# SetWinEventHook 在鼠标移动时停止发送消息
- html - 替代样式表未显示在 Firefox 的“查看 > 页面样式”下
- powershell - 如何混合编码和非编码脚本?
- python - 如何使用pymysql在python中将NULL插入日期时间