Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mtaciano/mempager

Simulation of two different paging algorithms hit-and-miss ratios as they move pages from the swap to the RAM.
https://github.com/mtaciano/mempager

c paging simulation

Last synced: 10 days ago
JSON representation

Simulation of two different paging algorithms hit-and-miss ratios as they move pages from the swap to the RAM.

Awesome Lists containing this project

README

        

# Memory paging simulation

## About
This program aims at simulating the behavior of two different paging algorithms when the physical memory is full (pages need to be swaped constantly). The main metric is their hit-and-miss ratios as they move pages from the swap to the RAM.

The first one is a `FIFO` (First In First Out) pager, the first page loaded in memory is the first to get released independently of its modified or referenced status.

The second algorithm is a `CLOCK` pager, it uses a circular list to find the first non-referenced page that is loaded and release it from memory.

### Building
To build the program, you can call `cmake` with the configuration you want, or use the `./config.sh` script provided, which is the configuration that I used to write this program.

After that, run `cmake --build build` and the executable will be in the `build` folder.

### Running
To run this program you can do:
```sh
./mempager
```
Note that the seed is optional, and used if you want both pagers to have the same inputs, for comparison purposes.

## License
MIT License.