Skip to content

📼 Memory allocation simulator using best fit algorithm. Software written in Python and PyQt. The best fit deals with an algorithm that searches the first closest memory block size of process size to alloc it one. And as an advantage, best fit provide a memory utilization more optimized.

License

Notifications You must be signed in to change notification settings

allexlima/PyBestfit

Repository files navigation

AutomataTranslator

Welcome to PyBestfit

Memory Allocation Simulation using best fit Algorithm

This Software can be used as an educational approach for simulation of memory allocation algorithms. Although initially just best fit has been implemented here, you can contribute with this project forking and send pull requests with improvements made.

This was an final project presented at UniNorte Laureate University through Operating Systems discipline, ministered by Prof.ª Ângela Lima, M.Sc.

A short intro about best fit algorithm

The best fit deals with an algorithm that searches the first closest memory block size of process size to alloc it one. And as an advantage, best fit provide a memory utilization more optimized.

You can find a quickly content about more allocation algorithms accessing the last item of References. For a deep reading about this subject, I recommend the two firsts items of References.

Index

  1. Repo structure
  2. Workspace tips
  3. Requirements
  4. Setup
  5. Basic usage
  6. References

Repo structure

.
├── img
│   ├── about.png
│   ├── github.png
│   ├── icon_old.png
│   └── icon.png
├── nano_os
│   ├── __init__.py
│   ├── memory.py
│   ├── processor.py
│   └── support.py
├── LICENSE    
├── README.md
├── interface.ui     
├── interface.py   
├── ui_manager.py 
├── cli_testing.py    
└── app.py

Workspace tips

I advise you to use these tools to make easier your work and save time:

  1. Some unix-based OS as Debian, Ubuntu or OSX;
  2. PyCharm IDE (it's free for students);
  3. Read about PyQt can be helpful.

Requirements [not pip-installable]

  1. Python 2.7.x

    Download Python 2.7.x interpreter here.

  2. PyQt4

    • If you are using a Debian-based system, you can install it using the following command:

      $ sudo apt-get install python-qt4
    • If you are using OS X:

      $ brew install pyqt
    • You can also find a compatible version for your system in oficial PyQt website.

Setup

  1. Clone the repo

    $ git clone https://github.com/allexlima/PyBestfit.git
    $ cd PyBestfit/
  2. Run PyBestfit

    • You can install PyBestfit in your Debian-based system running setup.sh file as sudo or root:

      $ sudo ./setup.sh

      and type i to proceed installation

    • Or just run it:

      $ python app.py
    • If you want run without graphical interface, enjoy yourself with cli_testing.py example.

Basic usage

  1. Running app.py, this window will open:

  2. You must click on the Create button to generate pseudo-random values, then you can to browse through tabs:

    • Memory values:

    • Processes values

    • And logs:

  3. Now, clicking in Memory Alloc button, you will allocate the generated process in a memory spaces through the best fit algorithm.

    • Memory Tab:

      P.S.: The memory content is represented by PROCESS_ID: PROCESS_SIZE

    • Processes Tab:

  4. To generate new values, click in Update button.

  5. Testing mode can be checked to use pre-defined values in memory block sizes. These values are in SIZES list, available in nano_os/support.py.

References

  1. Tanenbaum, A. S., & Bos, H. (2014). Modern operating systems. Prentice Hall Press.
  2. Maziero, C. A. (2013). Sistemas Operacionais: Conceitos e Mecanismos. Online: http://dainf.ct.utfpr.edu.br/~maziero/lib/exe/fetch.php/so:so-cap09.
  3. Summerfield, M. (2007). Rapid GUI programming with Python and Qt: the definitive guide to PyQt programming. Pearson Education.
Support links

Developed by Allex Lima, Daniel Bispo, Paulo Moraes and Renan Barroncas with ❤️ using Python 2.7.x and PyQt4!

Copyright © 2016 PyBestfit - Licensed by MIT LICENSE.

About

📼 Memory allocation simulator using best fit algorithm. Software written in Python and PyQt. The best fit deals with an algorithm that searches the first closest memory block size of process size to alloc it one. And as an advantage, best fit provide a memory utilization more optimized.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published