get_data_space function

calculate data space