kangkaisen commented on pull request #4135:
URL: https://github.com/apache/incubator-doris/pull/4135#issuecomment-662418107


   > > Hello, I have two questions to ask。
   > > 
   > > 1. shared ptr use for avoid memory leaks. but at the same time, it 
brings about several problems:
   > >    (1)There are additional costs of ref count of ptr
   > >    (2)  The interface becomes infectious
   > >    So Is it good enough to do this replacement of shared_ptr ? what 
benefit us?
   > > 2. `unique_ptr` runtime expenses is close to the raw pointer and it's 
simple enough to use。
   > >    In most cases, should we replacing it with `shared_prt`.
   > 
   > As metioned in the first comment, this pr is for showing all MemTracker on 
BE's website #3714 , like kudu. So we need to make all MemTrackers not owned by 
anyone. If we get it `on web`, it shouldn't be destoryed with the obj which 
created it.
   
   So the mainly reason use `shared_prt ` is only to show MemTracker on website?


----------------------------------------------------------------
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:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to