{"id":29240147,"url":"https://github.com/nuochong/kebian","last_synced_at":"2026-05-14T20:32:09.429Z","repository":{"id":120937467,"uuid":"92588041","full_name":"nuochong/kebian","owner":"nuochong","description":"可变式分区存储管理模拟[Variable-partitioned-storage-management]","archived":false,"fork":false,"pushed_at":"2019-08-27T02:35:40.000Z","size":1017,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-09-22T22:55:22.806Z","etag":null,"topics":["bootstrap","javascript","management","partitioned","storage","variable"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nuochong.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-05-27T09:25:17.000Z","updated_at":"2019-12-12T03:06:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"138f1edc-07e6-4bb3-bca4-666df7dc99d2","html_url":"https://github.com/nuochong/kebian","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nuochong/kebian","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuochong%2Fkebian","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuochong%2Fkebian/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuochong%2Fkebian/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuochong%2Fkebian/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nuochong","download_url":"https://codeload.github.com/nuochong/kebian/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuochong%2Fkebian/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33042137,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T13:14:54.681Z","status":"online","status_checked_at":"2026-05-14T02:00:06.663Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bootstrap","javascript","management","partitioned","storage","variable"],"created_at":"2025-07-03T19:10:07.249Z","updated_at":"2026-05-14T20:32:09.423Z","avatar_url":"https://github.com/nuochong.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 可变分区式存储管理\n\n## [Variable-partitioned-storage-management]\n\n\u003e 推荐使用火狐、谷歌、safri、opera 等浏览器查看，IE9 以下没有效果，完整版请使用 IE9+浏览器打开。\n\n可变分区 存储管理 不是预先把内存中的用户区域划分成若干固定分区，而是在作业要求装入内存时，根据用户作业的大小和当时内存空间使用情况决定是否为该作业分配一个分区。因此分区大小不是预先固定的，而是按作业需求量来划分的；分区的个数和位置也不是预先确定的。它有效地克服了固定分区方式中，由于分区内部剩余内存空置造成浪费的问题。\n\n## 存储管理\n\n**基本思想**  \n在作业要求装入内存时，若当时内存中有足够的存储空间满足该作业的需求，那就划分出一个与作业相对地址空间同样大小的分区分配给它使用。\n\n**内、外部碎片**\n\n| 内部碎片                                                   | 外部碎片                                                             |\n| :--------------------------------------------------------- | :------------------------------------------------------------------- |\n| 存储管理中，把分配给了用户而用户未用的存储区称为“内部碎片” | 存储管理中，把那些无法分配出去满足作业存储请求的空闲区称为“外部碎片” |\n\n## 空闲区的合并\n\n**前后相邻接分区的四种关系**\n\n- 释放分区的前、后邻接分区都是已分配区，没有合并的问题存在。\n- 释放分区的前邻接分区是空闲区，后邻接分区是已分配区。释放区应该和前邻接的空闲区合并成一个新的空闲区。\n- 释放区的前邻接分区是已分配区，后邻接分区是空闲区。因此，释放分区应该和后邻接的空闲区合并成一个新的空闲区。\n- 释放区的前、后邻接分区都是空闲区。因此，释放区应该和前、后两个邻接的空闲区合并成一个新的空闲区。\n\n**空闲分区合并的时机**\n\n- 一是调度到某作业时，若系统的每个空闲区尺寸都小于它的需要，但空闲区总存储量大于它的存储请求，于是进行空闲区合并，得到一个大的空闲区，满足该作业的需要。\n- 一是只要有作业运行完归还所占用的存储区，系统就进行空闲区的合并。\n\n## 程序模拟操作步骤\n\n1. 申请一个大小为 20 的空间\n   ![An image](https://raw.githubusercontent.com/nuochong/kebian/master/img/11.png)\n\n2. 继续申请三个大小都为 20 的空间，然后申请两个为 10 的空间，提示剩余空间不能分配。\n   ![An image](https://raw.githubusercontent.com/nuochong/kebian/master/img/22.png)\n3. 释放编号为 2 的空间\n   ![An image](https://raw.githubusercontent.com/nuochong/kebian/master/img/33.png)\n4. 继续释放编号为 2 的空闲空间，因为本来就是空闲空间，所以不能释放，将提示此编号名无效！\n   ![An image](https://raw.githubusercontent.com/nuochong/kebian/master/img/44.png)\n5. 释放编号为 0 的作业后继续释放编号为 1 的作业，可以看到空间合并。\n   ![An image](https://raw.githubusercontent.com/nuochong/kebian/master/img/55.png)  \n   ![An image](https://raw.githubusercontent.com/nuochong/kebian/master/img/66.png)\n\n释放可以使用鼠标点击左边红色占用块自动添加编号。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnuochong%2Fkebian","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnuochong%2Fkebian","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnuochong%2Fkebian/lists"}