getFreeSubgridSize