# US 2006/0080367 A1 · Method and system for limiting resource usage of a version store

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2006/0080367 A1
- Document ID: US20060080367A1
- Status: Published application
- Kind: A1
- Application number: 10/960,675
- Filed: 2004-10-07
- Published: 2006-04-13
- Earliest claimed: 2004-10-07
- Assignees: Microsoft Corporation
- Inventors: Ravisankar Pudipeddi
- Web page: https://patentgrep.com/patent/US20060080367A1

## CPC

- G06F 9/5016: {the resource being the memory}
- G06F 9/466: {Transaction processing}
- G06F 9/52: Program synchronisation; Mutual exclusion, e.g. by means of semaphores
- G06F 2209/504: Resource capping
- G06F 2209/508: Monitor
- Y02D 10/00: Energy efficient computing, e.g. low power processors, power management or thermal management
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- Y02D: CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE

## Abstract

A method and system for limiting resource usage of a version store. A limit indicates a total amount of resources that may be consumed by in-progress transactions. A running total of the amount of remaining resources is maintained. Before a new transaction is started, a determination is made as to whether there are enough resources remaining to complete the new transaction. If so, the transaction starts and the running total is adjusted. If not, the transaction waits until more resources are available. When a transaction completes, if it is the oldest in-progress transaction, resources are released. Otherwise, the resources associated with the transaction are not released until all transactions that started before the transaction have completed. This ensures that a client of a version store does not exceed the limit of resources that may be consumed by in-progress transactions.

## Claims

### Claim 1

A computer-readable medium having computer-executable instructions, comprising:
tracking an amount of resources potentially used in completing a plurality of transactions related to a version store;
prior to starting a new transaction, determining whether enough resources are available to complete the new transaction;
if enough resources are available, starting the new transaction; and
if enough resources are not available, waiting until more resources are available.

### Claim 2 (depends on 1)

The computer-readable medium of claim 1, wherein at least one of the plurality of transactions is in-progress.

### Claim 3 (depends on 1)

The computer-readable medium of claim 1, further comprising setting a limit to the amount of resources potentially used by the plurality of transactions.

### Claim 4 (depends on 1)

The computer-readable medium of claim 1, wherein the version store creates a new shapshot of a database before each transaction starts.

### Claim 5 (depends on 4)

The computer-readable medium of claim 4, wherein the snapshot is maintained as differences in a log file.

### Claim 6 (depends on 4)

The computer-readable medium of claim 4, wherein the database has a first state before the new shapshot is created and the first state of the database is createable from the log file together with a second state of the database.

### Claim 7 (depends on 1)

The computer-readable medium of claim 1, wherein waiting until more resources are available comprises blocking a thread until the resources are available.

### Claim 8 (depends on 1)

The computer-readable medium of claim 1, further comprising:
obtaining a lock of a data structure that tracks the amount of resources potentially used in completing the plurality of transactions related to the version store;
modifying the data structure to include information related to the new transaction; and
releasing the lock thereafter.

### Claim 9 (depends on 8)

The computer-readable medium of claim 8, wherein the data structure comprises a doubly-linked list and wherein modifying the data structure to include information related to the new transaction comprises adding a node to the data structure.

### Claim 10 (depends on 8)

The computer-readable medium of claim 8, wherein the data structure orders the transactions temporally.

### Claim 11 (depends on 1)

The computer-readable medium of claim 1, further comprising completing a transaction and modifying the amount of resources potentially used in completing the plurality of transactions if the transaction started before any of the other transactions that are still in-progress.

### Claim 12 (depends on 1)

The computer-readable medium of claim 1, further comprising completing a transaction and not modifying the amount of resources potentially used if the transaction started after any other transaction that is still in-progress.

### Claim 13 (depends on 12)

The computer-readable medium of claim 12, further comprising modifying data associated with a previous transaction that is in-progress to add an amount of resources potentially used by the transaction that has completed.

### Claim 14 (depends on 13)

The computer-readable medium of claim 13, further comprising completing the previous transaction and modifying the amount of resources potentially used to release the amount of resources indicated by the data.

### Claim 15 (depends on 1)

The computer-readable medium of claim 1, wherein tracking the amount of resources potentially used in completing a plurality of transactions related to a version store comprises blocking on a semaphore.

### Claim 16

A method for limiting resource usage, comprising:
setting a limit that indicates a total amount of resources that may be consumed by in-progress transactions;
maintaining a running total that indicates a remaining amount of resources that remain to be used by any new transactions; and
based on the running total and a needed amount of resources potentially needed to complete a new transaction, determining if there are enough resources to complete the new transaction.

### Claim 17 (depends on 16)

The method of claim 16, further comprising initializing the running total to the limit.

### Claim 18 (depends on 16)

The method of claim 16, further comprising starting the new transaction if there are enough resources to start the new transaction.

### Claim 19 (depends on 16)

The method of claim 16, wherein determining if there are enough resources to start the new transaction comprises subtracting the needed amount of resources from the running total to obtain a result and determining if the result is zero or greater.

### Claim 20 (depends on 16)

The method of claim 16, further comprising obtaining a lock on a data structure and modifying the data structure.

### Claim 21 (depends on 20)

The method of claim 20, wherein the data structure is a doubly-linked list that is temporally ordered according to start times of in-progress transactions.

### Claim 22 (depends on 20)

The method of claim 20, further comprising determining if a node of the doubly-linked list that is associated with a just-completed transaction is at the head of the doubly-linked list.

### Claim 23 (depends on 22)

The method of claim 22, wherein if the node is at the head of the doubly-linked list, increasing the running total by an amount indicated by the node.

### Claim 24 (depends on 22)

The method of claim 22, wherein if the node is not at the head of the doubly-linked list, adding resources indicated by the node to another node in the doubly-linked list that precedes the node and removing the node.

### Claim 25 (depends on 16)

The method of claim 16, further comprising increasing the running total after a transaction completes and awakening any threads associated with new transactions that have blocked as a result of having insufficient resources to start.

### Claim 26

A system for limiting resource usage, comprising:
a first client arranged to interact with a version store, wherein the first client is further arranged to perform acts, comprising:
obtaining a first limit that indicates a total amount of resources that may be consumed as a result of the first client engaging in transactions with the version store;
maintaining a first total that indicates a remaining amount of resources that remain to be used by any new transactions initiated by the first client; and
determining if there are enough resources to start a new transaction based on the first total and a needed amount of resources potentially needed to complete the new transaction.

### Claim 27 (depends on 26)

The system of claim 26, further comprising:
a second client arranged to interact with the version store, wherein the second client is further arranged to perform acts, comprising:
obtaining a second limit that indicates a total amount of resources that may be consumed as a result of the second client engaging in transactions with the version store;
maintaining a second total that indicates a remaining amount of resources that remain to be used by any new transactions initiated by the second client; and
determining if there are enough resources to start a new transaction based on the second total and a needed amount of resources potentially needed to complete the new transaction.

### Claim 28 (depends on 27)

The system of claim 27, wherein the first and second limits are obtained via negotiation between the clients.

### Claim 29 (depends on 27)

The system of claim 27, wherein the first and second limits are obtained via system settings on each client.

### Claim 30 (depends on 27)

The system of claim 27, wherein the first and second limits are obtained via user input.

### Claim 31 (depends on 27)

The system of claim 27, further comprising a program arranged to execute periodically and adjust the first and second limits based on a history of the first and second totals.

### Claim 32 (depends on 27)

The system of claim 27, further comprising a server arranged to provide access to the version store.

### Claim 33 (depends on 27)

The system of claim 27, wherein each client is further arranged to communicate with the server to set each client's limit that indicate a total amount of resources that may be consumed by each client.

### Claim 34 (depends on 26)

The system of claim 26, wherein obtaining the first limit comprises retrieving the first limit from a store on the first client.

### Claim 35 (depends on 26)

The system of claim 26, wherein obtaining the first limit comprises communicating with a server.

### Claim 36 (depends on 26)

The system of claim 26, wherein the version store is used for a file replication system.
