class D:

    def __init__(self):
        self.d = ''
self.e = ''
self.e_isset = 1
self.a = A()
self.b = B()
self.b_isset = 1
self.c = [C()]
d = D()
print(asizeof(d))
Google protocol buffers huge in python