Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 551727
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T11:25:29+00:00 2026-05-13T11:25:29+00:00

I want to design an algorithm for allocating and freeing memory pages and page

  • 0

I want to design an algorithm for allocating and freeing memory pages and page tables. What data structures would allow best performance and simplest implementation?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T11:25:29+00:00Added an answer on May 13, 2026 at 11:25 am

    Even though OS normally implement page tables, the simpler solution could be something like this.

    Have a large contiguous memory as an array. When you allocate some memory, maintain that information in a linked list storing the index of the array and the length in the data part.

    When you are building the linked list, make sure that it is sorted on the index.

    When you want to allocate memory, scan the linked list and this will take O(N). where N is the allocations already done.

    Deletion will be scanning the array for the particular index and removing the node in linked list.

    Once the node is removed, have a separate linked list containing these free allocations.

    Insertion will look like this.
    1. Check in free list if there is an element in the list of size requested.
    2. If not, allocate memory after the last element of linked list

    Deletion will work like this,
    1. Move the node to the free list.

    Make sure free list and linked list are sorted on the index.

    This approach doesn’t address the fragmentation issue in memory allocators.One easy approach is to use compaction. Regularly, scan the free node linked list and for each element move the elements in the array and update the index of the node in linked list appropriately.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to design a web page with a banner and an iframe. I
I'm using a table to design the layout of my web page. I want
I want to create a WCF service. What is the best design pattern to
That's my question, I want design all the interface of my application within an
Say I want to design a database for a community site with blogs, photos,
I am new to this. I want to design an image gallery in my
How do I send an SMS to Active Directory Users. I want to design
I am new to C# and .NET programming. I want to design an application
I want to see if anyone has a better design for a class (class
You and I want to be the expert on computer programming or website design,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.