Code Monkey home page Code Monkey logo

allexlima / pybestfit Goto Github PK

View Code? Open in Web Editor NEW
6.0 5.0 3.0 266 KB

:vhs: 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: MIT License

Python 94.98% Shell 5.02%
memory-allocation-simulation pyqt4 simulation alloc python algorithm memory-allocation bestfirstsearch memory-management memory-simulator

pybestfit's Introduction

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.

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.