DNN-4500 make GetPortalSpaceUsed more robust