Which method do we need to call in order to know how many objects are alive?

Any method is there to know how many bytes occupied by a variable?