if (this.storage && !this.isClearingStorage()) {
        // Only count storage resources if we count it's free capacity.
        limit -= Math.min(this.storage.store.getCapacity(), this.storage.store.getUsedCapacity());
    }