- This is a Desktop Application - which can be also treated as a web application since its core is written in React - that's built using Electron.
- This application shows the implementation of different memory allocation methods, namely; First Fit, Best Fit and Worst Fit.
-
A live version of this application is hosted using github pages: https://xtratos.github.io/memory-allocation/
-
Using the desktop application Download the .exe file from releases https://github.com/XtratoS/memory-allocation/releases/download/v1.0.0/memory-alloc.exe
-
To build the application on your machine
- Clone the repository.
- Use
npm install
to install dependancies. - Use
yarn electron:build
to build the application for your platform, oryarn electron:build-win
to build for Windows while using Linux. - Run the application from the executable created in
/dist
.
- On the first page, we input the size of the memory in bytes, then we hit enter or press on Submit button.
- On the second page, we first insert the holes, when holes overlap you will recieve an error message, also when any new hole is inserted, it is shown on the rightmost column.
- After inserting the holes, the Add Process button will be enabled.
- Note that the system inserts the first process for us by default, so we type the process name and click on Save beside the process name text box.
- We click on Add Segment to insert the first segment in the first process.
- We input the name and size of the segment then press on Save below the segment information text boxes.
- We can hide Holes and Processes using the [hide] buttons.
- We choose the Allocation Method from the dropdown menu, and get the result right below it.
- We input as many processes/segments like we did in the previous steps.
- We can traverse between Processes using the menu in the rightmost column, the selected process's backgroud is in yellow/orange.
- We can remove a segment by clicking on the trash icon beside it.
- We can remove a process by clicking on the Remove Process button.
- Added Worst Fit Option.
- Error checking:
- User can't insert overlapping holes.
- User can't insert a negative size for the memory, a hole or a segment.
- User can't insert a hole that's outside the memory's boundary.
- User can apply External Compaction by pressing the Squash All Holes Together button.
- Live Modification:
- User can switch between different Allocation Methods at any time.
- User can add holes at any time.
- User can add Processes and Segments and Remove them at any time.
- When deallocating a process, all segments are automatically reallocated.
- Output View:
- The output view of the memory is scaled to 480 pixels by default.
- The output view can be expanded to 960 pixels and contracted back to 480 pixels on demand.
- When one or more process(es) allocation fails, the user is alerted with the failed process(es).
When a bug is fixed it will marked as [x]
- When expanding or contracting the segment view column, if one or more processes couldn't be allocated, the error message will appear again.