WildWolfBang edited a comment on issue #6703:
URL: https://github.com/apache/skywalking/issues/6703#issuecomment-815501380


   > I want to send a warning to your analysis, this graph shows, you used 409M 
memory for 8m SegmentRef instances. 
   
   
![image](https://user-images.githubusercontent.com/17874410/113977551-559ed400-9875-11eb-927f-d0bb266db0fb.png)
   
![image](https://user-images.githubusercontent.com/17874410/113976498-d0ff8600-9873-11eb-8ec1-1296fd987699.png)
   
     @wu-sheng Hi,I have noticed that "dominat_tree graph" shows `private 
List<TraceSegmentRef> refs` contains about 511360 entries in one TheadLocal, so 
I expand the "Class Name" until "java.lang.string" or "char[]" to confirm real 
memory,then it occurs "Shallow Heap" equals "Retained Heap". The list actually 
used about 356M in one TheadLocal.The situation is the same as other Dubbo 
threads that are sorted by percentage.
   The docs said `private List<TraceSegmentRef> refs` used to link multi 
parents trace segments, the segment faces hundreds of thousands of parents is 
unusual unless a loop occurs.
   
   ```
   public class TraceSegment {
       private String traceSegmentId;
       /**
        * The refs of parent trace segments, except the primary one. For most 
RPC call, {@link #refs} contains only one
        * element, but if this segment is a start span of batch process, the 
segment faces multi parents, at this moment,
        * we use this {@code #refs} to link them.
        * <p>
        * This field will not be serialized. Keeping this field is only for 
quick accessing.
        */
       private List<TraceSegmentRef> refs;
   ...
   }
   ```
   
   https://dzone.com/articles/eclipse-mat-shallow-heap-retained-heap
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to