Electronic device and method for allocating memory thereof

Electronic device according to an embodiment of the present invention includes a memory containing a plurality of pages; And if the memory allocation request memory defragmentation request is made, based on the page state information for the page area within the plurality of the memory, select the page areas above do not have a plurality of page areas immovable page from, and the selected page area moves within the movable page, and after the movement of the moveable page, the page area selected; and a control section for allocation in response to said memory allocation requests. However, not limited to the above embodiment can be another embodiment.