Heap Simulator

Project Details

I developed a heap simulator that dynamically allocates memory blocks, each consisting of a header, payload, and footer. This simulator follows a best-fit allocation strategy and employs techniques like free block splitting and coalescing to optimize heap space usage. Memory blocks are allocated in multiples of 8 bytes, with each block containing at least a 4-byte header and a 4-byte footer. Upon a memory allocation request, the program searches for an available free block. It scans all free blocks and selects the one closest in size to the requested allocation. If the chosen block has extra space, it splits off the unused portion into a new free block. If no sufficiently large free block is found, the program merges adjacent free blocks to create a large enough space for the new allocation.

The project includes the following key features:

  • Data preprocessing and research
  • Linear Regression
  • Reporting Research Findings