1. An electronic device comprising: a memory allocating unit configured to: identify a memory allocation request for an application, examine a history of memory allocation requests for the application, wherein the history of the memory allocation requests has been updated when allocating at least part of the memory to the application, and determine a memory allocation mode for the application, based on whether the history of memory allocation requests for the application meets a learning threshold; and a processor configured to perform a memory allocation operation according to the determined memory allocation mode, wherein the processor is configured to store information on a type or a size of a container determined according to the memory allocation mode as the history of memory allocation requests for the application, in response to performing the memory allocation operation in a learning mode.