WO2008044865A1 - Device and method for allocating memory of terminal device - Google Patents

Device and method for allocating memory of terminal device Download PDF

Info

Publication number
WO2008044865A1
WO2008044865A1 PCT/KR2007/004933 KR2007004933W WO2008044865A1 WO 2008044865 A1 WO2008044865 A1 WO 2008044865A1 KR 2007004933 W KR2007004933 W KR 2007004933W WO 2008044865 A1 WO2008044865 A1 WO 2008044865A1
Authority
WO
WIPO (PCT)
Prior art keywords
memory
page
pages
allocating
data
Prior art date
Application number
PCT/KR2007/004933
Other languages
French (fr)
Inventor
Jong Bae Kim
Hoo Jong Kim
Original Assignee
Sk Telecom Co., Ltd.
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sk Telecom Co., Ltd. filed Critical Sk Telecom Co., Ltd.
Publication of WO2008044865A1 publication Critical patent/WO2008044865A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04BTRANSMISSION
    • H04B1/00Details of transmission systems, not covered by a single one of groups H04B3/00 - H04B13/00; Details of transmission systems not characterised by the medium used for transmission
    • H04B1/38Transceivers, i.e. devices in which transmitter and receiver form a structural unit and in which at least one part is used for functions of transmitting and receiving
    • H04B1/40Circuits
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/10Providing a specific technical effect
    • G06F2212/1041Resource optimization
    • G06F2212/1044Space efficiency improvement

Definitions

  • the present invention relates, in general, to a device and method for allocating memory of a terminal device, and, more particularly, to a device and method for allocating memory of a terminal device, which can rapidly allocate memory and prevent fragmentation.
  • Mobile terminals are devices that can make wireless access within service areas formed by base stations, and immediately perform communication with counter parties other parties while being freely carried regardless of time and place. Since the mobile terminals are always carried and moved by users, the mobile terminals have special features in that they are generally manufactured to have small size and light weight, and thus a large amount of resources, including memory, cannot be constructed therein.
  • CPU Central Processing Unit
  • ROM nonvolatile Random Access Memory
  • RAM volatile Random Access Memory
  • nonvolatile memory when data or a program, basically required for the operation of a mobile terminal, is recorded therein, the data or program is semi-permanently recorded so that it is not erased even when the supply of operating power is cut off.
  • volatile memory a program and data, temporally required for the operation of the mobile terminal, are recorded. The recorded data is removed when operating power is cut off.
  • volatile memory is shared memory called a "heap", and is divided into an area for programs essential for system operation, and an area for application programs. Heap memory is allocated to and used by a processor. When the use of heap memory is completed, the heap memory is returned and reused. Therefore, a plurality of programs can efficiently share limited memory capacity.
  • FIGS. IA to 1C are views showing a method of allocating memory according to an embodiment of the prior art.
  • the total size of heap memory 10 is 10 Mbytes, and multiple application programs request respective desired memory sizes.
  • Mbyte are allocated to and occupied by respective application programs. Therefore, data is recorded and a memory size of 2 Mbyte remains free in a waiting state.
  • FIGS. 2 A to 2D are views showing a method of allocating memory according to another embodiment of the prior art.
  • memory is divided into a plurality of blocks of the same size, and the resulting blocks are allocated to respective application programs according to a best- fit policy, a worst- fit policy, and a first-fit policy at the requests of the application programs.
  • the total memory area is divided into a plurality of blocks, and the blocks are allocated to and occupied by respective application programs.
  • the blocks, in which data is recorded, are hatched in the drawing.
  • [16] For example, the case in which another application program requests the allocation of a memory area having one block size will be described according to the respective policies.
  • the best-fit policy is a policy of searching memory 10 using an allocator, that is, searching for empty chunks in which data is not recorded and which are in a waiting state, searching for a chunk memory area having a size of one block in a waiting state, and allocating the found chunk memory area.
  • an allocator that is, searching for empty chunks in which data is not recorded and which are in a waiting state, searching for a chunk memory area having a size of one block in a waiting state, and allocating the found chunk memory area.
  • the worst- fit policy is a policy of allocating the largest chunk memory area from among chunk memory found by an allocator. According to this policy, although memory can be rapidly allocated, the allocated chunk memory contains four blocks, so that one block is allocated, as requested, and three blocks remain. Therefore, when the total runtime is long, there is a problem in that fragmentation seriously increases.
  • the first- fit policy is a policy of allocating the first chunk memory found by an allocator. According to this policy, the allocation of memory can be also rapidly performed. However, since the allocated chunk memory contains two blocks, memory having a single block is allocated, so that the remaining one block is subjected to fragmentation. Therefore, when the total runtime is long, there is a problem in that fragmentation increases.
  • an object of the present invention is to provide a device and method for allocating memory of a terminal device, in which heap memory is divided in two steps, and is allocated and withdrawn at the request of a processor, so that division is not performed on a memory area occupied by the processor and fragmentation does not occur.
  • the present invention provides a device for allocating the memory of a terminal device, including: a memory unit for recording the operational data of a running program in an allocated area, and erasing data from a returned area; a memory allocation unit for dividing the area of the memory unit into a plurality of pages, dividing each of the pages into a plurality of blocks, classifying the resulting blocks into one or more allocation blocks, in which data is recorded, and one or more empty blocks, in which data is not recorded, and managing the classified blocks; and a control unit for controlling the memory allocation unit, searching for and allocating pages each having an empty block of the size requested by a program, and recording the data of the program in an empty block area of the allocated page.
  • the present invention provides a method of allocating the memory of a terminal device, including: dividing memory into a plurality of pages of the predetermined size; dividing each of the plurality of pages into a plurality of blocks, classifying the resulting blocks into one or more allocation blocks, in which data is recorded, and one or more empty blocks, in which data is not recorded, and managing the classified blocks; and, when the allocation of memory is requested, checking pages each having the requested empty block size, and allocating the pages in predetermined order.
  • the present invention provides a method of allocating the memory of a terminal device, including: checking and requesting the memory size required for recording the data of an application program being executed; searching for pages having the requested memory size and allocating one of the found pages; if the single empty block size of the allocated page does not correspond to the requested memory size, allocating another page; and allocating the empty block of the allocated page, recording data, and returning the allocated block and the allocated page when the operation of the program is terminated.
  • FIGS. IA to 1C are views showing a method of allocating memory according to an embodiment of the prior art
  • FIGS. 2A to 2D are views showing a method of allocating memory according to another embodiment of the prior art
  • FIG. 3 is a function block diagram showing the memory allocation device of a terminal device according to an embodiment of the present invention.
  • FIG. 4 is view showing the state of the memory allocation of a terminal device according to the embodiment of the present invention.
  • FIG. 5 is a flowchart showing a method of allocating memory of a terminal device using a memory allocator according to an embodiment of the present invention.
  • FIG. 6 is a flowchart showing a method of allocating memory of a terminal device using a control unit according to an embodiment of the present invention.
  • Mode for the Invention
  • FIG. 3 is a functional diagram showing the memory allocation device of a terminal device according to an embodiment of the present invention.
  • the device for allocating memory of a terminal device includes a memory unit 110 for recording data, created as a result of the operation of programs, in an allocated area, a memory allocator 110 for dividing the area of the memory unit into a plurality of pages, dividing each of the pages into a plurality of blocks, and managing the resulting blocks, and a control unit 120 for controlling the memory allocator and directly recording data in the block of a page having an empty space for recording data.
  • the memory allocator 110 includes a block management unit 112 and a page management unit 114.
  • the capacity or size of the memory unit 100, provided in a mobile terminal in an embedded manner, is limited by the mobility and portability of the mobile terminal.
  • a plurality of application programs is simultaneously executed in a mobile terminal in order to operate various types of added services, in addition to communication.
  • data are created.
  • the created data or required data, such as parameters should be recorded in allocated areas and then be managed.
  • the data, created when the plurality of programs is executed, or data, such as parameters, required to execute the programs, should be recorded using the limited capacity of a memory unit.
  • the memory is divided into a plurality of areas having a predetermined size, the resulting areas are rapidly allocated, and the areas, the use of which is terminated, are returned, withdrawn and then reallocated.
  • the present invention provides technique for preventing fragmentation during the above-described process so that unavailable areas are not formed.
  • the page management unit 114 of the memory allocator 110 divides memory capacity provided in the memory unit 100 into a plurality of pages having the predetermined size, and then manages the resulting pages.
  • the block management unit 112 divides each of the pages of the memory, obtained by the page management unit 114, into a plurality of blocks, and then manages the resulting blocks. The block management unit 112 determines whether each of the blocks being managed is an allocation block in which data is recorded, or an empty block in which data is not recorded.
  • control unit 120 checks the necessary memory size, and controls the memory allocator 110, thereby searching for memory pages having the necessary memory size.
  • a plurality of memory page areas may be found. When each program is executed, it is necessary to classify data based on the state of user characteristics, and separately record the resulting data. Such data may include data created when programs are executed and operated and parameters required to execute programs.
  • the page management unit 114 controls the block management unit 112 and determines whether an amount of memory having a capacity corresponding to the size for which the control unit requests a search remains empty. Thereafter, the page management unit 114 sorts all found pages in predetermined order, and provides the sorted pages to the control unit 120.
  • the control unit 120 is allocated memory having the found pages in predetermined order, and determines whether the empty blocks included in each of the allocated pages are contiguous with each other, in which case the empty blocks can be managed as a single block.
  • control unit 120 determines that the empty blocks of a first page cannot be managed as a single block, the process of allocating another page in the predetermined order and checking the empty block size again is repeated. Therefore, the required empty blocks are managed as a single block.
  • Operational data such as parameters required to execute programs, and created data are recorded and updated in the blocks of the corresponding allocated page.
  • control unit 120 reallocates the page, which was allocated to and occupied by the same program, so that management is facilitated.
  • control unit 120 performs control and monitoring so that the allocated empty blocks are returned. When all of the empty blocks are completely returned, the corresponding page is returned.
  • memory division is performed in two steps. That is, memory is divided into pages first, and then each of the pages is divided into a plurality of blocks. In the case of allocation, a page is allocated first, and then blocks of the page are allocated. In the case of the withdrawal by return, blocks are withdrawn first, and then a corresponding page is withdrawn after all the blocks of the corresponding page have been withdrawn.
  • FIG. 4 is a view showing the state of the memory allocation of a terminal device according to the embodiment of the present invention.
  • the page management unit 114 of the memory allocator 110 divides the memory unit 100 into a plurality of pages having the predetermined size, classifies the resulting pages, and manages the classified pages in ascending order.
  • first, second, seventh, and ninth pages are allocated to, and occupied and used by, the first program. Furthermore, when a second program is executed, third, fourth, sixth, and eighth pages are allocated to, and occupied and used by, the second program. [57] In this case, each of the first and second programs creates data which should be separately managed, and requests the allocation of memory.
  • the control unit 120 checks the first, second, and seventh pages occupied by the first program. Since no memory having the size requested to be allocated exists, the control unit 120 checks the last, ninth, page. The control unit 120 determines that the requested memory size exists in the ninth page, and allocates the memory size.
  • control unit 120 checks the second, fourth, and sixth pages and determines that no empty block having the requested size exists.
  • the control unit 120 checks the eighth page, and determines that the last block thereof is an empty block having the requested size. Therefore, the corresponding block is allocated to the second program.
  • FIG. 5 is a flowchart showing a method of allocating memory of a terminal device using a memory allocator according to an embodiment of the present invention.
  • the method of allocating memory using a memory allocator according to the present invention includes, when a memory allocator manages memory, dividing memory into a plurality of pages, dividing each of the pages into a plurality of blocks, managing the data recording state of the blocks, and allocating the pages having the requested sizes in predetermined order.
  • the memory allocator 110 manages the memory unit 100 under the control and monitoring of the control unit 120 at step SlOO, the memory allocator 110 divides the memory capacity of the memory unit 100 into a plurality of pages having the predetermined size, and allocates and manages the resulting pages at step Sl 10.
  • the block management unit 112 of the memory allocator 110 divides each of the pages of the memory unit 100 into a plurality of blocks having the predetermined size. Each of the blocks is managed by determining whether valid data has been recorded therein at step S 120.
  • the memory allocator 110 checks whether the allocation of memory required by a program that is being executed is requested by the control unit 120 at step S 130. If, as a result of checking, it is determined that memory should be allocated, the memory allocator 110 searches the memory area for pages, and checks whether each of the found pages has an empty block of the size requested by the program at step S 140.
  • pages having an empty block of the requested size are allocated to programs in the predetermined order at step S 150, and thus data is recorded in the corresponding empty blocks.
  • FIG. 6 is a flowchart showing a method of allocating memory of a terminal device using a control unit according to an embodiment of the present invention.
  • the method of allocating memory of a terminal device using a control unit according to the present invention includes checking the memory size, requested by a program which is being executed, through the control unit, searching a memory unit for pages and allocating one of the resulting pages each having a corresponding empty block, allocating another page when the size of the empty block does not correspond to the requested size, and recording data in the empty block of the allocated page and then returning the page when the execution of the program is terminated.
  • control unit 120 of the terminal device checks whether an application program is being executed at step S200.
  • control unit 120 determines that an application program is being executed, the control unit 120 checks the size or capacity of memory for data storage required by the application program at step S210.
  • the control unit 120 having checked the required memory size, controls the memory allocator 110 so that the memory allocator 110 searches for pages each having an empty block of the determined size at step S220, sorts the resulting pages in a predetermined order, and allocates a selected page to the application program at step S230.
  • the control unit 120 checks whether the empty block size corresponds to the requested size for the allocation by analyzing the size of an empty block of the memory page allocated to the application program at step S240.
  • the empty block of the allocated page is an empty block having the size requested by a program
  • the corresponding empty block is allocated to the running program, and then the running program records desired parameters and data and created data at step S260.
  • control unit 120 If it is determined that the execution of a program, which was executed and operated, is terminated S270, the control unit 120 returns the block allocated for recording data, and erases the data of the returned and withdrawn block.
  • the control unit 120 checks whether all blocks, which constitute the corresponding page, have been returned, and returns the corresponding page if all the blocks have been returned at step S280.
  • the present invention can be implemented using computer readable code written in a computer readable recording medium. Code and code segments which implement the above-described program can be easily inferred by computer programmers in the corresponding field.
  • the computer readable recording medium includes all types of recording devices for recording data, which can be read by a computer system.
  • the computer readable recording medium may be, for example, ROM, RAM, Compact Disc Read-Only Memory (CD-ROM), a magnetic tape, a floppy disk, an optical disk, and flash memory. Further, the computer readable recording medium may be distributed throughout computer systems connected to each other through a network, and computer readable code may be recorded and executed in a distributed manner.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Memory System (AREA)

Abstract

A device for allocating memory of a terminal device is disclosed. A memory unit records the operational data of a running program in an allocated area, and erases data from a returned area. A memory allocation unit divides the area of the memory unit into a plurality of pages, divides each of the pages into a plurality of blocks, classifies the resulting blocks into one or more allocation blocks, in which data is recorded, and one or more empty blocks, in which data is not recorded, and manages the classified blocks. A control unit controls the memory allocation unit, searches for and allocates pages each having an empty block of the size requested by a program, and records the data of the program in an empty block area of the allocated page.

Description

Description
DEVICE AND METHOD FOR ALLOCATING MEMORY OF
TERMINAL DEVICE
Technical Field
[1] The present invention relates, in general, to a device and method for allocating memory of a terminal device, and, more particularly, to a device and method for allocating memory of a terminal device, which can rapidly allocate memory and prevent fragmentation. Background Art
[2] Mobile terminals are devices that can make wireless access within service areas formed by base stations, and immediately perform communication with counter parties other parties while being freely carried regardless of time and place. Since the mobile terminals are always carried and moved by users, the mobile terminals have special features in that they are generally manufactured to have small size and light weight, and thus a large amount of resources, including memory, cannot be constructed therein.
[3] Memory provided in such a mobile terminal is used by a processor (Central
Processing Unit: CPU), and includes nonvolatile Random Access Memory (ROM) and volatile Random Access Memory (RAM). In nonvolatile memory, when data or a program, basically required for the operation of a mobile terminal, is recorded therein, the data or program is semi-permanently recorded so that it is not erased even when the supply of operating power is cut off. In volatile memory, a program and data, temporally required for the operation of the mobile terminal, are recorded. The recorded data is removed when operating power is cut off.
[4] Further, volatile memory is shared memory called a "heap", and is divided into an area for programs essential for system operation, and an area for application programs. Heap memory is allocated to and used by a processor. When the use of heap memory is completed, the heap memory is returned and reused. Therefore, a plurality of programs can efficiently share limited memory capacity.
[5] The area or size of memory requested to be allocated by a processor varies with the program. Memory capacity, the use of which is terminated, is withdrawn by a garbage collection program, and the withdrawn memory is reallocated to another program when the latter program requests memory allocation.
[6] In this case, when the size of withdrawn memory is smaller than a requested memory size, reallocation cannot be performed. In contrast, when the withdrawn memory size is larger than requested memory size, some memory area remains after reallocation. There occurs a memory fragmentation phenomenon, in which the size of the remaining memory area is smaller than the memory size requested to be reallocated by another program, and thus a remaining memory area is not sufficiently large to be reallocated.
[7] That is, due to memory fragmentation, even if the total physical area, size, or space of memory is actually sufficient, the memory is divided into a plurality of areas having sizes that cannot be utilized by programs. Therefore, there is a problem in that memory of the size requested by a program cannot be allocated.
[8] FIGS. IA to 1C are views showing a method of allocating memory according to an embodiment of the prior art. Referring to FIGS. IA to 1C, the total size of heap memory 10 is 10 Mbytes, and multiple application programs request respective desired memory sizes.
[9] As shown in FIG. IA, it is assumed that memory sizes of 3 Mbyte, 2 Mbyte, and 3
Mbyte are allocated to and occupied by respective application programs. Therefore, data is recorded and a memory size of 2 Mbyte remains free in a waiting state.
[10] In this case, as shown in FIG. IB, when the corresponding application programs are terminated, the occupation of the allocated memory size of 3 Mbyte and the memory size of 2 Mbyte are released, and the corresponding memory is returned, thus entering a waiting state.
[11] Further, as shown in FIG. 1C, when another application program requests a memory size of 3 Mbyte, in a state in which still another application program requests a memory size of 4 Mbyte and the corresponding memory has been allocated, memory cannot be allocated to another application program due to memory fragmentation, even though sufficient memory physically remains.
[12] In the case in which memory resources are not limited, there is a method of allocating memory of large capacity and managing the locations of absolute addresses. However, since the capacity of a memory resource is limited in a mobile terminal, there is a problem in that it is difficult to allocate large capacity of memory and acquire the locations of absolute addresses.
[13] Various methods of efficiently allocating and reallocating limited memory, as described above, have been proposed.
[14] FIGS. 2 A to 2D are views showing a method of allocating memory according to another embodiment of the prior art. Referring to FIGS. 2 A to 2D, memory is divided into a plurality of blocks of the same size, and the resulting blocks are allocated to respective application programs according to a best- fit policy, a worst- fit policy, and a first-fit policy at the requests of the application programs.
[15] In FIG. 2A, the total memory area is divided into a plurality of blocks, and the blocks are allocated to and occupied by respective application programs. The blocks, in which data is recorded, are hatched in the drawing. [16] For example, the case in which another application program requests the allocation of a memory area having one block size will be described according to the respective policies.
[17] As shown in FIG. 2B, the best-fit policy is a policy of searching memory 10 using an allocator, that is, searching for empty chunks in which data is not recorded and which are in a waiting state, searching for a chunk memory area having a size of one block in a waiting state, and allocating the found chunk memory area. According to this policy, memory can be efficiently used, but there is a problem in that it takes a considerably long time to perform allocation.
[18] As shown in FIG. 2C, the worst- fit policy is a policy of allocating the largest chunk memory area from among chunk memory found by an allocator. According to this policy, although memory can be rapidly allocated, the allocated chunk memory contains four blocks, so that one block is allocated, as requested, and three blocks remain. Therefore, when the total runtime is long, there is a problem in that fragmentation seriously increases.
[19] As shown in FIG. 2D, the first- fit policy is a policy of allocating the first chunk memory found by an allocator. According to this policy, the allocation of memory can be also rapidly performed. However, since the allocated chunk memory contains two blocks, memory having a single block is allocated, so that the remaining one block is subjected to fragmentation. Therefore, when the total runtime is long, there is a problem in that fragmentation increases.
[20] If memory, required for application programs to be operated, cannot be allocated due to fragmentation when a mobile terminal is being operated, a deadlock phenomenon may occur, in which case the mobile terminal cannot be operated and shuts down. The effects of this problem are not limited to the mobile terminal. That is, problems also arise in that a user loses opportunities to acquire important information, and the preference and reliability of a mobile terminal decrease, thus deteriorating the business of a mobile communication system provider. Therefore, there is the need for development of technology for preventing fragmentation even using the limited memory of a mobile terminal. Disclosure of Invention Technical Problem
[21] Accordingly, the present invention has been made keeping in mind the above problems occurring in the prior art, and an object of the present invention is to provide a device and method for allocating memory of a terminal device, in which heap memory is divided in two steps, and is allocated and withdrawn at the request of a processor, so that division is not performed on a memory area occupied by the processor and fragmentation does not occur. Technical Solution
[22] In order to acomplish the above object, the present invention provides a device for allocating the memory of a terminal device, including: a memory unit for recording the operational data of a running program in an allocated area, and erasing data from a returned area; a memory allocation unit for dividing the area of the memory unit into a plurality of pages, dividing each of the pages into a plurality of blocks, classifying the resulting blocks into one or more allocation blocks, in which data is recorded, and one or more empty blocks, in which data is not recorded, and managing the classified blocks; and a control unit for controlling the memory allocation unit, searching for and allocating pages each having an empty block of the size requested by a program, and recording the data of the program in an empty block area of the allocated page.
[23] Further, the present invention provides a method of allocating the memory of a terminal device, including: dividing memory into a plurality of pages of the predetermined size; dividing each of the plurality of pages into a plurality of blocks, classifying the resulting blocks into one or more allocation blocks, in which data is recorded, and one or more empty blocks, in which data is not recorded, and managing the classified blocks; and, when the allocation of memory is requested, checking pages each having the requested empty block size, and allocating the pages in predetermined order.
[24] Furthermore, the present invention provides a method of allocating the memory of a terminal device, including: checking and requesting the memory size required for recording the data of an application program being executed; searching for pages having the requested memory size and allocating one of the found pages; if the single empty block size of the allocated page does not correspond to the requested memory size, allocating another page; and allocating the empty block of the allocated page, recording data, and returning the allocated block and the allocated page when the operation of the program is terminated.
Advantageous Effects
[25] According to the present invention, there is an advantage of providing convenience of use in that the memory size requested by each program is rapidly allocated in a terminal, in which a limited memory resource is provided, thereby increasing reliability.
[26] Additionally, fragmentation, which occurs due to repeated allocations and withdrawal of memory allocation when the runtime of a terminal device is long, does not occur, so that there is an advantage of supporting industrial use in that limited amounts of memory can be efficiently utilized. Brief Description of the Drawings
[27] The above and other objects, features and other advantages of the present invention will be more clearly understood from the following detailed description taken in conjunction with the accompanying drawings, in which:
[28] FIGS. IA to 1C are views showing a method of allocating memory according to an embodiment of the prior art;
[29] FIGS. 2A to 2D are views showing a method of allocating memory according to another embodiment of the prior art;
[30] FIG. 3 is a function block diagram showing the memory allocation device of a terminal device according to an embodiment of the present invention;
[31] FIG. 4 is view showing the state of the memory allocation of a terminal device according to the embodiment of the present invention;
[32] FIG. 5 is a flowchart showing a method of allocating memory of a terminal device using a memory allocator according to an embodiment of the present invention; and
[33] FIG. 6 is a flowchart showing a method of allocating memory of a terminal device using a control unit according to an embodiment of the present invention. Mode for the Invention
[34] Reference should now be made to the drawings, in which the same reference numerals are used throughout the different drawings to designate the same or similar components.
[35] A device and method for allocating memory of a terminal device according to the present invention, constructed as described above, will be described with reference to the accompanying drawings below.
[36] It should be noted that, in the following embodiments of the present invention, when it is determined that detailed descriptions of well-known functions and the construction thereof are not directly related to the present invention and thus would make the gist of the present invention obscure, they are omitted.
[37] FIG. 3 is a functional diagram showing the memory allocation device of a terminal device according to an embodiment of the present invention.
[38] Referring to FIG. 3, the device for allocating memory of a terminal device according to the embodiment of the present invention includes a memory unit 110 for recording data, created as a result of the operation of programs, in an allocated area, a memory allocator 110 for dividing the area of the memory unit into a plurality of pages, dividing each of the pages into a plurality of blocks, and managing the resulting blocks, and a control unit 120 for controlling the memory allocator and directly recording data in the block of a page having an empty space for recording data. The memory allocator 110 includes a block management unit 112 and a page management unit 114.
[39] The capacity or size of the memory unit 100, provided in a mobile terminal in an embedded manner, is limited by the mobility and portability of the mobile terminal. Further, a plurality of application programs is simultaneously executed in a mobile terminal in order to operate various types of added services, in addition to communication. When such application programs are executed, data are created. In order to execute the application programs without hindrance, the created data or required data, such as parameters, should be recorded in allocated areas and then be managed.
[40] Therefore, the data, created when the plurality of programs is executed, or data, such as parameters, required to execute the programs, should be recorded using the limited capacity of a memory unit.
[41] In order for a plurality of programs to efficiently share the limited capacity of memory, the memory is divided into a plurality of areas having a predetermined size, the resulting areas are rapidly allocated, and the areas, the use of which is terminated, are returned, withdrawn and then reallocated. The present invention provides technique for preventing fragmentation during the above-described process so that unavailable areas are not formed.
[42] The page management unit 114 of the memory allocator 110 divides memory capacity provided in the memory unit 100 into a plurality of pages having the predetermined size, and then manages the resulting pages.
[43] The block management unit 112 divides each of the pages of the memory, obtained by the page management unit 114, into a plurality of blocks, and then manages the resulting blocks. The block management unit 112 determines whether each of the blocks being managed is an allocation block in which data is recorded, or an empty block in which data is not recorded.
[44] When a program is executed, the control unit 120 checks the necessary memory size, and controls the memory allocator 110, thereby searching for memory pages having the necessary memory size.
[45] A plurality of memory page areas may be found. When each program is executed, it is necessary to classify data based on the state of user characteristics, and separately record the resulting data. Such data may include data created when programs are executed and operated and parameters required to execute programs.
[46] In this case, the page management unit 114 controls the block management unit 112 and determines whether an amount of memory having a capacity corresponding to the size for which the control unit requests a search remains empty. Thereafter, the page management unit 114 sorts all found pages in predetermined order, and provides the sorted pages to the control unit 120.
[47] There is a plurality of methods of determining the order of sorting found pages, for example, in descending order of total empty space capacity, in ascending order of total empty space capacity, in order of withdrawal by return, in order of last use, and in ascending address order being managed. However, the description of the present invention is not limited to any one of them.
[48] The control unit 120 is allocated memory having the found pages in predetermined order, and determines whether the empty blocks included in each of the allocated pages are contiguous with each other, in which case the empty blocks can be managed as a single block.
[49] If the control unit 120 determines that the empty blocks of a first page cannot be managed as a single block, the process of allocating another page in the predetermined order and checking the empty block size again is repeated. Therefore, the required empty blocks are managed as a single block.
[50] Operational data, such as parameters required to execute programs, and created data are recorded and updated in the blocks of the corresponding allocated page.
[51] In the case in which data that should be classified and then managed by a single program exists, the control unit 120 reallocates the page, which was allocated to and occupied by the same program, so that management is facilitated.
[52] When the operation of the program is terminated, the control unit 120 performs control and monitoring so that the allocated empty blocks are returned. When all of the empty blocks are completely returned, the corresponding page is returned.
[53] According to the present invention described above, memory division is performed in two steps. That is, memory is divided into pages first, and then each of the pages is divided into a plurality of blocks. In the case of allocation, a page is allocated first, and then blocks of the page are allocated. In the case of the withdrawal by return, blocks are withdrawn first, and then a corresponding page is withdrawn after all the blocks of the corresponding page have been withdrawn.
[54] Therefore, there are advantages in that the allocation of memory can be rapidly performed, the management of memory is simple, and memory fragmentation does not occur even in the case of a long runtime.
[55] FIG. 4 is a view showing the state of the memory allocation of a terminal device according to the embodiment of the present invention. Referring to FIG. 4, the page management unit 114 of the memory allocator 110 divides the memory unit 100 into a plurality of pages having the predetermined size, classifies the resulting pages, and manages the classified pages in ascending order.
[56] In an example, when a first program is executed, first, second, seventh, and ninth pages are allocated to, and occupied and used by, the first program. Furthermore, when a second program is executed, third, fourth, sixth, and eighth pages are allocated to, and occupied and used by, the second program. [57] In this case, each of the first and second programs creates data which should be separately managed, and requests the allocation of memory.
[58] The control unit 120 checks the first, second, and seventh pages occupied by the first program. Since no memory having the size requested to be allocated exists, the control unit 120 checks the last, ninth, page. The control unit 120 determines that the requested memory size exists in the ninth page, and allocates the memory size.
[59] Meanwhile, in the case of the second program, the control unit 120 checks the second, fourth, and sixth pages and determines that no empty block having the requested size exists. The control unit 120 checks the eighth page, and determines that the last block thereof is an empty block having the requested size. Therefore, the corresponding block is allocated to the second program.
[60] FIG. 5 is a flowchart showing a method of allocating memory of a terminal device using a memory allocator according to an embodiment of the present invention. Referring to FIG. 5, the method of allocating memory using a memory allocator according to the present invention includes, when a memory allocator manages memory, dividing memory into a plurality of pages, dividing each of the pages into a plurality of blocks, managing the data recording state of the blocks, and allocating the pages having the requested sizes in predetermined order.
[61] With reference to FIGS. 5 and 3, the method of allocating memory using a memory allocator according to the present invention will be described in detail. When the memory allocator 110 manages the memory unit 100 under the control and monitoring of the control unit 120 at step SlOO, the memory allocator 110 divides the memory capacity of the memory unit 100 into a plurality of pages having the predetermined size, and allocates and manages the resulting pages at step Sl 10.
[62] The block management unit 112 of the memory allocator 110 divides each of the pages of the memory unit 100 into a plurality of blocks having the predetermined size. Each of the blocks is managed by determining whether valid data has been recorded therein at step S 120.
[63] The memory allocator 110 checks whether the allocation of memory required by a program that is being executed is requested by the control unit 120 at step S 130. If, as a result of checking, it is determined that memory should be allocated, the memory allocator 110 searches the memory area for pages, and checks whether each of the found pages has an empty block of the size requested by the program at step S 140.
[64] Of the checked pages, pages having an empty block of the requested size are allocated to programs in the predetermined order at step S 150, and thus data is recorded in the corresponding empty blocks.
[65] Therefore, since the memory of the size requested by a program is searched for on a page basis, there are advantages in that searching can be performed rapidly and allocation can be performed immediately.
[66] FIG. 6 is a flowchart showing a method of allocating memory of a terminal device using a control unit according to an embodiment of the present invention. With reference to FIG. 6, the method of allocating memory of a terminal device using a control unit according to the present invention includes checking the memory size, requested by a program which is being executed, through the control unit, searching a memory unit for pages and allocating one of the resulting pages each having a corresponding empty block, allocating another page when the size of the empty block does not correspond to the requested size, and recording data in the empty block of the allocated page and then returning the page when the execution of the program is terminated.
[67] Referring to FIGS. 6 and 3, the method of allocating memory using a control unit according to the present invention will be described in detail. The control unit 120 of the terminal device checks whether an application program is being executed at step S200.
[68] If the control unit 120 determines that an application program is being executed, the control unit 120 checks the size or capacity of memory for data storage required by the application program at step S210.
[69] The control unit 120, having checked the required memory size, controls the memory allocator 110 so that the memory allocator 110 searches for pages each having an empty block of the determined size at step S220, sorts the resulting pages in a predetermined order, and allocates a selected page to the application program at step S230.
[70] The control unit 120 checks whether the empty block size corresponds to the requested size for the allocation by analyzing the size of an empty block of the memory page allocated to the application program at step S240.
[71] If, as a result of checking, it is determined that the requested memory size is not covered by a single empty block, the next page or another page among the found pages is allocated again in the predetermined order at step S250, and it is determined whether the empty block thereof corresponds to the requested size at step S240.
[72] If, as a result of checking, the empty block of the allocated page is an empty block having the size requested by a program, the corresponding empty block is allocated to the running program, and then the running program records desired parameters and data and created data at step S260.
[73] If it is determined that the execution of a program, which was executed and operated, is terminated S270, the control unit 120 returns the block allocated for recording data, and erases the data of the returned and withdrawn block.
[74] The control unit 120 checks whether all blocks, which constitute the corresponding page, have been returned, and returns the corresponding page if all the blocks have been returned at step S280.
[75] Therefore, even when the allocation and withdrawal of memory are repeated in the state where the runtime of the terminal device is long and a plurality of programs is being executed, fragmentation does not occur. Accordingly, there is an advantage in that limited memory can be efficiently utilized.
[76] The present invention can be implemented using computer readable code written in a computer readable recording medium. Code and code segments which implement the above-described program can be easily inferred by computer programmers in the corresponding field. The computer readable recording medium includes all types of recording devices for recording data, which can be read by a computer system. The computer readable recording medium may be, for example, ROM, RAM, Compact Disc Read-Only Memory (CD-ROM), a magnetic tape, a floppy disk, an optical disk, and flash memory. Further, the computer readable recording medium may be distributed throughout computer systems connected to each other through a network, and computer readable code may be recorded and executed in a distributed manner. Industrial Applicability
[77] Although the preferred embodiments of the present invention have been disclosed for illustrative purposes, those skilled in the art will appreciate that various modifications, additions and substitutions are possible, without departing from the scope and spirit of the invention as disclosed in the accompanying claims.

Claims

Claims
[1] A device for allocating memory of a terminal device, comprising: a memory unit for recording operational data of a running program in an allocated area, and erasing data from a returned area; a memory allocation unit for dividing an area of the memory unit into a plurality of pages, dividing each of the pages into a plurality of blocks, classifying the resulting blocks into one or more allocation blocks, in which data is recorded, and one or more empty blocks, in which data is not recorded, and managing the classified blocks; and a control unit for controlling the memory allocation unit, searching for and allocating pages each having an empty block of a size requested by a program, and recording data of the program in an empty block area of the allocated page.
[2] The device according to claim 1, wherein the memory allocation unit comprises: a page management unit for dividing a total area of the memory unit into a plurality of pages of a set size, and checking whether each of the pages includes an area in which data is capable of being recorded; and a block management unit for dividing each of the pages, divided by the page management unit, into a plurality of blocks, classifying the resulting blocks into one or more allocation block areas, in which data is recorded, and one or more empty block areas, in which data is not recorded, and managing the resulting areas.
[3] The device according to claim 1, wherein the control unit selects a page having an empty block of a size requested by the program and then allocates the selected page to the program while monitoring the memory.
[4] The device according to claim 3, wherein the control unit monitors an empty block size of the allocated page, and selects and allocates another page when the empty block size requested by the program is not covered by a single empty block.
[5] The device according to claim 4, wherein the selecting the page is performed by selecting a subsequent page in predetermined order.
[6] The device according to claim 3 or 4, wherein the control unit directly records data of the program in a memory area allocated by the memory allocation unit.
[7] A method of allocating memory of a terminal device, comprising: dividing memory into a plurality of pages of a predetermined size; dividing each of the plurality of pages into a plurality of blocks, classifying the resulting blocks into one or more allocation blocks, in which data is recorded, and one or more empty blocks, in which data is not recorded, and managing the classified blocks; and if allocation of memory is requested, checking pages each having a requested empty block size, and allocating the pages in predetermined order.
[8] The method according to claim 7, wherein the allocating the page comprises: checking whether the allocation of memory of a predetermined size, in which data of a running program will be recorded, has been requested; if the allocation of memory of the predetermined size has been requested, searching for pages each having an empty area of the requested size; and allocating a page having an empty area of the requested size among the found pages.
[9] The method according to claim 8, wherein the allocating the page comprises: allocating one of the found pages in a predetermined order; and allocating a subsequent page when additional allocation or another page is requested.
[10] A method of allocating memory of a terminal device, comprising: checking and requesting a memory size required for recording data of an application program being executed; searching for pages having the requested memory size and allocating one of the found pages; if a single empty block size of the allocated page does not correspond to the requested memory size, allocating another page; and allocating an empty block of the allocated page, recording data, and returning the allocated block and the allocated page when execution of the program is terminated.
[11] The method according to claim 10, wherein the allocating one of the found pages comprises, when memory having the page has already been allocated to the running program and then additional allocation is required, searching for empty areas of the allocated page.
[12] The method according to claim 10, wherein the returning the page comprises: recording data, created by the program, in the empty block of the allocated page; checking whether the execution of the program is terminated; and if the execution of the program is terminated, returning first the allocated block and then the corresponding page.
[13] The method according to claim 12, wherein the returning the block and then the page comprises erasing data recorded in the block or the page.
[14] The method according to claim 12, wherein the recording data comprises recording data in the allocated empty block of the memory in a direct manner.
[15] The method according to claim 10, wherein the allocating another page comprises allocating a page designated in predetermined order.
PCT/KR2007/004933 2006-10-13 2007-10-10 Device and method for allocating memory of terminal device WO2008044865A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
KR10-2006-0099671 2006-10-13
KR1020060099671A KR101376268B1 (en) 2006-10-13 2006-10-13 Device and method of memory allocation with 2 stage for mobile phone

Publications (1)

Publication Number Publication Date
WO2008044865A1 true WO2008044865A1 (en) 2008-04-17

Family

ID=39283027

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/KR2007/004933 WO2008044865A1 (en) 2006-10-13 2007-10-10 Device and method for allocating memory of terminal device

Country Status (2)

Country Link
KR (1) KR101376268B1 (en)
WO (1) WO2008044865A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10733027B2 (en) 2018-10-07 2020-08-04 Hewlett Packard Enterprise Development Lp Memory allocator

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100937826B1 (en) * 2008-07-14 2010-01-20 주식회사 엘지텔레콤 System and method for displaying web page image
KR102402789B1 (en) * 2015-05-11 2022-05-27 삼성전자 주식회사 Electronic device and method for allocating memory thereof

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04319721A (en) * 1991-04-19 1992-11-10 Hitachi Ltd Method for controlling picture switching of multi-item input terminal equipment
JPH05207090A (en) * 1992-01-30 1993-08-13 Hitachi Ltd Terminal communication system
JP2002032256A (en) * 2000-07-19 2002-01-31 Matsushita Electric Ind Co Ltd Terminal
JP2004192346A (en) * 2002-12-11 2004-07-08 Seiko Epson Corp Memory management device, proxy server, browser terminal, memory management program, server program, terminal program, monitor program, and method for managing memory

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6247105B1 (en) * 1996-06-20 2001-06-12 Sun Microsystems, Inc. Externally identifiable descriptor for standard memory allocation interface

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04319721A (en) * 1991-04-19 1992-11-10 Hitachi Ltd Method for controlling picture switching of multi-item input terminal equipment
JPH05207090A (en) * 1992-01-30 1993-08-13 Hitachi Ltd Terminal communication system
JP2002032256A (en) * 2000-07-19 2002-01-31 Matsushita Electric Ind Co Ltd Terminal
JP2004192346A (en) * 2002-12-11 2004-07-08 Seiko Epson Corp Memory management device, proxy server, browser terminal, memory management program, server program, terminal program, monitor program, and method for managing memory

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10733027B2 (en) 2018-10-07 2020-08-04 Hewlett Packard Enterprise Development Lp Memory allocator

Also Published As

Publication number Publication date
KR101376268B1 (en) 2014-03-21
KR20080033690A (en) 2008-04-17

Similar Documents

Publication Publication Date Title
KR101357397B1 (en) Method for tracking memory usages of a data processing system
US7231504B2 (en) Dynamic memory management of unallocated memory in a logical partitioned data processing system
US9086952B2 (en) Memory management and method for allocation using free-list
US6725241B1 (en) Method and apparatus for freeing memory in a data processing system
KR102290540B1 (en) Namespace/Stream Management
US8225065B2 (en) Hierarchical scalable memory allocator
CN107969153B (en) Resource allocation method and device and NUMA system
CN111984425A (en) Memory management method, device and equipment for operating system
CN113849260A (en) Instance processing core allocation method and device
CN114556309A (en) Memory space allocation method and device and storage medium
US20060036663A1 (en) Method and apparatus for effective data management of files
CN112148226A (en) Data storage method and related device
US7334104B2 (en) Satisfying memory allocation requests from memory pool or lookaside lists based on memory size requested to be allocated
CN114327290B (en) Structure, formatting method and access method of disk partition
CN115421924A (en) Memory allocation method, device and equipment
WO2008044865A1 (en) Device and method for allocating memory of terminal device
CN113515376A (en) Memory management method and device, electronic equipment and storage medium
CN116483740B (en) Memory data migration method and device, storage medium and electronic device
KR101950759B1 (en) Garbage collection method for performing memory controller of storage device and memory controler
US20100299672A1 (en) Memory management device, computer system, and memory management method
CN117215485A (en) ZNS SSD management method, data writing method, storage device and controller
CN106537321B (en) Method, device and storage system for accessing file
CN117909250A (en) Solid state disk configuration method, garbage collection method and related equipment
CN115543859A (en) Wear leveling optimization method, device, equipment and medium for multi-partition SSD
KR101861851B1 (en) Chunk allocation method for performing memory controller of storage device and memory controler

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 07833244

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC OF 100809

122 Ep: pct application non-entry in european phase

Ref document number: 07833244

Country of ref document: EP

Kind code of ref document: A1