boost::shared_ptr<>
contains two pointers, one to the object itself and one to the tracker object used for reference counting, proper destruction etc. That means it will be 2 * sizeof(void*)
big.
The structure of the tracker object is of course an implementation detail, but it is a few dozen bytes large (virtual table, pointer to the object, reference count, weak count and some extra flags and whatnot).
If you use boost::make_shared()
as recommended, both the object itself and the information helding one will be created in one heap block and the pointers will be just a few bytes apart.