Adar Dembo has posted comments on this change.

Change subject: KUDU-1931: fix SIGSEGV in file cache 
RandomAccessFile::memory_footprint()
......................................................................


Patch Set 1:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/6359/1/src/kudu/util/file_cache.cc
File src/kudu/util/file_cache.cc:

PS1, Line 350: // Some anecdotal memory measurements taken inside gdb:
             :     // - glibc 2.23 malloc_usable_size() on 
make_shared<FileType>: 88 bytes.
             :     // - tcmalloc malloc_usable_size() on make_shared<FileType>: 
96 bytes.
             :     // - sizeof(std::shared_ptr::_Sp_counted_base): 16 bytes.
             :     // - sizeof(*this): 72 bytes.
> that's a fair argument. also technically that measurement doesn't belong he
If you look at some other accounted objects, you'll see that they either expose 
a single memory_footprint() method, or two 
memory_footprint_{including,excluding}_this() methods. The sole 
memory_footprint() is the same memory_footprint_including_this(), and implies 
that the class is always heap allocated and is behind a shared_ptr, unique_ptr, 
or raw pointer.

That's the convention we've been following, loosely inspired by how Firefox 
accounts for its memory consumption. It works, but it's brittle, as the methods 
need to change if:
1. The class allocation scheme changes, or
2. The class gains a new heap allocated subobject.

Anyway, I didn't understand part of your last comment: what exactly did you 
want me to note?


-- 
To view, visit http://gerrit.cloudera.org:8080/6359
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I9e57c06dd35252d03729c10ff64fe43d79288513
Gerrit-PatchSet: 1
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Adar Dembo <[email protected]>
Gerrit-Reviewer: Adar Dembo <[email protected]>
Gerrit-Reviewer: Dan Burkert <[email protected]>
Gerrit-Reviewer: David Ribeiro Alves <[email protected]>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Todd Lipcon <[email protected]>
Gerrit-HasComments: Yes

Reply via email to