Insertion and Compaction Algorithms in Sequentially Allocated Storage
暂无分享,去创建一个
Among the more difficult combinatorial problems in computer science are those occurring in dynamic storage allocation. We investigate the handling of memory conflicts occurring when a request for a block of storage is received, but no one region of available space is large enough due to fragmentation of storage. For arbitrary block sizes, we show that it is NP-hard to find a minimal cost reallocation of memory that will allow insertion of a new block. Therefore, we focus on the “bay restaurant” model studied by Robson, in which requests are for only one or two units of memory. We give a polynomial time algorithm for minimal cost insertions of batches of blocks and for minimal cost memory compaction. We show that the cost of inserting p blocks one at a time, i.e. on-line, is no worse than \[ \left\lfloor 2\left( \frac{3}{2} \right)^{\lceil \log p \rceil } - 1 \right\rfloor \] times the minimal cost of inserting the blocks in one batch, i.e. off-line. For p a power of two, this bound is tight.
[1] John Michael Robson,et al. An Estimate of the Store Size Necessary for Dynamic Storage Allocation , 1971, JACM.
[2] David S. Johnson,et al. Computers and Intractability: A Guide to the Theory of NP-Completeness , 1978 .
[3] Kenneth C. Knowlton,et al. A fast storage allocator , 1965, CACM.