calculate object size