Constructing an Efficient Model to Inspire Design Education ... - MDPI

0 downloads 0 Views 5MB Size Report
Oct 5, 2018 - become an 'essential' to drive innovations and industry transformations. ... of education [3], and particularly regarding elementary and high school education ... While the final unit cost was higher than $100, this project ... developments, as evidenced by the emergence of e-Commerce in rural communities.
sustainability Article

Constructing an Efficient Model to Inspire Design Education Sustainability in Rural Areas Kuo-Kuang Fan 1 , Xiang-Ming Zhong 1, * , Ye Xu 2 and Bao-Jun Zhang 3 1 2 3

*

Graduate School of Design, National Yunlin University of Science and Technology, Yunlin 64002, Taiwan; [email protected] Department of Art, Minnan Normal University, Zhangzhou 363000, Fujian, China; [email protected] New Media College, Zhejiang University of Media and Communications, Hangzhou 310018, Zhejiang, China; [email protected] Correspondence: [email protected]; Tel.: +886-0976-911-786

Received: 8 August 2018; Accepted: 30 September 2018; Published: 5 October 2018

 

Abstract: Advancements of information and communication technologies, as well as the reduction of computer prices, have brought computer-assisted design from applications by large manufacturers to education. The number of computer-assisted learning activities and research projects in developing countries and rural areas has been on the rise over recent years. However, there are very few studies focused on the design education of rural areas. Understandably, it is critical to establish a fundamental environment integrating design education and constructing an efficiently model to inspire design education sustainability in rural areas. By considering limited resources and the educational milieu prevalent in rural areas, this paper constructed a central kitchen model anchored in teaching equipment of design education and designed an algorithm for supporting the operation of this model efficiently. We analyzed the core algorithm MMAFS (A Memory Management Algorithm with Fast Speed) of model and comparing the MMAFS algorithm with the current popular Segregated lists algorithm and the Buddy algorithm by adopting the comparative analysis method, also demonstrated the feasibility of this central kitchen model through a case study. Given the large number of urgent and unresolved issues in developing countries and rural areas, it is essential to emphasize design education and encourage local design education specifically for rural communities and promoting a positive loop in the rural ecology through local designs. Keywords: Central kitchen model; MMAFS algorithm; rural areas; teaching equipment; design education

1. Introduction Over the past few decades, declining hardware costs have rapidly increased the penetration and applications of computers and computer technology. Major economies, such as the U.S., the U.K., Japan, China, and Russia boast solid information infrastructures and command large markets in terms of users. These countries are in a favorable position to develop the information industry by improving data computing efficiency and information processing capabilities. In response to the growth and development of the global information industry, information and communication technology has become an ‘essential’ to drive innovations and industry transformations. From Bauhaus to MIT Media Labs, from CAD (computer-aided design) to CAM (computer-aided manufacturing), the impact and contributions of machines and computers on design education are groundbreaking, which has enriched the contents and the depth of design types for computer-aided education and computer-aided learning [1]. There are studies on the effects of software and technical operations on drafting and modeling as part of the design process [2–5], as well as the examination of Sustainability 2018, 10, 3562; doi:10.3390/su10103562

www.mdpi.com/journal/sustainability

Sustainability 2018, 10, 3562

2 of 16

user experience, human-machine interactions, and cognitive science [6–8]. In fact, computers have become a pivotal element in design education, and the increased number of relevant studies is evidence of the growing importance of computer technology in design education; however, many issues are yet to be explored and resolved. In other words, computers and IT technology have become resources integral to design education. The prevalence of educational resources is highly relevant to economic development. Computer-aided learning (CAL) provides a reliable learning support, a method to introduce information technology, and a measurement for the levels of economic development and modernization. The majority of studies on CAL focus on developed countries, such as the U.S., Australia, New Zealand, and Germany [9], and it was only a few years ago that academics started to pay attention to developing countries and rural areas [10]. Through the studies of REAP (Rural Education Action Program) research in China and other developing countries, they indicated that computers and innovative education software can dramatically enhance academic achievements, even in less-than-ideal learning environments. More than half of the global population resides in rural areas, where resources are scarce. Relevant policies, international organizations, and social efforts can help to improve the living conditions and environments of impoverished regions. On the basis of design practice, Papanek suggested the vision of “designs for the real world”. As a matter of fact, the concept of social design has been progressing and developing in developing countries and rural areas [11]. In the basic context of education [3], and particularly regarding elementary and high school education in rural areas, most empirical studies focus on the teaching methods of mathematics and languages, while there is very limited literature on the teaching of design subjects, which shows a lack of attention to local design education in rural areas. The developments of the design concepts at the bottom of the pyramid have been attracting attention to design issues and solutions in developing countries and rural areas. On the other hand, the existence of these problems also means the possibility of new markets and ‘experimental labs’. This paper aims to develop an architecture of applied value for design education in rural areas. According to the issues of actual situations in rural areas, we constructed a kind of central-kitchen model, and then we designed the MMAFS algorithm for improving the effectiveness and feasibility of this central-kitchen model. A case study was invited to compare the relationships between teaching demand and funds investment before and after central-kitchen model and finally put forward a set of practicable computer-aided design education scheme of rural areas. 2. Design for the Rural Education At the annual meeting of the World Economic Forum in Davos in January 2005, the MIT Media Lab initiated a non-profit organization, OLPC (One Laptop per Child), by producing version of XOlaptops at a unit cost of less than $100, in order that governments in developing countries can distribute laptops to children to narrow the knowledge gap. While the final unit cost was higher than $100, this project gained significant traction in many developing countries. The XO laptops used today are the result of in-depth exploration into look-and-feel preferences, interface design, human-machine interaction, and normal operations under harsh conditions. The REAP (Rural Education Action Program) initiative of Stanford University evaluated the effectiveness of XO laptops, and indicated that the computer literacy of students with access to computers for educational purposes improves immensely. This is particularly the case for students with no prior experience with computers or the Internet. This shows that XO laptops are beneficial, to a certain degree, to enhance the computer resources and learning outcomes of developing countries and rural regions. With the increasing coverage of the Internet, students in rural areas can access more information and acquire more knowledge. A large-scale investigation of elementary schools throughout China suggests a huge digital divide (i.e., computer and Internet literacy) between the students in public schools of rural areas and urban areas. This digital divide is obvious when the students in urban and rural areas access computer applications and learning

Sustainability 2018, 10, 3562

3 of 16

software. This demonstrates the need for a reasonable and professional teaching model to facilitate interactions among teachers, computers/Internet, and students. The traditional teacher-centered education remains the mainstream method throughout the elementary and high schools in the rural areas of China [12]. Many innovative teaching techniques to enhance the learning effectiveness of elementary and high school students are not suitable in rural areas, due to the cultural and economic uniqueness of these students, such as the method of student-centered teaching [13]. In fact, the guidance and assistance of teachers is essential in the elementary and high schools of rural regions [14]. Due to growing digitalization and social media, the interactions between people are now in ‘topological milieu’ in developed countries, societies, and cultures. If we address the education issues in rural communities with habitual thinking and modern perspectives, we would garble their ‘needs’ and ‘demands’. When computers and the Internet become part of the education equation in rural areas, it is critical to strike a balance with the traditional teaching situation. Some scholars criticize the OLPC projects from the perspective of resource allocation in developing countries by arguing that one-to-one laptops are not suitable to rural areas [15]. An in-depth examination of the education milieu unique to rural communities helps us to revisit the values and implications of initiatives similar to OLPC, which will help the formulation of the strategies in computer-assisted design education to be more realistic to the local context. 3. Making Design Education Suitable for Rural Areas The problems in rural areas are more than economic issues, as there are challenges associated with the harshness of medical conditions, the insufficiency of medical equipment, the shortage of medical supplies, and the safety of drinking water. In addition to solutions to the minimum level of living standards, it is also necessary to consider the local cultures of rural areas. In China, the people in rural areas have been relocating to mid-sized cities and metropolitans, due to growing urbanization. As industries develop and upgrade, unskilled workers are faced with being phased out or settling for low-paid jobs. Meanwhile, the limited resources available for education in rural areas mean difficult access to information. For children living in remote regions, schools are a sacred place worthy of a pilgrimage over troubled waters and rugged mountains. To strengthen their economic power, all the governments around the world have been addressing rural development issues through policy support, which has the purpose of accelerating the transformation of rural areas by increasing investments in information and networking technology. This will drive regional developments, as evidenced by the emergence of e-Commerce in rural communities. The diffusion of information allows effective supplies from local industries to match the demands of the markets, which can be achieved through the promotion of local products and publicity of local cultures. Needless to say, education serves as the foundation of everything. Basic design education first appeared as a foundation course in design and architecture schools, and the most famous was Bauhaus. After the period from the 1920’s to the 1960’s, basic design education once again attracted academic attention [16,17]. The teachers instruct the fundamental knowledge in basic design, while design project supervisors assist students in the development of cognitive and design capability with 3D models and other supporting software programs. Scholars have revisited the educational methodology and confirmed the importance of basic design in design education [18], which requires the integration of fundamental knowledge and design practice, and emphasizes the importance of computer-aided learning and team-work (i.e., interactions between teachers and students, and between students. The education in basic design invigorates the teacher-centered approach by encouraging interactions and co-operation between teachers and students, and between students. Computer-aided learning also increases the cognitive and practical capabilities of students. As we see that, design education is critical to the thinking and cognitive development of children and teenagers through computer-assisted software. Considering the demand of students in rural areas for computer-assisted design education, while the current economy in many rural areas is

Sustainability 2018, 10, 3562

4 of 16

not developed and education is an expense investment that is limited, the education equipment for education is severely insufficient. 4. Methodology Based on the analysis and discussion of existing research and theory, this paper has developed the architecture of applied value for design education in rural areas. Through the actual situations in rural areas of China, we designed the MMAFS algorithm, and adopt the comparative analysis for proving the advantages and efficiency of this algorithm. We use a case study analysis to compare the relationships between teaching demand and funds investment before and after central-kitchen model and put forward a set of practicable computer-aided design education scheme of rural areas. According to the structure of the above studies, the specific research steps are as follows:







Through a detailed analysis of the literature, we discovered that computers have become a pivotal element in design education, and the increased number of relevant studies is evidence of the growing importance of computer technology in design education. By focusing the computer-aided learning, it was only a few years ago that academics started pay attention to developing countries and rural areas, but there is very limited literature on the teaching of design subjects, which shows a lack of attention to local design education and the actual situations of rural areas. For the above reasons, we put forward a central-kitchen model and its advantages. Based on the actual situations in rural areas of China, and the requirement of application operating in central-kitchen model, we designed the MMAFS algorithm. We compare the MMAFS algorithm with the current popular Segregated lists algorithm and the Buddy algorithm by adopting the comparative analysis method. For proving the efficiency of the MMAFS algorithm, we compare and analyze the time complexity and spatial utilization of this algorithm. In addition, we compared the performance of the two algorithms of MMAFS and the Buddy by experiment. By adopting case study through the practical cases of computer teaching in rural primary and secondary schools in China, we analyzed the existing computer teaching demand of schools, funds investment, and equipment configuration, and compare the relationships between teaching demand and funds investment before and after the central-kitchen model.

5. The Central Kitchen Model How to satisfy computer-learning demand for more children as much as possible in the case of limited funds and equipment? In rural areas, the funds and equipment are limited, so improving the utilization of existing resources is the key. Nowadays, cloud-based computer classroom is relatively good way to integrate education resources. However, it is unsuitable for the rural areas. First, the cost of building cloud computing platform is too high. Build yourself? No money and no technology. Rent existing platform? It is a bottomless hole to pay for the platform in the long run. Second, the maintenance and use of cloud computing platform is also a problem, there are no technicians. Last, the rural areas often are far away from cities and towns, the traffic is inconvent and there is no network. Many places are almost isolated from the world. Therefore, in rural areas, a reasonable solution is to build an independent LAN using existing resources. Additionally, the LAN uses the structure of C/S. In order to satisfy more students, we should try to improve the efficiency of servers. Therefore, according to the actual situation in rural areas, this paper puts forward a kind of central-kitchen model and the model frame is shown as Figure 1.

Sustainability 2018, 10, 3562 Sustainability 2018, 10, x FOR PEER REVIEW

5 of 16 5 of 16

Application 1

Application 2 Terminal 1

Terminal 2

Server Center

Terminal 3

Terminal n Application n

Application 3

…... Memory of Servers Server 1

Server 2

Server 3

Server m Terminal 4 Application 4

... …

Application 1 Application 2 Application 3 Application 4 Application 5 Application 6 …... Application n

Terminal 5 Application 5 Terminal 6 Application 6

Figure The Central Kitchen Model Computer-Assisted Design Learning. Figure 1. 1. The Central Kitchen Model of of Computer-Assisted Design Learning.

Service center composed several servers Figure 1 to provide service several clients. Service center is is composed ofof several servers in in Figure 1 to provide service forfor several clients. Onthe theconfiguration configurationofofresources, resources, the the server server in in service On service center centerhas hashigh-end high-endperformance performanceand andhigh-end highconfiguration is adopted and all application software for teaching is installed in no matter internal end configuration is adopted and all application software for teaching is installed in no matter storage, or hardware; however, client adopts configuration or diskless workstation and main internal storage, or hardware; however, client low-end adopts low-end configuration or diskless workstation works completed in a server to reduce of clientsofasclients muchasasmuch possible. and mainare works are completed in aterminal server terminal toexpenses reduce expenses as possible. The whole system frame can adjust resource distribution ratio of service center equipment and The whole system frame can adjust resource distribution ratio of service center equipment and client equipment the central kitchen, according funds investment and practical demand dynamic client equipment ofof the central kitchen, according toto funds investment and practical demand dynamic conditions for teaching during establishment, while there are three corresponding kinds of modes conditions for teaching during establishment, while there are three corresponding kinds of modes inin application: application: Mode1: Service terminal adopts multi-user and multi-task operation system and client adopts  • Mode1: Service terminal adopts multi-user and multi-task operation system and client adopts aa disklessworkstation workstation and in service terminal remotely, in orderintoorder use various applications diskless and can canload load in service terminal remotely, to use various of service terminal. applications of service terminal.  • Mode2: Service terminal adopts multi-user and multi-task operation system andand client adopts a Mode2: Service terminal adopts multi-user and multi-task operation system client adopts host computer with low-end configuration andand thethe client operates thethe browser and a host computer with low-end configuration client operates browser andvarious various applications inin the server terminal applications the server terminalthat thatcan canbebeused usedthrough throughbrowser browserplugins. plugins.  • Mode3: Service terminal adopts multi-user and multi-task operation system and client adopts aa Mode3: Service terminal adopts multi-user and multi-task operation system and client adopts host computer with low-end configuration and the client can load in service terminal remotely host computer with low-end configuration and the client can load in service terminal remotely and uses various applications ofofservice and uses various applications serviceterminal. terminal. Comparing the three kinds ofof modes, diskless workstation is is cheaper than host computers with Comparing the three kinds modes, diskless workstation cheaper than host computers with low-end configurations, which saves expenses, while because the diskless workstation cannot save low-end configurations, which saves expenses, while because the diskless workstation cannot save user user be stored the server terminal; in mode the uses clientvarious uses various applications file,file, file file can can onlyonly be stored in theinserver terminal; in mode 2, the 2, client applications in server interminal server terminal byplugins, browsersoplugins, so it shall take overhead of various application plugins by browser it shall take overhead of various application plugins development into development into account and some plugins are not more compatible with the browser. account and some plugins are not more compatible with the browser. This central-kitchen model has the following This central-kitchen model has the followingadvantages: advantages: 1.

2.

1.

Expense saving. In traditional experiment computer room, configuration of all computers is the Expense saving. In traditional experiment computer room, configuration of all computers is the same, while in practical application, performance of many computers is not utilized sufficiently, same, while in practical application, performance of many computers is not utilized sufficiently, and there is large leisure for resources, such as CPU, storage, and network bandwidth, etc. In and there is large leisure for resources, such as CPU, storage, and network bandwidth, etc. addition, the number of clients in computer room is often numerous, so you can use a small In addition, the number of clients in computer room is often numerous, so you can use a small number of the servers with high-end configuration to provide services, while a large number of number of the servers with high-end configuration to provide services, while a large number of clients are using low-end configuration or even workstations. clients are using low-end configuration or even workstations. Convenient management. The centralized central-kitchen work mode is more convenient for equipment management. For computer teaching, terminal users tend to use the same teaching software and it is not necessary for each client to be equipped with the same software, which

Sustainability 2018, 10, 3562

2.

6 of 16

Convenient management. The centralized central-kitchen work mode is more convenient for equipment management. For computer teaching, terminal users tend to use the same teaching software and it is not necessary for each client to be equipped with the same software, which greatly increases the burden for software installation, maintenance, and management. Therefore, you can install intensive application software on the server terminal, which not only facilitates the upgrade and maintenance of the software, but also reduces the expenses of client.

We know that the centralized model has high requirements for server terminal and server tends to be performance bottleneck and there is a so-called single-point failure, so once the server fails, the whole business of system will be interrupted. So how does a central kitchen model proposed avoid single-point failure? Firstly, in service center, we relieve single-point failure by adopting equipment with high-end configuration as a server by improving the performance of the server; secondly, several servers are deployed in the service center and load balance is implemented between multiple servers to prevent all clients from being connected to a single server and further to mitigate single-point failure; then, in the service center, a part of the servers is left as the backup server, which plays the role of disaster tolerance; when the master server fails, a backup server will continue to work in place of master server to ensure business continuity. Finally, this central-kitchen model is mainly used for computer room construction in rural schools, which is generally a LAN environment and the current LAN bandwidth has already reached the gigabit; in addition, establishing wholly switching network by adopting interchanger can further improve the LAN bandwidth access, so as to meet the demand of data transmission between client and service center. 6. MMAFS Algorithm It is mentioned previously that there are three kinds of work modes for this central-kitchen mode in application and it is required that the server terminal can run multiple applications at the same time for either work mode; it is known that the program runs in memory, which has a higher requirement for server terminal memory management. It can be said that efficient memory management is the basis for the realization of this application. Therefore, based on the application model, this paper proposes an efficient memory management algorithm to effectively manage memory resources in the server terminal. In order to manage limited memory for servers effectively, we designed MMAFS, which is universal, allocation fast, high space utilization rate, and has complete functions of memory allocation, release, and merging. The input of MMAFS is a large block of sequential memory. Specifically, MMAFS regards the first address and length of the memory that needs to be managed as an input. At the beginning, the sequential memory will be divided into memory units with the same size, and these blocks are the smallest memory units managed by MMAFS. For example, we can define the smallest memory unit as 4-Byte, 8-Byte or 16-Byte according to our requirement. 6.1. Data Structure To manage the memory blocks, three data structures are defined, the “FreeList”, the “Max_Free_Block” and the “MemoryBlock”, which are used to record the information of memory blocks, including the information of allocated memory and free memory. (1)

Array “FreeList”

The serial memory need to be managed will be divided into memory units with the same size first. The memory unit is the minimum unit managed by MMAFS. Array “FreeList” is defined to record the information of free memory unit. int FreeList[N]; N is the amount of memory units. Suppose N is 16, the “FreeList” is initialized as Figure 2.

The serial memory need to be managed will be divided into memory units with the same size first. The memory unit is the minimum unit managed by MMAFS. Array “FreeList” is defined to record the information of free memory unit. int FreeList[N]; Sustainability 2018, 10, 3562

7 of 16

N is the amount of memory units. Suppose N is 16, the “FreeList” is initialized as Figure 2. Free List

FreeList[0] FreeList[1]

-1

-1

-1

-1

-1

-1

-1

-1

-1

-1

-1

-1

-1

-1

-1

Sustainability 2018, 10, x FOR PEER REVIEW

FreeList[15]

0

7 of 16

Figure 2. 2. Initialized Initialized Free Free List. List. Figure

The subscript of array “FreeList” reflects the size of free memory block. The value of The subscript of to array reflects size of free block. The value of “FreeList[n]” “FreeList[n]” points the “FreeList” first address of thethe linked list of memory the free memory block with size n + 1. If points to the first address of the linked list of the free memory block with size n + 1. If there is not there is not the free memory block with the corresponding size, the value will be −1. For example, the free memory block corresponding size, the value willallocated, be −1. For according to according to Figure 2, atwith the the beginning, the whole memory is not so example, there is a free memory Figure 2, at the beginning, the whole memory is not allocated, so there is a free memory block with block with size 16, the “FreeList [15]” is 0 which points to the first address of the memory. Since we size 16, the [15]” is 0 which to the first address array use array to“FreeList manage the memory unit, points the value of “FreeList [15]”ofisthe the memory. subscript Since of the we firstuse memory to manage the memory unit, the value of “FreeList [15]” is the subscript of the first memory unit. unit. “FreeList [0] ”~“ FreeList [14]” are all initialized as −1. “FreeList [0]with ”~“ FreeList [14]”allocation, are all initialized −1. Along the memory release as and merge, the FreeList will record the subscript of Along with the memory allocation, release and merge, FreeList record the subscript of the the head of the free linked list with the corresponding size.the The processwill will be introduced later. head of the free linked list with the corresponding size. The process will be introduced later. (2) Data “MemoryBlock” (2) Data “MemoryBlock” Data structure “MemoryBlock” is defined as follows: Data structure “MemoryBlock” is defined as follows: typedef struct _tag_memoryblock typedef struct _tag_memoryblock { {int first; int int first; second; int second; }MemoryBlock; }MemoryBlock; MemoryBlock, memBlk[N]; MemoryBlock, memBlk[N]; “MemoryBlock” contains containsonly onlytwo twomember membervariables, variables,which whichis is used record information “MemoryBlock” used toto record thethe information of of memory units. For every memory unit, there is a “MemoryBlock”. Array “memBlk” is used to store store memory units. For every memory unit, there is a “MemoryBlock”. Array “memBlk” is used to “MemoryBlock”.The Thesize sizeofofarray array“memBlk” “memBlk”NNisisthe the amount memory units. Thus, subscript “MemoryBlock”. amount ofof memory units. Thus, thethe subscript of of array is just the serial number of Through unit. Through array subscript, the memory can be array is just rightright the serial number of unit. array subscript, the memory unit canunit be located located quickly, thatimportant is very important quick memory allocation. quickly, and that and is very for quickfor memory allocation. In order to save the internal memory used by MMAFS, the In order to save the internal memory used by MMAFS, the member member variables variables of of “MemoryBlock” “MemoryBlock” are multiplexing multiplexing according according to to the the usage usage of of memory memory units. units. No No matter matter occupied occupied or or free free block, block, it it may may are include 1, 2, or n (n is bigger than 2) basic memory units. Thus, shown in Figure 3, there are six include 1, 2, or n (n is bigger than 2) basic memory units. Thus, shown in Figure 3, there are six situations of of the the memory memory units units in in total. total. For For each each situation, situation, the the information information recorded recorded in in data data structure structure situations “MemoryBlock” is different. “MemoryBlock” is different.

Occupied Block

first

-1

first

-1

-1

first

-1

0

0

0

0

-1

second

1

second

2

2

second

6

0

0

0

0

6

(a) occupied block with 1 unit

Free Block

(b) occupied block with 2 units

(c) occupied block with 6 units

first

P

first

2

P

first

6

P

0

0

0

6

second

N

second

-1

N

second

-1

N

0

0

0

-1

(d) free block with 1 unit

(e) free block with 2 units

(f) free block with 6 units

Figure 3. Memory Block Information.

Figure 3. Memory Block Information.

allocation block with 1 units: memBlk[n].first = −1, memBlk[n].second = 1 (0 ≤ n < N), “first” is −1 means that the unit has been occupied, “second” is 1, which means that the allocation block (I) allocation withunit. 1 units: memBlk[n].first = −1, memBlk[n].second = 1 ( 0  n  N ), “first” is contains 1 block memory means that thewith unit2 has been occupied, “second” is 1, which means = that the allocation block (II) -1 allocation block units: memBlk[n].first = −1, memBlk[n].second 2; memBlk[n+1].first = contains 1 memory unit. N −1, memBlk[n+1].second = 2 (n = 2m, 0 ≤ m < 2 ) (II) allocation block with 2 units: memBlk[n].first = −1, memBlk[n].second = 2; (I)

0m memBlk[n+1].first = −1, memBlk[n+1].second = 2 (n = 2m,

N 2 )

(III) allocation block with n units: Figure 3c is the example of allocation block with 6 memory units. The meaning of “memBlk” of the first unit and the last unit is the same as (a) and (b), the value of “memBlk” of the middle units are 0.

Sustainability 2018, 10, 3562

8 of 16

Sustainability 2018, 10, x FOR PEER REVIEW

8 of 16

(III) allocation block1with units: 3c isunit, the variable example“first” of allocation block with 6 memory units. (IV) Free block with units:n For freeFigure memory and “second” are used as a pointer The meaning of “memBlk” of the first unit and the last unit is the same as (a) and (b), the value of to chain the free memory block with the same size as a two-way linked list. “First” point to the “memBlk” of the middle units are point 0. last free memory block, “second” to the next free memory block. (IV) Free block with 1 units: For free memory variable “first” and “second” are used as a pointer (V) Free block with 2 units: memBlk[n].first =unit, 2, memBlk[n].second = −1; to chain the free memory block with the same size as a two-way linked list. “First” point to the memBlk[n+1]. first, point to the previous free memory block with 2 units. last free memory block, “second” point to the next free memory block. memBlk[n+1]. second, point to the next free memory block with 2 units. (V) Free block with 2 units: memBlk[n].first = 2, memBlk[n].second = −1; memBlk[n+1]. first, point N to the previous free memory block with 2 units. memBlk[n+1]. second, point to the next free 0m N memory (n = 2m, block with22 )units. (n = 2m, 0 ≤ m < 2 ) (VI) Free block with n units: Figure 3f is the example of free block with 6 memory units. The meaning (VI) Free block with n units: Figure 3f is the example of free block with 6 memory units. The meaning of the value of “memBlk” is the same as above. of the value of “memBlk” is the same as above. (3) (3) Variable Variable“Max_Free_Block” “Max_Free_Block” Variable “Max_Free_Block” “Max_Free_Block” is is used used to to record Variable record the the maximum maximum size size of of the the free free memory memory block. block. It It is is defined defined as as follows: follows: int int Max_Free_Block; Max_Free_Block; The is shown When allocating allocating memory, memory, according The flow flow chart chart of of memory memory allocation allocation is shown in in Figure Figure 4. 4. When according to n memory units, we we look look up up array array “FreeList[n-1]” “FreeList[n − 1]” first. to the the memory memory size size required, required, for for example example n memory units, first. If If the value is not − 1, which means that the free memory linked list with the size n is not empty, and the value is not -1, which means that the free memory linked list with the size n is not empty, and the the “FreeList[n points − 1]” points to theofhead of the free memory blocklist, linked it is returned to “FreeList[n-1]” to the head the free memory block linked thenlist, it isthen returned to the user. the user. However, if the is −1, whichthat means that thelist linked with n is empty, thentorefer However, if the value is value -1, which means the linked withlist size n issize empty, then refer the to the variable “Max_Free_Block”, we will allocate memory from the maximum free memory block. variable “Max_Free_Block”, we will allocate memory from the maximum free memory block. Of Of course, after memory allocation, “FreeList” “Max_Free_Block” should updated. course, after memory allocation, “FreeList” andand “Max_Free_Block” should be be updated. start

Allocate n memory units

No

FreeList[n-1]==-1?

Yes

Return FreeList[n-1]

Return FreeList[Max_Free_Block-1]

Update “FreeList”

Update “FreeList” and “Max_Free_Block”

end

Figure 4. Flow Chart of Memory Allocation.

6.2. Algorithm Introduction 6.2. Algorithm Introduction How Suppose there there is is aa 64 How does does MMAFS MMAFS work, work, we we give give an an example example to to explain explain it. it. Suppose 64 Byte Byte serial serial memory, and the minimum memory unit is 4 Byte, therefore, the serial memory is divided into memory, and the minimum memory unit is 4 Byte, therefore, the serial memory is divided into 16 16 basic basic memory memory units. units. We We suppose suppose the the following following operations operations in in Table Table1.1.

Table 1. Operation Sequence.

Sustainability 2018, 10, 3562

9 of 16

Sustainability 2018, 10, x FOR PEER REVIEW Sustainability 2018, 10, x FOR PEER REVIEW

1 11 Allocate Allocate1 Allocate 1 Unit 1 Unit Unit 9 99 Allocate Allocate Allocate 1 1 Unit 1 Unit Unit

2 22 Allocate 2 Allocate Allocate 22 Units Units Units 10 10 10 Release Release Release Op. 1 Op. 1 Op.

9 of 16 9 of 16

Table 1. Operation Sequence.

3 33 Allocate 3 Allocate Allocate 33 Units Units Units 11 11 11 Release Release Release Op. 7 Op. 7 Op.

4 4 Allocate 2 Allocate Allocate 22 Units Units Units 12 12 Allocate 1 Allocate Allocate 11 Unit Unit Unit

5 5 Allocate Allocate1 Allocate 1 Unit 1Unit Unit 13 13 13 Release Release Release Op. 8 Op. 8 Op.

6 6 Allocate 2 Allocate Allocate 22 Units Units Units 14 14 14 Release Release Release Op. 4 Op. 4 Op.

7 77 Allocate Allocate1 Allocate 1 Unit 1 Unit Unit 15 15 15 Release Release Release Op. 6 Op. 6 Op.

8 88 Allocate 1 Allocate Allocate 11 Unit Unit Unit 16 16 16 Allocate 5 Allocate Allocate 55 Units Units Units

There are memory allocation and release operations in Table 1. After memory release, MMAFS There are memory allocation and 1. After Thereand are merge memory allocation and release release operations operations in in Table Table 1. After memory memory release, release, MMAFS MMAFS will check memory fragments. will check and merge memory fragments. will check and merge memory fragments. 1. Initialization 1. Initialization 1. Initialization Figure 5 is the initial status before MMAFS running. Figure MMAFS running. running. Figure 55 is is the the initial initial status status before before MMAFS Memory Block Memory Block 0 0

8 8

7 7

first first

16 16 memBlk[0]

0 0 memBlk[1]

memBlk[0]

second second

memBlk[1] 0

-1 -1

0

0 0

0 0

0 0

0 0

0 0

0 0

0 0

0 0

0 0

0 0

0 0

0 0

0 0

0 0

0 0

0 0

0 0

0 0

0 0

0 0

0 0

0 0

0 0

0 0

0 0

-1 -1

-1 -1

-1 -1

-1 -1

-1 -1

-1 -1

max_free_block = 16 max_free_block = 16 FreeList[0] FreeList[1] FreeList[0] FreeList[1] -1 -1

-1

-1

15 15 0 0

16 16 memBlk[15] memBlk[15]

-1 -1

Free List Free List -1 -1

-1 -1

-1 -1

-1 -1

-1 -1

-1 -1

-1 -1

FreeList[15] FreeList[15] 0

0

Figure Figure5. 5. Initial InitialStatus. Status. Figure 5. Initial Status.

According Figure 5,5,when when initialized,there there a free memory block 16 basic memory According to to is ais memory block withwith 16 basic memory units, According to Figure Figure 5, wheninitialized, initialized, there isfree a free memory block with 16 basic memory units, so there is only one linked free linked list with size 16, and the linked list has one node. “FreeList[15]” so there is only one free list with size 16, and the linked list has one node. “FreeList[15]” is units, so there is only one free linked list with size 16, and the linked list has one node. “FreeList[15]” is0 0which whichpoints pointstotothe thefirst firstmemory memoryunit. unit. “max_free_block” “max_free_block” is is 16, 16, which which records the maximum free free is 0 which points to the first memory unit. “max_free_block” is 16, which records records the the maximum maximum free memory block. “memBlk[0].first” isis16 means that the size of the free memory block isis16 memory memory block. “memBlk[0].first” 16 means that the size of the free memory block 16 memory memory block. “memBlk[0].first” is 16 means that the size of the free memory block is 16 memory units. which free. units. “memBlk[0].second” “memBlk[0].second” is is -1, − whichmeans meansthat thatthe thememory memoryblock blockis free.Note Notethat, that,the thevalue valueof of units. “memBlk[0].second” is -1,1,which means that the memory block isis free. Note that, the value of the last memory unit is same to the first memory unit, which is used for reverse traversing the twothe last last memory unit, which is used forfor reverse traversing the two-way the memory unit unitisissame sametotothe thefirst firstmemory memory unit, which is used reverse traversing the twoway linked listthe of free the free memory block. “memBlk[1].first” points to the previous node in the linked linked list of memory block. “memBlk[1].first” points to the previous node in the list, way linked list of the free memory block. “memBlk[1].first” points to the previous node in linked the linked list, “memBlk[1].second” points tonext thenode next in node in the linked list.atSince, at the beginning, thereone is “memBlk[1].second” points to the the linked list. Since, the beginning, there is only list, “memBlk[1].second” points to the next node in the linked list. Since, at the beginning, there is only one linked list with one node, they both point to themselves. linked listlinked with one node,one they boththey point to themselves. only one list with node, both point to themselves. 2. Operation 1 2. Operation 2. Operation 11 Operation Operation111allocates allocates 111 memory memory unit. unit. Figure Figure 666 shows shows the the status status after after operation operation 1. 1. Operation allocates memory unit. Figure shows the status after operation 1. 0 0

1 1

8 8

7 7

15 15

first first

-1 -1

15 15

1 1

0 0

0 0

0 0

0 0

0 0

0 0

0 0

0 0

0 0

0 0

0 0

0 0

15 15

second second

1 1

-1 -1

1 1

0 0

0 0

0 0

0 0

0 0

0 0

0 0

0 0

0 0

0 0

0 0

0 0

-1 -1

-1 -1

-1 -1

-1 -1

-1 -1

-1 -1

-1 -1

-1 -1

-1 -1

-1 -1

-1 -1

-1 -1

FreeList[14]

FreeList[15]

1 1

max_free_block = 15 max_free_block = 15 FreeList[0] FreeList[1] FreeList[0] FreeList[1] -1 -1

-1

-1

-1 -1

FreeList[14] 1

FreeList[15] -1

1

-1

Figure6. 6.Status Statusafter afterOperation Operation1. 1. Figure Figure 6. Status after Operation 1.

The progress progress of of memory memory allocation allocation refers refers to to Figure Figure 4. For this this operation, operation, memory memory block block isis The 4. For The progress of memory allocation refers to Figure 4. For this operation, memory block is allocatedfrom fromthe themaximum maximumlinked linkedlist. list.After Afteroperation operation1,1,the thememory memoryunit unitpointed pointedby by“FreeList[15]” “FreeList[15]” allocated allocated from the maximum linked list. After operation 1, the memory unit pointed by “FreeList[15]” will be be allocated. allocated. Since Sinceone oneunit unit was was allocated, allocated, the the variable variable “max_free_list” “max_free_list” changed changed to to 15, 15, which which will will be that allocated. Since one unit was allocated, the variable “max_free_list” changed tobecame 15, which means the maximum free memory block contains 15 memory units. “FreeList[15]” −1. means that the maximum free memory block contains 15 memory units. “FreeList[15]” became −1. means that the maximum free memory block contains 15 memory units. “FreeList[15]” became −1. “FreeList[14]” will will point point to to the the head head of of the the free free memory memory linked linked list list with with 15 15 units. units. For For the the memory memory “FreeList[14]” “FreeList[14]” will point to the head of the free memory linked list with 15 units. For the memory unit “memBlk[0]”, which was allocated, “memBlk[0].first” was -1, which means the memory unit was unit “memBlk[0]”, which was allocated, “memBlk[0].first” was -1, which means the memory unit was occupied, “memBlk[0].second” was 1, which means allocating 1 unit. “memBlk[1]” will become the occupied, “memBlk[0].second” was 1, which means allocating 1 unit. “memBlk[1]” will become the

Sustainability 2018, 10, x FOR PEER REVIEW

10 of 16

head of free2018, memory Sustainability 10, 3562linked list with 15 units and is pointed by “FreeList[14]”. “memBlk[2].first” 10 and of 16 “memBlk[2].second”, which will point to the previous and next node in the free memory linked list respectively. Sustainability 2018, 10, x FOR PEER REVIEW 10 of 16 unit “memBlk[0]”, which was allocated, “memBlk[0].first” was −1, which means the memory unit Sustainability 2018, 10, x FOR PEER REVIEW 10 of 16 3. Operations 2–9 was occupied, “memBlk[0].second” was 1, which means allocating 1 unit. “memBlk[1]” will become head of of free free memory memory linked linked list list with with 15 15 units units and and is pointed pointed by by “FreeList[14]”. “FreeList[14]”. “memBlk[2].first” “memBlk[2].first” and and head the head of free memory linked list with 15 units is and isthese pointed by “FreeList[14]”. “memBlk[2].first” Operations 2–9 are all allocation operations. After operations, the free status will belinked shownlist in “memBlk[2].second”, which will point to the previous and next node in the memory “memBlk[2].second”, which will point to the previous and next node in the free memory linked list and “memBlk[2].second”, which will point to the previous and next node in the free memory linked Figure 7. respectively. respectively. list respectively. 4 8 3. Operations Operations 2–9 0 2 10 14 15 1 7 3. 3. Operations 2–9 2–9 -1 -1 -1 -1 0 -1 -1 -1 -1 -1 -1 2 14 -1 -1 -1 first Operations 2–9 are are 2all all allocation allocation operations. operations. After these operations, the status status will be shown shown in in 1 7 2–9 3 5 4 6 8 9 Operations After these operations, the will be Operations 2–9 are all allocation operations. After these operations, the status will be shown second 7. 1 1 2 2 3 0 3 1 2 2 2 2 1 1 -1 14 Figure Figure 7. 7. in Figure = 22 0 max_free_block 1 0 2 1 FreeList[0] FreeList[1] -1 -1 -1 -1 -1 14

first first

1 1

second second

1 1

7 7 1 1

4 4 -1 -1 -1 2 2

2 2

2 2

8 8

7 7 -1 -1 -1

-1 -1 -1

3 3

0 -1 0

3 3 0

-1 -1 -1

-1 -1 -1

5 5

3

10 10 -1 -1 -1

1

2

4 4

14 14 -1 -1 -1

-1 -1 -1 2

0 3 1 2 2 Figure 7. Status after Operation 9.

2 2

-1 -1 -1

6 6

2 2

-1 -1 -1

-1 -1 -1

8 8

9 9

1 1

1 1

15 15 2 -1 2

FreeList[15] 14

-1 -1

14 14

14 -1

max_free_block = 2

= 2 In max_free_block Figure 7, the circle with number means the operation number. For example, the memory units FreeList[0] FreeList[1] -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 FreeList[0] FreeList[1] -1 14 -1 -1 -1 operation -1 -1 -1 -1 -1 -1 -1 -1 -1 was-1allocated marked with circle 3,-1which in 3. -1 14 -1 FreeList[15] FreeList[15]

4.

Operation 10

Figure 7. Status after Operation 9. Figure 7. 7. Status Statusafter afterOperation Operation9. 9. Figure

Operation 10 iscircle memory release operation, it releases memory allocated in operation 1. Figure 8 In Figure 7, the with number means the operation number. For example, the memory units InFigure Figure 7, 7,the thecircle circlewith withnumber numbermeans meansthe theoperation operationnumber. number. For Forexample, example,the thememory memoryunits units In shows the status after operation 10. marked with circle 3, which was allocated in operation 3. marked with with circle circle 3, 3, which which was was allocated allocated in in operation operation 3. 3. marked 4. 4. 4.

4 8 Operation 10 0 10 14 15 1 7 Operation 102 Operation 10 -1 0 -1 -1 -1 0 -1 -1 -1 -1 -1 2 14 -1 -1 -1 Operation 10 is memory release operation, itit 5releases releases memory allocated in operation 1. Figure Operation710 10 is is memory memory release operation, operation, releases memory allocated in8operation operation 1. Figure Figure 888 2 3 4memory allocated 6 9 Operation release it in 1. 0 status 2 operation 2 310. 3 2 2 2 2 -1 14 second the 1 after 1 1 1 shows shows the status after operation 10. 0 shows the status after operation 10.

first

first first

= 22 0max_free_block 1 0 2 1 -1 FreeList[0] FreeList[1] 0 -1 00 14

second second

4 4 -1 -1 -1

7 7

0 0

2 2

1 1

2 2

8 8

7 7

-1 -1 -1

-1 -1 -1

0 -1 0

2 2

3 3

0 0

3 3

-1 -1 -1

-1 -1 -1

3 3

1 1

10 10 -1 -1 -1

5 5

2 2

4 4

14 14

-1 -1 -1

-1 -1 -1

2 2

2 2

Figure 8. Status after Operation 10.

6 6

-1 -1 -1

-1 -1

-1 -1 -1

2 2

8 8 1 1

9 9

15 15

1 1

2 -1 2

Free[15] 14

-1 -1

14 14

14 -1

max_free_block = 2

max_free_block = 2 After operation 10, the memory unit pointed by “memBlk[0]” was released. Thus, there is a free FreeList[0] FreeList[1] -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 FreeList[0] FreeList[1] 14 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 memory 00block 14with one unit. Compare Figure 8 with Figure 7, where there are two differences. First, -1 the “memBlk[0].first” is 0, which theOperation previous Figurepoints 8. Status Statusto after 10. node in the linked list, the Figure 8. after Operation 10. Figureto8. the Status after Operation 10. “memBlk[0].second” is 0, which points next node in the linked list. Second, “FreeList[0]” is 0, which means the head of free memory linked list with one memory unit 0, whichThus, is thethere first memory After operation operation 10, 10, the the memory memory unit unit pointed pointed by by “memBlk[0]” “memBlk[0]” was wasis released. Thus, there is aafree free After released. is After operation 10, the memory unit pointed by “memBlk[0]” was released. Thus, there is a free unit. From Figure 9 we can see that after this memory release, we need not to merge memory memory block with one unit. Compare Figure 8 with Figure 7, where there are two differences. First, memory block block with with one one unit. unit. Compare Compare Figure Figure 88 with with Figure Figure 7, 7, where where there there are are two two differences. differences. First, First, memory fragments and the maximum free memory block is still 2previous units. the “memBlk[0].first” is 0,iswhich points to the previous node in the linked list, the “memBlk[0].second” the “memBlk[0].first” 0, which points to the node in the linked list, the the “memBlk[0].first” is 0, which points to the previous node in the linked list, the is 0, which points to the next node in thetolinked list.node Second, “FreeList[0]” is 0, which means the head “memBlk[0].second” is 0, which points the next in the linked list. Second, “FreeList[0]” is 0, 5. Operation 11 “memBlk[0].second” is 0, which points to the next node in the linked list. Second, “FreeList[0]” is 0, of free memory linked list with one memory unit is 0, which is the first memory unit. From Figure which means means the the head head of of free free memory memory linked linked list list with with one one memory memory unit unit is is 0, 0, which which is is the the first first memory memory9 which Operation 11 releases the memory allocated in to operation 7. Figure 9 shows thethestatus after we can see that after this memory release, we need not merge memory fragments and maximum unit. From From Figure Figure 99 we we can can see see that that after after this this memory memory release, release, we we need need not not to to merge merge memory memory unit. operation 11. free memory is still 2 units. fragments andblock the maximum maximum free memory memory block block is is still still 22 units. units. fragments and the free 5. Operation Operation 11 2 4 8 0 10 14 15 1 7 5. 11 Free[15] Free[15]

0 -1 -1 -1 2 0 -1 -1 -1 -1 2 0 -1 -1 -1 Operation 11 releases the memory memory allocated in operation 7.-1 Figure Figure shows the status after Operation 11 releases the allocated 7. 99 shows 2 3 5 in operation 4 6 8 9 the status after operation 11. 14 -1 2 2 3 3 2 2 2 2 -1 14 second 0 1 1 1 operation 11.

first

0 max_free_block 1 0 1

first first second second

= 22

4 4

2

FreeList[0] FreeList[1]

2 -1 2

0 00

-1 -1

-1 -1

14 14

2 2

2 2

8 8

7 7

-1 -1 -1

-1 -1 -1

2 2

3 3

-1 -1

-1 -1

0 -1 0

10 10

-1 -1 -1

-1 -1 -1

0

3

1

2

-1 -1

-1 -1

-1 -1

-1 -1

3 3

5 5

-1 -1

4 4

14 14

-1 -1 -1

-1 -1 -1

2

2

3 2 2 0 1 Figure 9. Status Status after Operation 11. 2 Figure 9. after Operation 11.

6 6

15 15

-1 -1

-1 -1 -1

-1 -1 -1

2 2

8 8 1 1

9 9 1 1

-1 -1

-1 -1

-1 -1

-1 -1

2 -1 2

Free[15]

0 -1 0

14 14

max_free_block = 2 max_free_block = 2 FreeList[0] FreeList[1] FreeList[0] FreeList[1] -1 0

-1

0

-1 -1

-1 -1

Figure 9. Status after Operation 11. Figure 9. Status after Operation 11.

-1 -1

-1 -1

Free[15] Free[15]

-1 -1

Sustainability 2018, 10, 3562

11 of 16

Sustainability 2018, 10, 5. Operation 11 x FOR PEER REVIEW

11 of 16

Sustainability 2018, 10, PEER the REVIEW Operation 11x FOR releases memory

11 after of 16 in operation 7. Figure and 9 shows the statuscan Operation 11 released “memBlk[1]”, allocated free memory unit “memBlk[0]”, “memBlk[1]” be operation merged to11. a free memory block with 2 units. Since the “FreeList[1]” is not -1, which means the free Operation 11 released “memBlk[1]”, free memory unit “memBlk[0]”, and “memBlk[1]” can be Operation “memBlk[1]”, freeso memory “memBlk[1]” be memory linked 11 listreleased with 2 units is not empty, the newunit free“memBlk[0]”, memory blockand should be placedcan in the merged to a free memory block with 2 units. Since the “FreeList[1]” is not -1, which means the free merged to a free memory block with 2 units. Since the “FreeList[1]” is not − 1, which means the free corresponding linked list, and we place it in the head of the linked list. Additionally, when allocating memory list with units is not so memory linked linkedthe listlinked with22list, units notempty, empty, so the the new new free free memory memory block block should should be be placed placedin in the the memory from we is allocate it from the head. corresponding linked list, and we place it in the head of the linked list. Additionally, when allocating corresponding linked list, and we place it in the head of the linked list. Additionally, when allocating memory from linked 6. Operations memory from the the12–16 linked list, list, we we allocate allocate it it from from the the head. head.

6. 6.

Operations 12–16 According to MMAFS algorithm, after operations 12–16, the status will be shown in Figure 10. Operations 12–16 According to after 12–16, 10. According to2 MMAFS MMAFS algorithm, algorithm, after operations operations 12–16, the the status status will will be be shown shown in in14 Figure Figure 4 8 0 15 10. 1 7

first second first

-1 0

12

1

-11

1

2

11

-1

2 -1

-12

4

-1

1

1

-13

FreeList[0] FreeList[1]

FreeList[0] FreeList[1]

1

14

00

-1

-1 7 -13

3

5 -11

8

-1

0

0

0

-1

5 -1

00

00

5

-1

9

16 00

-15

-11

2

3

0

3

1

5

0

0

0

5

1

-1

-1

-1

-1

-1

-1

-1

-1

-1

-1

-1

-1

-1

-1

-1

-1

-1

-1

-1

-1

Figure 10. Status after Operation 16.

-1

14

2

15

14

2-1

14 14

-1

14

9

16

2

Max_free_block = 2 Max_free_block 1 14 = 2

0

3

2

12

second

-1

2

-1

-1

-1

-1

-1

FreeList[15]

-1 FreeList[15]

-1

Figure 10. 10. Status Statusafter after Operation Operation16. 16. Figure

Through above example, we introduced the process of memory allocation, release and merging of MMAFS. We can see that the algorithm is simple and highly efficient. Theand following part Through above example, weMMAFS introduced the process of memory allocation, release merging of Through above example, we introduced the process of memory allocation, release and merging will analyze its performance in detail.algorithm is simple and highly efficient. The following part will MMAFS. We can see that the MMAFS of MMAFS. We can see that the MMAFS algorithm is simple and highly efficient. The following part analyze its performance in detail. will analyze its performance in detail. 6.3. MMAFS Algorithm Analysis 6.3. MMAFS Algorithm Analysis 6.3. MMAFS Analysis RunningAlgorithm efficiency and space utilization rate are two important evaluation standards for Running efficiency and space utilization are two evaluation for memory memory management algorithms. Taking intorate account theimportant segregated lists and standards buddy algorithms are Running efficiency and space utilization rate are two important evaluation standards for management algorithms. into account the segregated listsmake and them buddyasalgorithms are compare classical, classical, widely used, andTaking many memory algorithms nowadays reference, we memory management algorithms. Taking into account the segregated lists and buddy algorithms are widely many algorithms nowadays makecomplexity them as reference, we allocation compare MMAFS MMAFSused, withand these two memory algorithms. In this section, the time of memory and the classical, widely used, and many memory algorithms nowadays make them as reference, we compare with these two algorithms. In this section, the time complexity of memory allocation and the space space utilization rate among MMAFS, Buddy, and Segregated lists algorithms are compared and MMAFS with these two algorithms. In this section, the time complexity of memory allocation and the utilization rate MMAFS, Buddy, and Segregated lists algorithms are are compared and analyzed, analyzed, and among the performance of MMAFS and Buddy algorithms compared through space utilization rate among MMAFS, Buddy, and Segregated lists algorithms are compared and and the performance of MMAFS and Buddy algorithms are compared through experiments. experiments. analyzed, and the performance of MMAFS and Buddy algorithms are compared through (1) Comparative experiments. Comparative analysis analysis of of time time complexity complexityand andspace spaceutilization utilization the of (1) Comparative of time complexity and space utilization Table 22 shows showsanalysis the features features of these these algorithms. algorithms. Table 2 shows the features these algorithms. Table 2.of Comparison of storage management algorithms.

Table 2. Comparison of storage management algorithms.

Feature Algorithm

Feature Algorithm MMAFS

MMAFS

segregated lists

segregated buddy lists

Time Complexity of Table 2. Comparison of storage management algorithms. Space Utilization Rate Memory Allocation Time Complexity (1) No external fragmentation. of Memory Space isUtilization (2) Internal fragmentation smaller thanRate the basic memory unit. O(1) or O(2) (3) Merge fragmentation. Allocation (4) external Memory release quickly. (1) No fragmentation. (1) No external fragmentation. (2) Internal fragmentation is smaller than the basic memory unit. O(1) or O(2) (2) Larger internal fragmentation for fixed size memory block. (3) Merge fragmentation. O(r) (3) Need not merge fragmentation. (4) Memory release quickly. (4) Memory release quickly. (1) No fragmentation. (1) external No external fragmentation. (2) Larger internal fragmentation for than fixedthe size memory (2) Internal fragmentation is smaller basic memoryblock. unit. k O(r) O(logn) (n = 2 ) (3) Need not merge fragmentation. (3) Merge fragmentation. (4) Memory release quickly. (4) Memory release quickly.

(1) same No external memory block size. k—the number of times memory split. r—r—number number ofofmemory blockwith with same size. kfragmentation. —max the max number ofoftimes of memory split. (2) Internal fragmentation is smaller than the basic memory unit. buddy O(logn) (n = 2k) (3) Merge fragmentation. From Table 2, the time complexity of memory allocation of MMAFS is O(1) or O(2). The quickly.n memory units, “FreeList[n₋1]” or allocation process is shown in Figure(4)5.Memory When release we allocate r—number of memorywill block same size. k—the max number of times oflists memory “FreeList[max_free_block₋1]” bewith returned. Compared with segregated and split. buddy, the allocation speed of MMAFS is faster and more stable. When allocating memory, MMAFS can return

Sustainability 2018, 10, 3562

12 of 16

From Table 2, the time complexity of memory allocation of MMAFS is O(1) or O(2). The allocation process is shown in Figure 5. When we allocate n memory units, “FreeList[n − 1]” or “FreeList[max_free_block-1]” will be returned. Compared with segregated lists and buddy, the allocation speed of MMAFS is faster and more stable. When allocating memory, MMAFS can return the memory immediately. For the space utilization rate, MMAFS is of the best features. It has no external fragmentation, and the controllable internal fragmentation is not larger than the basic memory unit. In addition, it provides the function of memory release and merging, which increases the space utilization rate greatly. According to above introduction and analysis to MMAFS, it has the following advantages: 1. 2. 3.

4. 5.

Universal use: The input of MMAFS is a large block of serial memory, which has nothing to do with the memory type or size. Thus, the algorithm is universal. Complete function: MMAFS has the functions of memory allocation, release, and merging. Run quickly: MMAFS can allocate, release, and merge memory quickly. MMAFS algorithm uses array “memBlk” to manage memory units. Through the subscript of array, the memory unit can be located quickly. In addition, by the value of variable “memBlk[n].first” and “memBlk[n].second”, the free memory block with the same size are linked to be two-way linked list. Additionally, use array “FreeList” is used to record the head of these linked lists. This enables the appropriate free memory block to be found quickly. When releasing memory, according to the array subscript, we can locate the memory units before and after the released memory block immediately, and judge whether these memory units can be merged or not. Thus merge memory units quickly. For free memory block, we just place it in the corresponding linked list to finish memory retrieval. The process is simple and fast. Low memory fragmentation: MMAFS has not external fragmentation. The internal fragmentation of MMAFS is small and controllable, which is determined by the size of the memory unit. High memory utilization rate: MMAFS has a low memory fragment. Moreover, it provides the function of memory defragmentation. Thus, it can make full use of the memory.

(2) Comparison of experimental results Experimental environment: Computer Model: Dell Latitude E6440; CPU: Intel(R) Core(TM) i7-4610M CPU @ 3.00 GHz; Memory: 8.00 G; Operating System: Windows 7 SP1 64 bit. Experimental method: First allocate 2 MB of continuous storage space from memory as the object of management, then use MMAFS algorithm and Buddy algorithm to allocate, release, and merge the storage space, and record the completion time of the operation. For the MMAFS algorithm, the storage space of 2 MB is divided into 216 32B storage units for management. (I) Storage allocation speed comparison The MMAFS algorithm and Buddy algorithm are used for 400, 4000, and 40,000 storage allocations, respectively, to record the allocated time. The results are shown in Table 3 and Figure 11. Table 3. Comparison of storage allocation performance between MMAFS and Buddy. Algorithm

400 Times

4000 Times

40,000 Times

Buddy MMAFS

0.29 ms 0.22 ms

3.62 ms 2.15 ms

44.28 ms 22.19 ms

Sustainability Sustainability 2018, 10,2018, 356210, x FOR PEER REVIEW

13 of 1316 of 16

40 40

(Millisecond)

Time consuming 分配时间(毫秒)

50 50

30 30 20 20 10 10 0 400 400次

4000 4000次

40000 40000次

Storage存储分配次数(次) allocation times (Times) Buddy

MMAFS

Figure 11. Comparison of storage allocation performance between MMAFS and Buddy. Figure 11. Comparison of storage allocation performance between MMAFS and Buddy.

According to Table 2 and Figure 11, the MMAFS algorithm is faster than the Buddy algorithm. According to Table 2 and Figure 11, the MMAFS algorithm is faster than the Buddy algorithm. This is because the Buddy algorithm needs to split many times to find the right size of the storage block, This is because the Buddy algorithm needs to split many times to find the right size of the storage each time the allocation of time is variable, but MMAFS algorithm can quickly find the appropriate block, each time the allocation of time is variable, but MMAFS algorithm can quickly find the free block by arrayfree subscript positioning and then finish the storage immediately. appropriate block by array subscript positioning and allocation then finishofthe allocation of storage In addition, the time consumed in each allocation in MMAFS is relatively fixed, so the speed of so memory immediately. In addition, the time consumed in each allocation in MMAFS is relatively fixed, the allocation is faster. The stability alsoofexplains relationship allocation speed of memory allocationofisallocation faster. The time stability allocationthat timethe also explains thatbetween the relationship between allocation and allocation timeinofTable MMAFS algorithmlinearly, in Tablethe 3 increases the times and allocation timetimes of MMAFS algorithm 3 increases numberlinearly, of allocations number of allocations increases 10 timesalmost and the10time consumed almost 10 times. increases 10 times and the time consumed times. (II) Overall performance comparison (II) Overall performance comparison The overall performance comparison is a comprehensive test of the algorithm allocation, release,

The overall performance comparison is a comprehensive test of the algorithm allocation, release, merge, and other functions, because the merge functions of the two algorithms are automatically merge, and other functions, because the merge functions of the two algorithms are automatically included in the process of storage release, so only the allocation and release functions need to be included in the process of storage release, so only the allocation and release functions need to be called. called. Similarly, the MMAFS algorithm andand Buddy algorithm for 400, 400,4000, 4000,and and 40,000 Similarly, the MMAFS algorithm Buddy algorithmwere were used used for 40,000 comprehensive tests tests of storage allocation release,respectively, respectively, to record the elapsed time. comprehensive of storage allocationand and release, to record the elapsed time. The results shownininTable Table44 and and Figure The results areare shown Figure12. 12. 4. Comparison of MMAFS and Buddyoverall overallperformance. performance. TableTable 4. Comparison of MMAFS and Buddy

Algorithm 400 Times Algorithm 400 Times Buddy 0.35 ms Buddy msms HESMA 0.35 0.26 Sustainability 2018, 10,HESMA x FOR PEER REVIEW 0.26 ms

4000 Times 40,000 Times 4000 Times 40,000 Times 3.88 ms 45.03 ms 3.88 ms ms 45.03 ms 2.33 22.84 ms 2.33 ms 22.84 ms

14 of 16

Time consuming (Millisecond)

5050 4040 3030 2020 1010 00 400 400次

4000

40000

4000次

40000次

Storage allocation times (Times) Buddy

MMAFS

Figure 12. Comparison of MMAFS and Buddy overall performance. Figure 12. Comparison of MMAFS and Buddy overall performance.

According to Table 4 and Figure 12, the release and merge speeds of the MMAFS and Buddy algorithms are very fast, and the processing speed is mainly determined by the storage allocation speed. Therefore, the comprehensive performance comparison results are similar to the storage allocation performance comparison results. 7. Case Study

Sustainability 2018, 10, 3562

14 of 16

According to Table 4 and Figure 12, the release and merge speeds of the MMAFS and Buddy algorithms are very fast, and the processing speed is mainly determined by the storage allocation speed. Therefore, the comprehensive performance comparison results are similar to the storage allocation performance comparison results. 7. Case Study Guangxi Hepu Fucheng Middle School is located in Guangxi Hepu County and Hepu County is relatively backward in economy among national counties. Fucheng Middle School, as a representative case, can reflect the current situation of the current rural primary and middle schools in computer teaching investment to a great degree. Basic teaching condition of Fucheng Middle School is as follows: Fucheng Middle School includes senior high school and junior middle school, of which three grades in senior classes and eight classes for each grade; three grades for junior classes and six classes for each grade and about 45 people for each class and there is only one computer room with 45 computers in the whole school. Senior high school and junior middle school students all have computer classes, mainly about use of Windows operation system, use of Office software and basic programming; in online practice, online time of senior high school, and junior middle school is similar and two-class-hour online practice shall be arranged for each student after statistics. According to current condition of Fucheng Middle School, there are 42 classes in total and each class shall have two-class-hour computer class and 42 × 2 = 84 class-hour classes shall be arranged for each week, while there is only one computer room in Fucheng Middle School and a computer room can be arranged with 40 class hours per week to the maximum according to five days classes per week and eight class hours per day, which cannot satisfy half the demand of students. Due to the limited equipment, Fucheng Middle School has to change link of online practice and to reduce two class hours per week to one class hour per week, which cannot reach expected teaching effect for strong-practicability computer class. There is condition after adopting central-kitchen model. First is capital investment and there are 45 computers with the same configuration in Fucheng Middle School and the total investment of Fucheng Middle School for computer teaching equipment is calculated as RMB 4000 × 45 = 180,000, namely, the total price RMB 180 thousand according to the price of middle-grade desktop computer on the market—estimated as almost RMB 4000 for each computer. Second is configuration of equipment and the price of a high-end server is about RMB 15,000; of course, there are more expensive ones, while it is unnecessary for school teaching. Taking IBM server 3650M4 for example, the price is RMB 15,300, with configuration: 4 core CPU 1.8 G; 16 DDR3 memory; hardware IBM 1 TB 7.2 K 6 Gbps SAS2.5, the number of revolutions of standard configuration hardware: 15,000 revolutions, the number of standard configuration hardware: eight, which can be expanded to 16 and a four giga network cards. Client terminal adopts diskless workstation and price of a diskless workstation is RMB 1000. Client terminal connects with the server by interchanger and the price change of interchanger is relatively large; taking Huawei Interchanger for example, middle-class Huawei Interchanger, such as S5700-24TP-SI(AC), is gigabit Ethernet interchanger with 256 Gbps backboard bandwidth, 24 ports, mpps 72 Mpps, and the price is RMB 3300. Low-class Huawei switch S1724G also supports giga transmission rate with 48 Gbps backboard bandwidth, 24 ports, mpps 36 Mpps, and the price is RMB 750. According to practical demand of Fucheng Middle School, it is obvious that a computer room is insufficient and 90 client terminals are required at least, i.e., 90 diskless workstations. How many servers can meet remote login request of 90 workstations? Maximal connection number of each server is related to performance of server; according to performance of IBM server 3650M4, because of four-core CPU and 16 G memory. Generally, a core can dispose eight remote connections and four cores distribute 32 connections, while 16 G memory is sufficient for 32 connections; therefore, three servers are enough and one server is increased, in consideration of redundant backup, to four in total. In addition, in order to improve the performance of LAN and reduce the conflict of the Ethernet,

Sustainability 2018, 10, 3562

15 of 16

workstations and servers shall be connected to the interchanger and one S1724G Huawei interchanger has 24 ports and 94 devices in total shall be connected to the interchanger, so four interchangers shall be purchased. According to foresaid analysis, central-kitchen model is adopted and purchase equipment list is shown in Table 5 to meet the computer teaching of Fucheng Middle School: Table 5. Equipment Purchase List. Equipment Name

Number

Unit Price (Yuan)

Total price (Yuan)

IBM Server 3640M4 Diskless workstation Huawei Interchanger S1724G

4 90

15,300 1000

61,200 90,000

4

750

3000

Overhead

154,200

It can be seen from Table 5 that overhead of purchased equipment is RMB 154.2 thousand, which not only satisfies teaching demand of Fucheng Middle School and ensures two-class-hour online time of each student per week, but also saves cost and saves the expense of RMB 25.8 thousand. Therefore, the central-kitchen model proposed in this paper is feasible. 8. Conclusions This paper established an architecture of applied value for design education in rural areas. The central-kitchen model meets the requirements of computer-aided learning in the educational milieu, as it allows for close interactions among students, computers, and teachers, which helps to resolve the problems associated with design education in the elementary and high schools of rural areas. As an important role in central-kitchen model, the MMAFS algorithm we designed, is universal, complete function, run quickly, low memory fragmentation, and high memory utilization rate, which ensures the efficiency of the central-kitchen model and it can be widely promoted. The central-kitchen model is of good sustainability. First, it uses the traditional network application structure the C/S. Which is the basic model of the network application and can never be eliminated by time. Second, we focus on the efficiency of storage resources, by improving the allocation speed of storage resources, and improve the space utilization of storage resources, thereby improving the performance and efficiency of the server. Taking into account the actual situation of people, technology, and economy in rural areas, this can be said to grasp the core of the problem. Last, compared with other resources, the management of storage resources is relatively independent. We only need to know the first address and size of storage space, we can use MMAFS algorithm to manage it. It has good reliability and portability, independent of platform. Thus, it can be applied to many occasions. Through the case study of Fucheng Middle School, the model which we established can satisfy the teaching demand and ensures two-class-hour online time of each student per week, but also saves the cost, which also proved the feasible of our model. Given the large number of urgent and pertinent issues in developing countries and rural communities, basic design education should be emphasized, which will promote local designs and eventually formulate positive loops in rural ecosystems to resolve local problems. Author Contributions: Data curation, B.-J.Z.; Formal analysis, X.-M.Z. and Y.X.; Investigation, X.-M.Z.; Resources, Y.X.; Software, B.-J.Z.; Supervision, K.-K.F.; Writing—original draft, X.-M.Z.; Writing—review & editing, K.-K.F. Funding: This research received no external funding. Conflicts of Interest: The authors declare no conflict of interest.

Sustainability 2018, 10, 3562

16 of 16

References 1. 2.

3. 4. 5. 6. 7. 8. 9.

10. 11. 12. 13. 14. 15. 16. 17. 18.

Davies, W.; Cormican, K. An Analysis of the Use of Multimedia Technology in Computer Aided Design Training: Towards Effective Design Goals. Procedia Technol. 2013, 9, 200–208. [CrossRef] Brown, E.F.; Cooper, S.G.; Ford, S.; Aouad, G.; Brandon, P.; Child, T.; Kirkham, A.J.; Oxman, R.; Young, B. An integrated approach to CAD: Modelling concepts in building design and construction. Des. Stud. 1995, 16, 327–347. [CrossRef] Rahimian, F.; Ibrahim, R. Impacts of VR 3D sketching on novice designers’spatial cognition in collaborative conceptual architectural design. Des. Stud. 2011, 32, 255–291. [CrossRef] Tovey, M. Drawing and CAD in industrial design. Des. Stud. 1989, 10, 24–39. [CrossRef] Tovey, M.; Owen, J. Sketching and direct CAD modelling in automotive design. Des. Stud. 2000, 21, 569–588. [CrossRef] Lee, S.; Yan, J. The impact of 3D CAD interfaces on user ideation: A comparative analysis using SketchUp and Silhouette Modeler. Des. Stud. 2016, 44, 52–73. [CrossRef] Li, K.; Tiwari, A.; Alcock, J.; Garcia, B.P. Categorisation of visualisation methods to support the design of Human Computer Interaction Systems. Appl. Ergon. 2016, 55, 85–107. [CrossRef] [PubMed] Vogel, J.J.; Vogel, D.S.; Cannon-Bowers, J.; Bowers, C.A.; Muse, K.; Wright, M. Computer gaming and interactive simulations for learning: A meta-analysis. J. Educ. Comput. Res. 2006, 34, 229–243. [CrossRef] ˙ Tüzün, H.; Yılmaz-Soylu, M.; Karaku¸s, T.; Inal, Y.; Kızılkaya, G. The effects of computer games on primary school students’ achievement and motivation in geography learning. Comput. Educ. 2009, 52, 68–77. [CrossRef] Kang, L. Social Design as a Creative Device in Developing Countries: The Case of a Handcraft Pottery Community in Cambodia. Int. J. Des. 2016, 10, 65–74. Schultz, T. Investment in human capital. Am. Econ. Rev. 1961, 51, 1–17. Wang, J.; Li, Y. Research on the quality of compulsory education teaching in western rural schools. Educ. Res. 2008, 2, 21–31. Wang, D. The dilemma of time: Student-centered teaching in the rural classroom in China. Teach. Teach. Educ. 2011, 27, 157–164. [CrossRef] Cohen, D.; Hill, H. Instructional policy and classroom performance: The mathematics reform in California. Teach. Coll. Rec. 2000, 102, 294–343. [CrossRef] James, J. New Technology in Developing Countries: A Critique of the One-Laptop-Per-Child Program. Soc. Sci. Comput. Rev. 2010, 28, 381–390. [CrossRef] Green, L.N.; Bonollo, E.; UNESCO International Centre for Engineering Education. Studio-based Teaching: History and Advantages in the Teaching of Design. World Trans. Eng. Technol. Educ. 2003, 2, 269–272. Lewis, W.P.; Bonollo, E. An Analysis of Professional Skills in Design: Implications for Education and Research. Des. Stud. 2002, 23, 385–406. [CrossRef] Boucharenc, C. Research on Basic Design Education: An International Survey. Int. J. Technol. Des. Educ. 2006, 16, 1–30. [CrossRef] © 2018 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).

Suggest Documents