calculate space for instance and static data