支持查看对象占用的堆空间大小(Shallow or Retained)
- Dominant language
- Java
- Stars
- 37.5k
- Forks
- 7.6k
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 4
Description
在排查内存泄漏的问题时,特别想知道对象占用的size,比如Map或者复杂对象,这时候没有一个很好的工具查看,希望能支持查看特定对象占用的堆大小(Shallow or Retained)。
实现效果上类似[Java Object Layout (JOL)](https://github.com/openjdk/jol)这个工具:
```
Offset@3e6e0458d footprint:
COUNT AVG SUM DESCRIPTION
7897 77 608128 [C
844 115 97280 [Ljava.util.HashMap$Node;
7898 24 189552 com.dianping.cat.consumer.transaction.TransactionDelegate$Offset
7897 24 189528 java.lang.String
844 48 40512 java.util.HashMap
7897 32 252704 java.util.HashMap$Node
33277 1377704 (total)
```
如果可以添加这个功能 我可以提交一个pr
Contributor guide
Research direction
The issue requests object heap-size inspection with shallow or retained sizing, similar to Java Object Layout (JOL), but names no files, tests, or entry points. Start by locating the existing object-inspection or memory-diagnosis functionality and define how a selected object should be measured; done means reporting its requested heap size reliably for simple and complex objects.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- devtools
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100