1. A method of calculating the optimal allocation of two or more resources provided by a resource provider to a task within a computer system from a plurality of possible allocations, the method comprising: calculating the total volume of an N-dimensional cube, where N is the number of resources provided by the resource provider, representing the respective amounts of resources available to be allocated; calculating the average volume of the N-1 dimensional shapes forming the sides of the N-dimensional cube; calculating, at least partly from the ratio of the total volume to the average volume, the balance resulting from the allocation of resources represented by the N-dimensional cube; calculating the imbalance resulting from the allocation of resources at least partly from the balance; and determining the smallest imbalance as the optimal allocation of resources.