GithubHelp home page GithubHelp logo

algo_virt_mem_20_10's Introduction

Virtual memory

This is program for the implementation of algorithms for managing virtual memory and comparing them with each other.

The program accepts one or several files.

Description of correct format of input data:

  • the file must contain the top three lines and only them
  • the top line shows the number of pages in the process's address space (1 natural number)
  • the second line should indicate the number of memory frames (1 natural number)
  • the third line should contain a sequence of natural numbers (page references). They must be separated by spaces.

The results of the program are displayed on the screen.

Description of output:

  1. The file was not in the correct format:

    • the program will fail
    • a message with error description will be displayed on the screen
    • the error description is written to the log
  2. The file is in the correct format:

    • the result of each algorithm is displayed

      This is the result of the algorithm ... : [...]

      • if a free frame is replaced, then the answer is the frame number with *
      • if an already filled frame is replaced, then the answer is the frame number
      • if the page is already in memory, then the answer is +

      P.s. this output is arranged for the convenience of the user.

    • the result of the comparison is displayed

      Algorithms sorted by the number of answers of the second type: ...

  3. Among the calls there are inadmissible:

    • a warning is displayed before the output of the program

      There were invalid calls in the call sequence. These calls will be ignored.

    • invalid calls are ignored

Example

$./gradlew run --args="file.txt"

File file.txt processing result:
There were invalid calls in the call sequence. These calls will be ignored.

This is the result of the algorithm FIFO: [1*, 2*, 3*, 1, +, 2, +, 3, 1]
This is the result of the algorithm LRU: [1*, 2*, 3*, 1, +, 2, +, 1, 2]
This is the result of the algorithm OPT: [1*, 2*, 3*, 2, +, 2, +, +, 1]

Algorithms sorted by the number of answers of the second type:
OPT: 6
FIFO: 7
LRU: 7

file.txt

10
3
22 4 8 7 1 1 2 7 4 10

algo_virt_mem_20_10's People

Contributors

mamaria-k avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.