KR20220017309A - Method for allocating of virtual memory and electronic device supporting the same - Google Patents

Method for allocating of virtual memory and electronic device supporting the same Download PDF

Info

Publication number
KR20220017309A
KR20220017309A KR1020200097640A KR20200097640A KR20220017309A KR 20220017309 A KR20220017309 A KR 20220017309A KR 1020200097640 A KR1020200097640 A KR 1020200097640A KR 20200097640 A KR20200097640 A KR 20200097640A KR 20220017309 A KR20220017309 A KR 20220017309A
Authority
KR
South Korea
Prior art keywords
size
heap area
failure
processor
memory
Prior art date
Application number
KR1020200097640A
Other languages
Korean (ko)
Inventor
전경석
이해욱
정관희
Original Assignee
삼성전자주식회사
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 삼성전자주식회사 filed Critical 삼성전자주식회사
Priority to KR1020200097640A priority Critical patent/KR20220017309A/en
Priority to PCT/KR2021/010169 priority patent/WO2022030964A1/en
Publication of KR20220017309A publication Critical patent/KR20220017309A/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0629Configuration or reconfiguration of storage systems
    • G06F3/0631Configuration or reconfiguration of storage systems by allocating resources to storage systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • 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
    • G06F12/0238Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/0644Management of space entities, e.g. partitions, extents, pools
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0653Monitoring storage devices or systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0662Virtualisation aspects
    • G06F3/0665Virtualisation aspects at area level, e.g. provisioning of virtual or logical volumes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0662Virtualisation aspects
    • G06F3/0667Virtualisation aspects at data level, e.g. file, record or object virtualisation

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Memory System (AREA)

Abstract

Disclosed is an electronic device, which includes: a memory for storing an application; and a processor operatively connected to the memory, wherein the processor is configured to: set information indicating a failure of the memory allocation, if memory allocation for virtual memory corresponding to the application fails during the execution of the application, determine the size of a heap area comprised in the virtual memory on the basis of the set information, if the set information exists when the application is re-executed, and allocate the virtual memory comprising the heap area of the determined size. Other various embodiments identified through the present document are possible. Accordingly, it is possible to maximize efficiency of a storage space of the virtual memory.

Description

가상 메모리의 할당 방법 및 이를 지원하는 전자 장치{Method for allocating of virtual memory and electronic device supporting the same}Method for allocating of virtual memory and electronic device supporting the same

본 발명의 다양한 실시예들은 가상 메모리의 할당 기술에 관한 것이다.Various embodiments of the present invention relate to virtual memory allocation techniques.

데이터의 처리 또는 연산을 수행하는 전자 장치(또는 컴퓨팅 장치)는 실행되는 어플리케이션에 의해 사용되는 데이터 또는 명령어를 저장하기 위한 메모리를 포함할 수 있다. 이러한 메모리의 제한적인 저장 공간을 보다 효율적으로 사용하기 위해, 전자 장치는 가상 메모리를 사용하여 실제 물리적으로 존재하는 메모리의 용량보다 더 많은 저장 공간을 제공할 수 있다. 예를 들어, 전자 장치는 메모리의 저장 공간 일부를 가상 메모리로 설정하고, 가상 메모리로 설정된 메모리의 저장 공간에 대한 접근을 가상 주소(또는 논리 주소)를 통해 수행되도록 제어할 수 있다.An electronic device (or computing device) that processes or performs data processing may include a memory for storing data or instructions used by an executed application. In order to more efficiently use the limited storage space of the memory, the electronic device may use the virtual memory to provide more storage space than the actual memory capacity. For example, the electronic device may set a part of the storage space of the memory as the virtual memory, and may control access to the storage space of the memory set as the virtual memory to be performed through a virtual address (or logical address).

한편, 가상 메모리는 어플리케이션 프로세스의 고유 공간인 사용자 영역 및 모든 어플리케이션 프로세스들이 공유하는 공간인 커널 영역을 포함할 수 있다. 또한, 사용자 영역은 어플리케이션이 사용하는 지역 변수와 같이 임시로 저장되는 데이터의 저장 공간인 스택(stack) 영역, 어플리케이션에 의해 동적으로 할당하는 공간인 힙(heap) 영역, 어플리케이션이 사용하는 전역 변수 또는 정적 변수와 같이 어플리케이션이 실행될 때 생성되고 어플리케이션이 종료되면 시스템에 반환되는 공간인 데이터(data) 영역, 및 어플리케이션의 명령어(또는 코드)가 기계어의 형태로 저장되는 공간인 코드(code) 영역을 포함할 수 있다.Meanwhile, the virtual memory may include a user area, which is a unique space of an application process, and a kernel area, which is a space shared by all application processes. In addition, the user area includes the stack area, which is a storage space for temporarily stored data such as local variables used by the application, the heap area which is a space dynamically allocated by the application, global variables used by the application, or Like static variables, it includes a data area, which is a space created when an application is executed and returned to the system when the application is terminated, and a code area, a space where an application's command (or code) is stored in the form of machine language. can do.

상술한 가상 메모리의 힙 영역은 네이티브 힙(native heap) 영역과 자바 가상 머신 힙(java virtual machine(JVM) heap) 영역을 포함할 수 있는데, 여기서 JVM 힙 영역은 어플리케이션 패키지 내의 설정 파일(예: "AndroidManifest.xml" 파일)에 기재된 힙 영역의 크기 속성(예: "largeHeap"으로 정의되는 속성)의 설정 값(예: "true" 또는 "false"(default 값))에 따라 결정될 수 있다. 예를 들어, 힙 영역의 크기 속성의 설정 값이 "true"로 설정된 경우, JVM 힙 영역은 최대로 사용 가능한 크기(예: 1GB)로 할당될 수 있다.The above-described heap area of the virtual memory may include a native heap area and a java virtual machine (JVM) heap area, where the JVM heap area is a configuration file (eg, " AndroidManifest.xml" file), it can be determined according to the set value (eg "true" or "false" (default value)) of the size attribute (eg, defined as "largeHeap") of the heap area. For example, if the set value of the size attribute of the heap area is set to "true", the JVM heap area may be allocated with the maximum usable size (eg, 1 GB).

기존의 전자 장치는 어플리케이션이 실행될 때, 어플리케이션 패키지 내의 설정 파일에 기재된 힙 영역의 크기 속성의 설정 값에 따라 가상 메모리의 힙 영역의 크기를 결정하기 때문에, 힙 영역의 크기가 실제 사용량과 상관없이 결정될 수 있다. 또한, 힙 영역의 크기는 어플리케이션이 실행될 때 한번 초기화되고 이후에는 조정하기 어려울 수 있다. 이에 따라, 어플리케이션에 대응되는 가상 메모리가 할당될 때, 메모리 공간 부족으로 인한 메모리 할당이 실패할 수 있다.Since the existing electronic device determines the size of the heap area of the virtual memory according to the setting value of the size attribute of the heap area described in the setting file in the application package when the application is executed, the size of the heap area can be determined regardless of the actual usage. can In addition, the size of the heap area is initialized once when the application is executed, and it may be difficult to adjust thereafter. Accordingly, when a virtual memory corresponding to an application is allocated, memory allocation may fail due to insufficient memory space.

본 발명의 다양한 실시예들은, 어플리케이션에 대응되는 가상 메모리의 할당 시 힙 영역의 실제 사용량에 기반하여 힙 영역의 크기를 결정하는 가상 메모리의 할당 방법 및 이를 지원하는 전자 장치를 제공할 수 있다.Various embodiments of the present disclosure may provide a virtual memory allocation method for determining a size of a heap area based on actual usage of the heap area when allocating a virtual memory corresponding to an application, and an electronic device supporting the same.

본 발명의 다양한 실시예에 따른 전자 장치는, 어플리케이션을 저장하는 메모리, 및 상기 메모리와 작동적으로 연결된 프로세서를 포함하고, 상기 프로세서는, 상기 어플리케이션의 실행 중 상기 어플리케이션에 대응되는 가상 메모리에 대한 메모리 할당이 실패하면, 상기 메모리 할당의 실패를 나타내는 정보를 설정하고, 상기 어플리케이션의 재실행 시, 상기 설정된 정보가 존재하면, 상기 설정된 정보에 기반하여 상기 가상 메모리에 포함된 힙 영역의 크기를 결정하고, 상기 결정된 크기의 힙 영역을 포함하는 상기 가상 메모리를 할당하도록 설정될 수 있다.An electronic device according to various embodiments of the present disclosure includes a memory for storing an application, and a processor operatively connected to the memory, wherein the processor includes a memory for a virtual memory corresponding to the application during execution of the application. If the allocation fails, information indicating the failure of the memory allocation is set, and when the application is re-executed, if the set information exists, the size of the heap area included in the virtual memory is determined based on the set information, It may be configured to allocate the virtual memory including the heap area of the determined size.

또한, 본 발명의 다양한 실시예에 따른 전자 장치의 가상 메모리의 할당 방법은, 상기 전자 장치의 메모리에 저장된 어플리케이션의 실행 중 상기 어플리케이션에 대응되는 가상 메모리에 대한 메모리 할당이 실패하면, 상기 메모리 할당의 실패를 나타내는 정보를 설정하는 동작, 상기 어플리케이션의 재실행 시, 상기 설정된 정보가 존재하면, 상기 설정된 정보에 기반하여 상기 가상 메모리에 포함된 힙 영역의 크기를 결정하는 동작, 및 상기 결정된 크기의 힙 영역을 포함하는 상기 가상 메모리를 할당하는 동작을 포함할 수 있다.Also, in the method of allocating a virtual memory of an electronic device according to various embodiments of the present disclosure, if memory allocation for a virtual memory corresponding to the application fails while an application stored in the memory of the electronic device is executed, the memory allocation An operation of setting information indicating failure, an operation of determining a size of a heap area included in the virtual memory based on the set information if the set information exists when the application is re-executed, and a heap area of the determined size Allocating the virtual memory including

본 발명의 다양한 실시예들에 따르면, 어플리케이션에 대응되는 가상 메모리의 할당 시 힙 영역의 실제 사용량에 기반하여 힙 영역의 크기를 결정함으로써, 가상 메모리의 저장 공간에 대한 효율성을 극대화할 수 있다.According to various embodiments of the present disclosure, when the virtual memory corresponding to the application is allocated, the size of the heap area is determined based on the actual usage of the heap area, thereby maximizing the efficiency of the storage space of the virtual memory.

또한, 본 발명의 다양한 실시예들에 따르면, 가상 메모리의 할당에 대한 실패의 확률을 낮춤으로써, 메모리 사용에 대한 안정성을 높일 수 있다.In addition, according to various embodiments of the present disclosure, it is possible to increase the stability of memory use by reducing the probability of a failure in the allocation of virtual memory.

이 외에, 본 문서를 통해 직접적 또는 간접적으로 파악되는 다양한 효과들이 제공될 수 있다.In addition, various effects directly or indirectly identified through this document may be provided.

도 1은 다양한 실시예들에 따른 네트워크 환경 내의 전자 장치의 블록도이다.
도 2는 본 발명의 일 실시예에 따른 가상 메모리의 할당과 관련된 전자 장치의 구성을 설명하기 위한 도면이다.
도 3은 본 발명의 일 실시예에 따른 가상 메모리에 대한 메모리 할당의 실패를 처리하는 방법을 설명하기 위한 도면이다.
도 4는 본 발명의 일 실시예에 따른 가상 메모리의 할당 방법을 설명하기 위한 도면이다.
도 5는 본 발명의 일 실시예에 따른 가상 메모리에 대한 메모리 할당의 실패와 관련된 정보를 설정하는 방법을 설명하기 위한 도면이다.
도 6은 본 발명의 일 실시예에 따른 가상 메모리의 할당과 관련된 처리 동작을 설명하기 위한 도면이다.
도면의 설명과 관련하여, 동일 또는 유사한 구성요소에 대해서는 동일 또는 유사한 참조 부호가 사용될 수 있다.
1 is a block diagram of an electronic device in a network environment according to various embodiments of the present disclosure;
2 is a diagram for explaining a configuration of an electronic device related to virtual memory allocation according to an embodiment of the present invention.
3 is a diagram for explaining a method of handling a failure in memory allocation to a virtual memory according to an embodiment of the present invention.
4 is a diagram for explaining a virtual memory allocation method according to an embodiment of the present invention.
5 is a diagram for explaining a method of setting information related to a failure in memory allocation to a virtual memory according to an embodiment of the present invention.
6 is a diagram for explaining a processing operation related to virtual memory allocation according to an embodiment of the present invention.
In connection with the description of the drawings, the same or similar reference numerals may be used for the same or similar components.

이하, 첨부된 도면을 참조하여 본 발명의 다양한 실시예들이 설명된다. 설명의 편의를 위하여 도면에 도시된 구성요소들은 그 크기가 과장 또는 축소될 수 있으며, 본 발명이 반드시 도시된 바에 의해 한정되는 것은 아니다.Hereinafter, various embodiments of the present invention will be described with reference to the accompanying drawings. For convenience of description, the sizes of the components shown in the drawings may be exaggerated or reduced, and the present invention is not necessarily limited to the illustrated ones.

도 1은, 다양한 실시예들에 따른, 네트워크 환경(100) 내의 전자 장치(101)의 블록도이다. 도 1을 참조하면, 네트워크 환경(100)에서 전자 장치(101)는 제1 네트워크(198)(예: 근거리 무선 통신 네트워크)를 통하여 전자 장치(102)와 통신하거나, 또는 제2 네트워크(199)(예: 원거리 무선 통신 네트워크)를 통하여 전자 장치(104) 또는 서버(108)와 통신할 수 있다. 일 실시예에 따르면, 전자 장치(101)는 서버(108)를 통하여 전자 장치(104)와 통신할 수 있다. 일 실시예에 따르면, 전자 장치(101)는 프로세서(120), 메모리(130), 입력 모듈(150), 음향 출력 모듈(155), 디스플레이 모듈(160), 오디오 모듈(170), 센서 모듈(176), 인터페이스(177), 연결 단자(178), 햅틱 모듈(179), 카메라 모듈(180), 전력 관리 모듈(188), 배터리(189), 통신 모듈(190), 가입자 식별 모듈(196), 또는 안테나 모듈(197)을 포함할 수 있다. 어떤 실시예에서는, 전자 장치(101)에는, 이 구성요소들 중 적어도 하나(예: 연결 단자(178))가 생략되거나, 하나 이상의 다른 구성요소가 추가될 수 있다. 어떤 실시예에서는, 이 구성요소들 중 일부들(예: 센서 모듈(176), 카메라 모듈(180), 또는 안테나 모듈(197))은 하나의 구성요소(예: 디스플레이 모듈(160))로 통합될 수 있다.1 is a block diagram of an electronic device 101 in a network environment 100 according to various embodiments. Referring to FIG. 1 , in a network environment 100 , an electronic device 101 communicates with an electronic device 102 through a first network 198 (eg, a short-range wireless communication network) or a second network 199 . It may communicate with the electronic device 104 or the server 108 through (eg, a long-distance wireless communication network). According to an embodiment, the electronic device 101 may communicate with the electronic device 104 through the server 108 . According to an embodiment, the electronic device 101 includes a processor 120 , a memory 130 , an input module 150 , a sound output module 155 , a display module 160 , an audio module 170 , and a sensor module ( 176), interface 177, connection terminal 178, haptic module 179, camera module 180, power management module 188, battery 189, communication module 190, subscriber identification module 196 , or an antenna module 197 may be included. In some embodiments, at least one of these components (eg, the connection terminal 178 ) may be omitted or one or more other components may be added to the electronic device 101 . In some embodiments, some of these components (eg, sensor module 176 , camera module 180 , or antenna module 197 ) are integrated into one component (eg, display module 160 ). can be

프로세서(120)는, 예를 들면, 소프트웨어(예: 프로그램(140))를 실행하여 프로세서(120)에 연결된 전자 장치(101)의 적어도 하나의 다른 구성요소(예: 하드웨어 또는 소프트웨어 구성요소)를 제어할 수 있고, 다양한 데이터 처리 또는 연산을 수행할 수 있다. 일 실시예에 따르면, 데이터 처리 또는 연산의 적어도 일부로서, 프로세서(120)는 다른 구성요소(예: 센서 모듈(176) 또는 통신 모듈(190))로부터 수신된 명령 또는 데이터를 휘발성 메모리(132)에 저장하고, 휘발성 메모리(132)에 저장된 명령 또는 데이터를 처리하고, 결과 데이터를 비휘발성 메모리(134)에 저장할 수 있다. 일 실시예에 따르면, 프로세서(120)는 메인 프로세서(121)(예: 중앙 처리 장치 또는 어플리케이션 프로세서) 또는 이와는 독립적으로 또는 함께 운영 가능한 보조 프로세서(123)(예: 그래픽 처리 장치, 신경망 처리 장치(NPU: neural processing unit), 이미지 시그널 프로세서, 센서 허브 프로세서, 또는 커뮤니케이션 프로세서)를 포함할 수 있다. 예를 들어, 전자 장치(101)가 메인 프로세서(121) 및 보조 프로세서(123)를 포함하는 경우, 보조 프로세서(123)는 메인 프로세서(121)보다 저전력을 사용하거나, 지정된 기능에 특화되도록 설정될 수 있다. 보조 프로세서(123)는 메인 프로세서(121)와 별개로, 또는 그 일부로서 구현될 수 있다.The processor 120, for example, executes software (eg, a program 140) to execute at least one other component (eg, a hardware or software component) of the electronic device 101 connected to the processor 120 . It can control and perform various data processing or operations. According to one embodiment, as at least part of data processing or operation, the processor 120 converts commands or data received from other components (eg, the sensor module 176 or the communication module 190 ) to the volatile memory 132 . may be stored in the volatile memory 132 , and may process commands or data stored in the volatile memory 132 , and store the result data in the non-volatile memory 134 . According to an embodiment, the processor 120 is the main processor 121 (eg, a central processing unit or an application processor) or a secondary processor 123 (eg, a graphic processing unit, a neural network processing unit) a neural processing unit (NPU), an image signal processor, a sensor hub processor, or a communication processor). For example, when the electronic device 101 includes the main processor 121 and the sub-processor 123 , the sub-processor 123 may use less power than the main processor 121 or may be set to be specialized for a specified function. can The auxiliary processor 123 may be implemented separately from or as a part of the main processor 121 .

보조 프로세서(123)는, 예를 들면, 메인 프로세서(121)가 인액티브(예: 슬립) 상태에 있는 동안 메인 프로세서(121)를 대신하여, 또는 메인 프로세서(121)가 액티브(예: 어플리케이션 실행) 상태에 있는 동안 메인 프로세서(121)와 함께, 전자 장치(101)의 구성요소들 중 적어도 하나의 구성요소(예: 디스플레이 모듈(160), 센서 모듈(176), 또는 통신 모듈(190))와 관련된 기능 또는 상태들의 적어도 일부를 제어할 수 있다. 일 실시예에 따르면, 보조 프로세서(123)(예: 이미지 시그널 프로세서 또는 커뮤니케이션 프로세서)는 기능적으로 관련 있는 다른 구성요소(예: 카메라 모듈(180) 또는 통신 모듈(190))의 일부로서 구현될 수 있다. 일 실시예에 따르면, 보조 프로세서(123)(예: 신경망 처리 장치)는 인공지능 모델의 처리에 특화된 하드웨어 구조를 포함할 수 있다. 인공지능 모델은 기계 학습을 통해 생성될 수 있다. 이러한 학습은, 예를 들어, 인공지능이 수행되는 전자 장치(101) 자체에서 수행될 수 있고, 별도의 서버(예: 서버(108))를 통해 수행될 수도 있다. 학습 알고리즘은, 예를 들어, 지도형 학습(supervised learning), 비지도형 학습(unsupervised learning), 준지도형 학습(semi-supervised learning) 또는 강화 학습(reinforcement learning)을 포함할 수 있으나, 전술한 예에 한정되지 않는다. 인공지능 모델은, 복수의 인공 신경망 레이어들을 포함할 수 있다. 인공 신경망은 심층 신경망(DNN: deep neural network), CNN(convolutional neural network), RNN(recurrent neural network), RBM(restricted boltzmann machine), DBN(deep belief network), BRDNN(bidirectional recurrent deep neural network), 심층 Q-네트워크(deep Q-networks) 또는 상기 중 둘 이상의 조합 중 하나일 수 있으나, 전술한 예에 한정되지 않는다. 인공지능 모델은 하드웨어 구조 이외에, 추가적으로 또는 대체적으로, 소프트웨어 구조를 포함할 수 있다.The auxiliary processor 123 is, for example, on behalf of the main processor 121 while the main processor 121 is in an inactive (eg, sleep) state, or the main processor 121 is active (eg, executing an application). ), together with the main processor 121, at least one of the components of the electronic device 101 (eg, the display module 160, the sensor module 176, or the communication module 190) It is possible to control at least some of the related functions or states. According to an embodiment, the coprocessor 123 (eg, an image signal processor or a communication processor) may be implemented as part of another functionally related component (eg, the camera module 180 or the communication module 190). have. According to an embodiment, the auxiliary processor 123 (eg, a neural network processing device) may include a hardware structure specialized for processing an artificial intelligence model. Artificial intelligence models can be created through machine learning. Such learning may be performed, for example, in the electronic device 101 itself on which artificial intelligence is performed, or may be performed through a separate server (eg, the server 108). The learning algorithm may include, for example, supervised learning, unsupervised learning, semi-supervised learning, or reinforcement learning, but in the above example not limited The artificial intelligence model may include a plurality of artificial neural network layers. Artificial neural networks include deep neural networks (DNNs), convolutional neural networks (CNNs), recurrent neural networks (RNNs), restricted boltzmann machines (RBMs), deep belief networks (DBNs), bidirectional recurrent deep neural networks (BRDNNs), It may be one of deep Q-networks or a combination of two or more of the above, but is not limited to the above example. The artificial intelligence model may include, in addition to, or alternatively, a software structure in addition to the hardware structure.

메모리(130)는, 전자 장치(101)의 적어도 하나의 구성요소(예: 프로세서(120) 또는 센서 모듈(176))에 의해 사용되는 다양한 데이터를 저장할 수 있다. 데이터는, 예를 들어, 소프트웨어(예: 프로그램(140)) 및, 이와 관련된 명령에 대한 입력 데이터 또는 출력 데이터를 포함할 수 있다. 메모리(130)는, 휘발성 메모리(132) 또는 비휘발성 메모리(134)를 포함할 수 있다.The memory 130 may store various data used by at least one component of the electronic device 101 (eg, the processor 120 or the sensor module 176 ). The data may include, for example, input data or output data for software (eg, the program 140 ) and instructions related thereto. The memory 130 may include a volatile memory 132 or a non-volatile memory 134 .

프로그램(140)은 메모리(130)에 소프트웨어로서 저장될 수 있으며, 예를 들면, 운영 체제(142), 미들웨어(144) 또는 어플리케이션(146)을 포함할 수 있다.The program 140 may be stored as software in the memory 130 , and may include, for example, an operating system 142 , middleware 144 , or an application 146 .

입력 모듈(150)은, 전자 장치(101)의 구성요소(예: 프로세서(120))에 사용될 명령 또는 데이터를 전자 장치(101)의 외부(예: 사용자)로부터 수신할 수 있다. 입력 모듈(150)은, 예를 들면, 마이크, 마우스, 키보드, 키(예: 버튼), 또는 디지털 펜(예: 스타일러스 펜)을 포함할 수 있다.The input module 150 may receive a command or data to be used in a component (eg, the processor 120 ) of the electronic device 101 from the outside (eg, a user) of the electronic device 101 . The input module 150 may include, for example, a microphone, a mouse, a keyboard, a key (eg, a button), or a digital pen (eg, a stylus pen).

음향 출력 모듈(155)은 음향 신호를 전자 장치(101)의 외부로 출력할 수 있다. 음향 출력 모듈(155)은, 예를 들면, 스피커 또는 리시버를 포함할 수 있다. 스피커는 멀티미디어 재생 또는 녹음 재생과 같이 일반적인 용도로 사용될 수 있다. 리시버는 착신 전화를 수신하기 위해 사용될 수 있다. 일 실시예에 따르면, 리시버는 스피커와 별개로, 또는 그 일부로서 구현될 수 있다.The sound output module 155 may output a sound signal to the outside of the electronic device 101 . The sound output module 155 may include, for example, a speaker or a receiver. The speaker can be used for general purposes such as multimedia playback or recording playback. The receiver may be used to receive an incoming call. According to one embodiment, the receiver may be implemented separately from or as part of the speaker.

디스플레이 모듈(160)은 전자 장치(101)의 외부(예: 사용자)로 정보를 시각적으로 제공할 수 있다. 디스플레이 모듈(160)은, 예를 들면, 디스플레이, 홀로그램 장치, 또는 프로젝터 및 해당 장치를 제어하기 위한 제어 회로를 포함할 수 있다. 일 실시예에 따르면, 디스플레이 모듈(160)은 터치를 감지하도록 설정된 터치 센서, 또는 상기 터치에 의해 발생되는 힘의 세기를 측정하도록 설정된 압력 센서를 포함할 수 있다.The display module 160 may visually provide information to the outside (eg, a user) of the electronic device 101 . The display module 160 may include, for example, a control circuit for controlling a display, a hologram device, or a projector and a corresponding device. According to an embodiment, the display module 160 may include a touch sensor configured to sense a touch or a pressure sensor configured to measure the intensity of a force generated by the touch.

오디오 모듈(170)은 소리를 전기 신호로 변환시키거나, 반대로 전기 신호를 소리로 변환시킬 수 있다. 일 실시예에 따르면, 오디오 모듈(170)은, 입력 모듈(150)을 통해 소리를 획득하거나, 음향 출력 모듈(155), 또는 전자 장치(101)와 직접 또는 무선으로 연결된 외부 전자 장치(예: 전자 장치(102))(예: 스피커 또는 헤드폰)를 통해 소리를 출력할 수 있다.The audio module 170 may convert a sound into an electric signal or, conversely, convert an electric signal into a sound. According to an embodiment, the audio module 170 acquires a sound through the input module 150 or an external electronic device (eg, a sound output module 155 ) directly or wirelessly connected to the electronic device 101 . A sound may be output through the electronic device 102 (eg, a speaker or headphones).

센서 모듈(176)은 전자 장치(101)의 작동 상태(예: 전력 또는 온도), 또는 외부의 환경 상태(예: 사용자 상태)를 감지하고, 감지된 상태에 대응하는 전기 신호 또는 데이터 값을 생성할 수 있다. 일 실시예에 따르면, 센서 모듈(176)은, 예를 들면, 제스처 센서, 자이로 센서, 기압 센서, 마그네틱 센서, 가속도 센서, 그립 센서, 근접 센서, 컬러 센서, IR(infrared) 센서, 생체 센서, 온도 센서, 습도 센서, 또는 조도 센서를 포함할 수 있다.The sensor module 176 detects an operating state (eg, power or temperature) of the electronic device 101 or an external environmental state (eg, user state), and generates an electrical signal or data value corresponding to the sensed state. can do. According to one embodiment, the sensor module 176 may include, for example, a gesture sensor, a gyro sensor, a barometric pressure sensor, a magnetic sensor, an acceleration sensor, a grip sensor, a proximity sensor, a color sensor, an IR (infrared) sensor, a biometric sensor, It may include a temperature sensor, a humidity sensor, or an illuminance sensor.

인터페이스(177)는 전자 장치(101)가 외부 전자 장치(예: 전자 장치(102))와 직접 또는 무선으로 연결되기 위해 사용될 수 있는 하나 이상의 지정된 프로토콜들을 지원할 수 있다. 일 실시예에 따르면, 인터페이스(177)는, 예를 들면, HDMI(high definition multimedia interface), USB(universal serial bus) 인터페이스, SD카드 인터페이스, 또는 오디오 인터페이스를 포함할 수 있다.The interface 177 may support one or more designated protocols that may be used by the electronic device 101 to directly or wirelessly connect with an external electronic device (eg, the electronic device 102 ). According to an embodiment, the interface 177 may include, for example, a high definition multimedia interface (HDMI), a universal serial bus (USB) interface, an SD card interface, or an audio interface.

연결 단자(178)는, 그를 통해서 전자 장치(101)가 외부 전자 장치(예: 전자 장치(102))와 물리적으로 연결될 수 있는 커넥터를 포함할 수 있다. 일 실시예에 따르면, 연결 단자(178)는, 예를 들면, HDMI 커넥터, USB 커넥터, SD 카드 커넥터, 또는 오디오 커넥터(예: 헤드폰 커넥터)를 포함할 수 있다.The connection terminal 178 may include a connector through which the electronic device 101 can be physically connected to an external electronic device (eg, the electronic device 102 ). According to an embodiment, the connection terminal 178 may include, for example, an HDMI connector, a USB connector, an SD card connector, or an audio connector (eg, a headphone connector).

햅틱 모듈(179)은 전기적 신호를 사용자가 촉각 또는 운동 감각을 통해서 인지할 수 있는 기계적인 자극(예: 진동 또는 움직임) 또는 전기적인 자극으로 변환할 수 있다. 일 실시예에 따르면, 햅틱 모듈(179)은, 예를 들면, 모터, 압전 소자, 또는 전기 자극 장치를 포함할 수 있다.The haptic module 179 may convert an electrical signal into a mechanical stimulus (eg, vibration or movement) or an electrical stimulus that the user can perceive through tactile or kinesthetic sense. According to an embodiment, the haptic module 179 may include, for example, a motor, a piezoelectric element, or an electrical stimulation device.

카메라 모듈(180)은 정지 영상 및 동영상을 촬영할 수 있다. 일 실시예에 따르면, 카메라 모듈(180)은 하나 이상의 렌즈들, 이미지 센서들, 이미지 시그널 프로세서들, 또는 플래시들을 포함할 수 있다.The camera module 180 may capture still images and moving images. According to an embodiment, the camera module 180 may include one or more lenses, image sensors, image signal processors, or flashes.

전력 관리 모듈(188)은 전자 장치(101)에 공급되는 전력을 관리할 수 있다. 일 실시예에 따르면, 전력 관리 모듈(188)은, 예를 들면, PMIC(power management integrated circuit)의 적어도 일부로서 구현될 수 있다.The power management module 188 may manage power supplied to the electronic device 101 . According to an embodiment, the power management module 188 may be implemented as, for example, at least a part of a power management integrated circuit (PMIC).

배터리(189)는 전자 장치(101)의 적어도 하나의 구성요소에 전력을 공급할 수 있다. 일 실시예에 따르면, 배터리(189)는, 예를 들면, 재충전 불가능한 1차 전지, 재충전 가능한 2차 전지 또는 연료 전지를 포함할 수 있다.The battery 189 may supply power to at least one component of the electronic device 101 . According to one embodiment, battery 189 may include, for example, a non-rechargeable primary cell, a rechargeable secondary cell, or a fuel cell.

통신 모듈(190)은 전자 장치(101)와 외부 전자 장치(예: 전자 장치(102), 전자 장치(104), 또는 서버(108)) 간의 직접(예: 유선) 통신 채널 또는 무선 통신 채널의 수립, 및 수립된 통신 채널을 통한 통신 수행을 지원할 수 있다. 통신 모듈(190)은 프로세서(120)(예: 어플리케이션 프로세서)와 독립적으로 운영되고, 직접(예: 유선) 통신 또는 무선 통신을 지원하는 하나 이상의 커뮤니케이션 프로세서를 포함할 수 있다. 일 실시예에 따르면, 통신 모듈(190)은 무선 통신 모듈(192)(예: 셀룰러 통신 모듈, 근거리 무선 통신 모듈, 또는 GNSS(global navigation satellite system) 통신 모듈) 또는 유선 통신 모듈(194)(예: LAN(local area network) 통신 모듈, 또는 전력선 통신 모듈)을 포함할 수 있다. 이들 통신 모듈 중 해당하는 통신 모듈은 제1 네트워크(198)(예: 블루투스, WiFi(wireless fidelity) direct 또는 IrDA(infrared data association)와 같은 근거리 통신 네트워크) 또는 제2 네트워크(199)(예: 레거시 셀룰러 네트워크, 5G 네트워크, 차세대 통신 네트워크, 인터넷, 또는 컴퓨터 네트워크(예: LAN 또는 WAN)와 같은 원거리 통신 네트워크)를 통하여 외부의 전자 장치(104)와 통신할 수 있다. 이런 여러 종류의 통신 모듈들은 하나의 구성요소(예: 단일 칩)로 통합되거나, 또는 서로 별도의 복수의 구성요소들(예: 복수 칩들)로 구현될 수 있다. 무선 통신 모듈(192)은 가입자 식별 모듈(196)에 저장된 가입자 정보(예: 국제 모바일 가입자 식별자(IMSI))를 이용하여 제1 네트워크(198) 또는 제2 네트워크(199)와 같은 통신 네트워크 내에서 전자 장치(101)를 확인 또는 인증할 수 있다.The communication module 190 is a direct (eg, wired) communication channel or a wireless communication channel between the electronic device 101 and an external electronic device (eg, the electronic device 102, the electronic device 104, or the server 108). It can support establishment and communication performance through the established communication channel. The communication module 190 may include one or more communication processors that operate independently of the processor 120 (eg, an application processor) and support direct (eg, wired) communication or wireless communication. According to one embodiment, the communication module 190 is a wireless communication module 192 (eg, a cellular communication module, a short-range communication module, or a global navigation satellite system (GNSS) communication module) or a wired communication module 194 (eg, : It may include a LAN (local area network) communication module, or a power line communication module). A corresponding communication module among these communication modules is a first network 198 (eg, a short-range communication network such as Bluetooth, wireless fidelity (WiFi) direct, or infrared data association (IrDA)) or a second network 199 (eg, legacy It may communicate with the external electronic device 104 through a cellular network, a 5G network, a next-generation communication network, the Internet, or a computer network (eg, a telecommunication network such as a LAN or a WAN). These various types of communication modules may be integrated into one component (eg, a single chip) or may be implemented as a plurality of components (eg, multiple chips) separate from each other. The wireless communication module 192 uses the subscriber information (eg, International Mobile Subscriber Identifier (IMSI)) stored in the subscriber identification module 196 within a communication network such as the first network 198 or the second network 199 . The electronic device 101 may be identified or authenticated.

무선 통신 모듈(192)은 4G 네트워크 이후의 5G 네트워크 및 차세대 통신 기술, 예를 들어, NR 접속 기술(new radio access technology)을 지원할 수 있다. NR 접속 기술은 고용량 데이터의 고속 전송(eMBB(enhanced mobile broadband)), 단말 전력 최소화와 다수 단말의 접속(mMTC(massive machine type communications)), 또는 고신뢰도와 저지연(URLLC(ultra-reliable and low-latency communications))을 지원할 수 있다. 무선 통신 모듈(192)은, 예를 들어, 높은 데이터 전송률 달성을 위해, 고주파 대역(예: mmWave 대역)을 지원할 수 있다. 무선 통신 모듈(192)은 고주파 대역에서의 성능 확보를 위한 다양한 기술들, 예를 들어, 빔포밍(beamforming), 거대 배열 다중 입출력(massive MIMO(multiple-input and multiple-output)), 전차원 다중입출력(FD-MIMO: full dimensional MIMO), 어레이 안테나(array antenna), 아날로그 빔형성(analog beam-forming), 또는 대규모 안테나(large scale antenna)와 같은 기술들을 지원할 수 있다. 무선 통신 모듈(192)은 전자 장치(101), 외부 전자 장치(예: 전자 장치(104)) 또는 네트워크 시스템(예: 제2 네트워크(199))에 규정되는 다양한 요구사항을 지원할 수 있다. 일 실시예에 따르면, 무선 통신 모듈(192)은 eMBB 실현을 위한 Peak data rate(예: 20Gbps 이상), mMTC 실현을 위한 손실 Coverage(예: 164dB 이하), 또는 URLLC 실현을 위한 U-plane latency(예: 다운링크(DL) 및 업링크(UL) 각각 0.5ms 이하, 또는 라운드 트립 1ms 이하)를 지원할 수 있다.The wireless communication module 192 may support a 5G network after a 4G network and a next-generation communication technology, for example, a new radio access technology (NR). NR access technology includes high-speed transmission of high-capacity data (eMBB (enhanced mobile broadband)), minimization of terminal power and access to multiple terminals (mMTC (massive machine type communications)), or high reliability and low latency (URLLC (ultra-reliable and low-latency) -latency communications)). The wireless communication module 192 may support a high frequency band (eg, mmWave band) to achieve a high data rate, for example. The wireless communication module 192 includes various technologies for securing performance in a high-frequency band, for example, beamforming, massive multiple-input and multiple-output (MIMO), all-dimensional multiplexing. It may support technologies such as full dimensional MIMO (FD-MIMO), an array antenna, analog beam-forming, or a large scale antenna. The wireless communication module 192 may support various requirements specified in the electronic device 101 , an external electronic device (eg, the electronic device 104 ), or a network system (eg, the second network 199 ). According to an embodiment, the wireless communication module 192 may include a peak data rate (eg, 20 Gbps or more) for realizing eMBB, loss coverage (eg, 164 dB or less) for realizing mMTC, or U-plane latency for realizing URLLC ( Example: downlink (DL) and uplink (UL) each 0.5 ms or less, or round trip 1 ms or less).

안테나 모듈(197)은 신호 또는 전력을 외부(예: 외부의 전자 장치)로 송신하거나 외부로부터 수신할 수 있다. 일 실시예에 따르면, 안테나 모듈(197)은 서브스트레이트(예: PCB) 위에 형성된 도전체 또는 도전성 패턴으로 이루어진 방사체를 포함하는 안테나를 포함할 수 있다. 일 실시예에 따르면, 안테나 모듈(197)은 복수의 안테나들(예: 어레이 안테나)을 포함할 수 있다. 이런 경우, 제1 네트워크(198) 또는 제2 네트워크(199)와 같은 통신 네트워크에서 사용되는 통신 방식에 적합한 적어도 하나의 안테나가, 예를 들면, 통신 모듈(190)에 의하여 상기 복수의 안테나들로부터 선택될 수 있다. 신호 또는 전력은 상기 선택된 적어도 하나의 안테나를 통하여 통신 모듈(190)과 외부의 전자 장치 간에 송신되거나 수신될 수 있다. 어떤 실시예에 따르면, 방사체 이외에 다른 부품(예: RFIC(radio frequency integrated circuit))이 추가로 안테나 모듈(197)의 일부로 형성될 수 있다.The antenna module 197 may transmit or receive a signal or power to the outside (eg, an external electronic device). According to an embodiment, the antenna module 197 may include an antenna including a conductor formed on a substrate (eg, a PCB) or a radiator formed of a conductive pattern. According to an embodiment, the antenna module 197 may include a plurality of antennas (eg, an array antenna). In this case, at least one antenna suitable for a communication method used in a communication network such as the first network 198 or the second network 199 is connected from the plurality of antennas by, for example, the communication module 190 . can be selected. A signal or power may be transmitted or received between the communication module 190 and an external electronic device through the selected at least one antenna. According to some embodiments, other components (eg, a radio frequency integrated circuit (RFIC)) other than the radiator may be additionally formed as a part of the antenna module 197 .

다양한 실시예에 따르면, 안테나 모듈(197)은 mmWave 안테나 모듈을 형성할 수 있다. 일 실시예에 따르면, mmWave 안테나 모듈은 인쇄 회로 기판, 상기 인쇄 회로 기판의 제1 면(예: 아래 면)에 또는 그에 인접하여 배치되고 지정된 고주파 대역(예: mmWave 대역)을 지원할 수 있는 RFIC, 및 상기 인쇄 회로 기판의 제2 면(예: 윗 면 또는 측 면)에 또는 그에 인접하여 배치되고 상기 지정된 고주파 대역의 신호를 송신 또는 수신할 수 있는 복수의 안테나들(예: 어레이 안테나)을 포함할 수 있다.According to various embodiments, the antenna module 197 may form a mmWave antenna module. According to one embodiment, the mmWave antenna module comprises a printed circuit board, an RFIC disposed on or adjacent to a first side (eg, bottom side) of the printed circuit board and capable of supporting a designated high frequency band (eg, mmWave band); and a plurality of antennas (eg, an array antenna) disposed on or adjacent to a second side (eg, top or side) of the printed circuit board and capable of transmitting or receiving signals of the designated high frequency band. can do.

상기 구성요소들 중 적어도 일부는 주변 기기들간 통신 방식(예: 버스, GPIO(general purpose input and output), SPI(serial peripheral interface), 또는 MIPI(mobile industry processor interface))을 통해 서로 연결되고 신호(예: 명령 또는 데이터)를 상호간에 교환할 수 있다.At least some of the components are connected to each other through a communication method between peripheral devices (eg, a bus, general purpose input and output (GPIO), serial peripheral interface (SPI), or mobile industry processor interface (MIPI)) and a signal ( eg commands or data) can be exchanged with each other.

일 실시예에 따르면, 명령 또는 데이터는 제2 네트워크(199)에 연결된 서버(108)를 통해서 전자 장치(101)와 외부의 전자 장치(104)간에 송신 또는 수신될 수 있다. 외부의 전자 장치(102 또는 104) 각각은 전자 장치(101)와 동일한 또는 다른 종류의 장치일 수 있다. 일 실시예에 따르면, 전자 장치(101)에서 실행되는 동작들의 전부 또는 일부는 외부의 전자 장치들(102, 104 또는 108) 중 하나 이상의 외부의 전자 장치들에서 실행될 수 있다. 예를 들면, 전자 장치(101)가 어떤 기능이나 서비스를 자동으로, 또는 사용자 또는 다른 장치로부터의 요청에 반응하여 수행해야 할 경우에, 전자 장치(101)는 기능 또는 서비스를 자체적으로 실행시키는 대신에 또는 추가적으로, 하나 이상의 외부의 전자 장치들에게 그 기능 또는 그 서비스의 적어도 일부를 수행하라고 요청할 수 있다. 상기 요청을 수신한 하나 이상의 외부의 전자 장치들은 요청된 기능 또는 서비스의 적어도 일부, 또는 상기 요청과 관련된 추가 기능 또는 서비스를 실행하고, 그 실행의 결과를 전자 장치(101)로 전달할 수 있다. 전자 장치(101)는 상기 결과를, 그대로 또는 추가적으로 처리하여, 상기 요청에 대한 응답의 적어도 일부로서 제공할 수 있다. 이를 위하여, 예를 들면, 클라우드 컴퓨팅, 분산 컴퓨팅, 모바일 에지 컴퓨팅(MEC: mobile edge computing), 또는 클라이언트-서버 컴퓨팅 기술이 이용될 수 있다. 전자 장치(101)는, 예를 들어, 분산 컴퓨팅 또는 모바일 에지 컴퓨팅을 이용하여 초저지연 서비스를 제공할 수 있다. 다른 실시예에 있어서, 외부의 전자 장치(104)는 IoT(internet of things) 기기를 포함할 수 있다. 서버(108)는 기계 학습 및/또는 신경망을 이용한 지능형 서버일 수 있다. 일 실시예에 따르면, 외부의 전자 장치(104) 또는 서버(108)는 제2 네트워크(199) 내에 포함될 수 있다. 전자 장치(101)는 5G 통신 기술 및 IoT 관련 기술을 기반으로 지능형 서비스(예: 스마트 홈, 스마트 시티, 스마트 카, 또는 헬스 케어)에 적용될 수 있다.According to an embodiment, the command or data may be transmitted or received between the electronic device 101 and the external electronic device 104 through the server 108 connected to the second network 199 . Each of the external electronic devices 102 or 104 may be the same as or different from the electronic device 101 . According to an embodiment, all or a part of operations executed in the electronic device 101 may be executed in one or more external electronic devices 102 , 104 , or 108 . For example, when the electronic device 101 is to perform a function or service automatically or in response to a request from a user or other device, the electronic device 101 may perform the function or service itself instead of executing the function or service itself. Alternatively or additionally, one or more external electronic devices may be requested to perform at least a part of the function or the service. One or more external electronic devices that have received the request may execute at least a part of the requested function or service, or an additional function or service related to the request, and transmit a result of the execution to the electronic device 101 . The electronic device 101 may process the result as it is or additionally and provide it as at least a part of a response to the request. For this, for example, cloud computing, distributed computing, mobile edge computing (MEC), or client-server computing technology may be used. The electronic device 101 may provide an ultra-low latency service using, for example, distributed computing or mobile edge computing. In another embodiment, the external electronic device 104 may include an Internet of things (IoT) device. Server 108 may be an intelligent server using machine learning and/or neural networks. According to an embodiment, the external electronic device 104 or the server 108 may be included in the second network 199 . The electronic device 101 may be applied to an intelligent service (eg, smart home, smart city, smart car, or health care) based on 5G communication technology and IoT-related technology.

도 2는 본 발명의 일 실시예에 따른 가상 메모리의 할당과 관련된 전자 장치의 구성을 설명하기 위한 도면이다.2 is a diagram for explaining a configuration of an electronic device related to virtual memory allocation according to an embodiment of the present invention.

도 2를 참조하면, 전자 장치(200)(예: 도 1의 전자 장치(101))는 메모리(210)(예: 도 1의 메모리(130)) 및 프로세서(230)(예: 도 1의 프로세서(120))를 포함할 수 있다. 그러나, 전자 장치(200)의 구성이 이에 한정되는 것은 아니다. 다양한 실시예에 따르면, 전자 장치(200)는 상술한 구성요소 외에 적어도 하나의 다른 구성요소를 더 포함할 수 있다. 예를 들어, 전자 장치(200)는 도 1에 도시된 구성요소들 중 적어도 하나를 더 포함할 수 있다.Referring to FIG. 2 , an electronic device 200 (eg, the electronic device 101 of FIG. 1 ) includes a memory 210 (eg, the memory 130 of FIG. 1 ) and a processor 230 (eg, the electronic device 101 of FIG. 1 ). processor 120). However, the configuration of the electronic device 200 is not limited thereto. According to various embodiments, the electronic device 200 may further include at least one other component in addition to the above-described components. For example, the electronic device 200 may further include at least one of the components illustrated in FIG. 1 .

상기 메모리(210)는 전자 장치(200)의 적어도 하나의 구성요소에 의해 사용되는 다양한 데이터를 저장할 수 있다. 일 실시예에 따르면, 상기 메모리(210)는 상기 프로세서(230)에 의해 실행될 수 있는 어플리케이션(211)을 저장할 수 있다.The memory 210 may store various data used by at least one component of the electronic device 200 . According to an embodiment, the memory 210 may store an application 211 that may be executed by the processor 230 .

상기 프로세서(230)는 전자 장치(200)의 적어도 하나의 다른 구성요소를 제어할 수 있고, 다양한 데이터 처리 또는 연산을 수행할 수 있다. 일 실시예에 따르면, 상기 프로세서(230)는 상기 메모리(210)에 저장된 상기 어플리케이션(211)을 실행시킬 수 있다. 상기 프로세서(230)는 상기 어플리케이션(211)을 실행시키는 과정에서, 상기 메모리(210)의 제한적인 저장 공간을 보다 효율적으로 사용하기 위해, 가상 메모리(250)를 사용하여 실제 물리적으로 존재하는 메모리(210)의 용량보다 더 많은 저장 공간을 제공할 수 있다. 예를 들어, 상기 프로세서(230)는 상기 메모리(210)의 저장 공간 일부를 가상 메모리(250)로 설정하고, 가상 메모리(250)로 설정된 상기 메모리(210)의 저장 공간에 대한 접근을 가상 주소(또는 논리 주소)를 통해 수행되도록 제어할 수 있다.The processor 230 may control at least one other component of the electronic device 200 and may perform various data processing or operations. According to an embodiment, the processor 230 may execute the application 211 stored in the memory 210 . In the process of executing the application 211 , the processor 230 uses the virtual memory 250 to more efficiently use the limited storage space of the memory 210 to actually physically exist memory ( 210) can provide more storage space. For example, the processor 230 sets a part of the storage space of the memory 210 as the virtual memory 250 , and provides access to the storage space of the memory 210 set as the virtual memory 250 as a virtual address. (or logical address) can be controlled to be performed.

상기 가상 메모리(250)는 특정 어플리케이션(211)의 프로세스의 고유 공간인 사용자 영역 및 모든 어플리케이션(211)들의 프로세스들이 공유하는 공간인 커널 영역을 포함할 수 있다. 여기서, 프로세스는 하나의 시스템 즉, 전자 장치(200) 내에서 작동되는 프로그램을 나타낼 수 있다. 상기 사용자 영역은 어플리케이션(211)이 사용하는 지역 변수와 같이 임시로 저장되는 데이터의 저장 공간인 스택 영역(251), 어플리케이션(211)에 의해 동적으로 할당하는 공간인 힙 영역(253), 어플리케이션(211)이 사용하는 전역 변수 또는 정적 변수와 같이 어플리케이션(211)이 실행될 때 생성되고 어플리케이션(211)이 종료되면 시스템에 반환되는 공간인 데이터 영역(255), 및 어플리케이션(211)의 명령어(또는 코드)가 기계어의 형태로 저장되는 공간인 코드 영역(257)을 포함할 수 있다.The virtual memory 250 may include a user area, which is a unique space of a process of a specific application 211 , and a kernel area, which is a space shared by processes of all applications 211 . Here, the process may represent a program operated in one system, that is, the electronic device 200 . The user area includes a stack area 251 that is a storage space for data temporarily stored such as local variables used by the application 211 , a heap area 253 which is a space dynamically allocated by the application 211 , and an application ( A data area 255, which is a space created when the application 211 is executed, and returned to the system when the application 211 is terminated, such as a global variable or static variable used by the 211, and a command (or code) of the application 211 ) may include a code area 257 that is a space in which machine language is stored.

일 실시예에 따르면, 상기 프로세서(230)는 어플리케이션(211)을 실행할 때, 상기 어플리케이션(211)의 설정 파일(예: 상기 어플리케이션(211)의 패키지에 포함된 "AndroidManifest.xml" 파일)에 기재된 힙 영역(253)의 크기 속성(예: "largeHeap"으로 정의되는 속성)의 설정 값(예: "true" 또는 "false"(default 값))에 따라 상기 어플리케이션(211)에 대응되는 가상 메모리(250)의 힙 영역(253)의 크기를 결정할 수 있다. 예를 들어, 상기 힙 영역(253)의 크기 속성의 설정 값이 "true"로 설정된 경우, 상기 프로세서(230)는 상기 힙 영역(253) 중 JVM 힙 영역을 최대로 사용 가능한 크기(예: 1GB)로 할당할 수 있다.According to an embodiment, when the processor 230 executes the application 211 , it is described in a setting file of the application 211 (eg, an “AndroidManifest.xml” file included in the package of the application 211 ). Virtual memory (eg, "true" or "false" (default value)) corresponding to the application 211 according to the set value (eg, "true" or "false" (default value)) of the size attribute (eg, attribute defined as "largeHeap") of the heap area 253 The size of the heap area 253 of 250 may be determined. For example, when the set value of the size attribute of the heap area 253 is set to "true", the processor 230 determines the maximum usable size of the JVM heap area among the heap areas 253 (eg, 1 GB). ) can be assigned.

일 실시예에 따르면, 상기 프로세서(230)는 어플리케이션(211)을 실행할 때, 상기 어플리케이션(211)에 대응되는 가상 메모리(250)에 대한 메모리 할당의 실패를 나타내는 정보(이하, 프로파일이라 한다)가 존재하는 경우, 상기 프로파일에 기반하여 상기 가상 메모리(250)의 힙 영역(253)의 크기를 결정할 수 있다. 이 경우, 상기 프로세서(230)는 상기 어플리케이션(211)의 설정 파일에 기재된 힙 영역(253)의 크기 속성의 설정 값을 무시할 수 있다. 예를 들어, 상기 프로세서(230)는 어플리케이션(211)을 실행하는 중에 상기 어플리케이션(211)에 대응되는 가상 메모리(250)에 대한 메모리 할당이 실패하면, 상기 메모리 할당의 실패를 나타내는 정보 즉, 프로파일을 설정할 수 있고, 설정된 프로파일을 상기 메모리(210)에 저장할 수 있다. 일 실시예에 따르면, 상기 프로파일이 상기 메모리(210)에 저장되어 있지 않은 경우, 상기 프로세서(230)는 상기 프로파일을 새로 생성할 수 있고, 상기 프로파일이 상기 메모리(210)에 저장되어 있는 경우, 상기 프로세서(230)는 상기 저장된 프로파일을 수정(또는 변경)할 수 있다. 일 실시예에 따르면, 상기 프로파일은 상기 메모리(210)에 파일 형태로 저장될 수 있다. 또한, 상기 프로세서(230)는 상기 프로파일이 존재하는 경우, 상기 어플리케이션(211)의 재실행 시, 상기 프로파일에 기반하여 상기 가상 메모리(250)의 힙 영역(253)의 크기를 결정할 수 있다.According to an embodiment, when the processor 230 executes the application 211 , information indicating a failure in memory allocation to the virtual memory 250 corresponding to the application 211 (hereinafter referred to as a profile) is displayed. If present, the size of the heap area 253 of the virtual memory 250 may be determined based on the profile. In this case, the processor 230 may ignore the setting value of the size attribute of the heap area 253 described in the setting file of the application 211 . For example, if memory allocation for the virtual memory 250 corresponding to the application 211 fails while the processor 230 is executing the application 211 , information indicating the failure of the memory allocation, that is, the profile can be set, and the set profile can be stored in the memory 210 . According to an embodiment, when the profile is not stored in the memory 210 , the processor 230 may newly create the profile, and when the profile is stored in the memory 210 , The processor 230 may modify (or change) the stored profile. According to an embodiment, the profile may be stored in the memory 210 in the form of a file. Also, when the profile exists, the processor 230 may determine the size of the heap area 253 of the virtual memory 250 based on the profile when the application 211 is re-executed.

일 실시예에 따르면, 상기 프로세서(230)는 상기 메모리 할당이 실패하면, 상기 어플리케이션(211)의 실행에 따른 상기 힙 영역(253)의 실제 사용량을 상기 프로파일에 포함시킬 수 있다. 예컨대, 상기 프로세서(230)는 상기 메모리 할당이 실패하는 경우, 상기 메모리 할당이 실패한 시점을 기준으로 상기 힙 영역(253)의 실제 사용량에 대한 정보를 확인하여 상기 프로파일에 기록할 수 있다. 또한, 상기 프로세서(230)는 상기 가상 메모리(250)의 할당 시, 상기 프로파일에 기록된 상기 힙 영역(253)의 실제 사용량에 기반하여 상기 힙 영역(253)의 크기를 결정할 수 있다. 상기 힙 영역(253)의 크기가 상기 프로파일에 기록된 상기 힙 영역(253)의 실제 사용량에 기반하여 결정됨에 따라, 상기 가상 메모리(250)의 저장 공간에 대한 효율성이 극대화될 수 있으며, 상기 가상 메모리(250)에 대한 메모리 할당의 실패 확률이 낮아질 수 있다.According to an embodiment, when the memory allocation fails, the processor 230 may include the actual usage of the heap area 253 according to the execution of the application 211 in the profile. For example, when the memory allocation fails, the processor 230 may check information on the actual usage of the heap area 253 based on a time point at which the memory allocation fails and record the information in the profile. Also, when the virtual memory 250 is allocated, the processor 230 may determine the size of the heap area 253 based on the actual usage of the heap area 253 recorded in the profile. As the size of the heap area 253 is determined based on the actual usage of the heap area 253 recorded in the profile, the efficiency of the storage space of the virtual memory 250 can be maximized, and the virtual A failure probability of memory allocation for the memory 250 may be reduced.

일 실시예에 따르면, 상기 힙 영역(253)의 실제 사용량은 가상 메모리의 저장 공간 부족(out of memory)에 따른 메모리 할당에 대한 실패 신호의 발생시, 확인된 상기 힙 영역(253)의 사용량을 기반으로 계산될 수 있다.According to an embodiment, the actual usage of the heap area 253 is based on the checked usage of the heap area 253 when a failure signal for memory allocation due to out of memory in the virtual memory occurs. can be calculated as

일 실시예에 따르면, 상기 힙 영역(253)의 크기는 지정된 개수로 구분된 크기 범위들을 나타내는 단계 값으로 설정될 수 있다. 예를 들어, 상기 힙 영역(253)의 크기는 제1 단계 값(예: 256MB), 제2 단계 값(예: 384MB), 및 제3 단계 값(예: 512MB)으로 구분될 수 있다. 상기 제1 단계 값은 상기 힙 영역(253)의 크기의 최소값이 될 수 있고, 상기 힙 영역(253)의 실제 사용량이 상기 최소값 이하의 크기 범위(예: 0~256MB)에 포함될 때 설정될 수 있다. 마찬가지로, 상기 제2 단계 값은 상기 힙 영역(253)의 실제 사용량이 상기 최소값보다 크고 상기 제2 단계 값 이하의 크기 범위(예: 257~384MB)에 포함될 때 설정될 수 있고, 상기 제3 단계 값은 상기 힙 영역(253)의 실제 사용량이 상기 제2 단계 값보다 크고 상기 제3 단계 값 이하의 크기 범위(예: 385~512MB)에 포함될 때 설정될 수 있다. 여기서, 구분되는 단계 값의 개수가 이에 한정되는 것은 아니다. 상기 구분되는 단계 값의 개수는 상기 힙 영역(253)의 최대로 사용 가능한 크기에 따라 결정될 수 있고, 적어도 2개 이상이 될 수 있다.According to an embodiment, the size of the heap area 253 may be set as a step value indicating size ranges divided by a specified number. For example, the size of the heap area 253 may be divided into a first stage value (eg, 256 MB), a second stage value (eg, 384 MB), and a third stage value (eg, 512 MB). The first step value may be the minimum value of the size of the heap area 253, and may be set when the actual usage of the heap area 253 is included in the size range (eg, 0 to 256 MB) less than the minimum value. have. Similarly, the second step value may be set when the actual usage of the heap area 253 is greater than the minimum value and is included in a size range (eg, 257 to 384 MB) less than or equal to the second step value, and the third step The value may be set when the actual usage of the heap area 253 is greater than the second step value and is included in the size range (eg, 385 to 512 MB) less than or equal to the third step value. Here, the number of differentiated step values is not limited thereto. The number of the differentiated step values may be determined according to the maximum usable size of the heap area 253 , and may be at least two or more.

일 실시예에 따르면, 상기 프로세서(230)는 상기 가상 메모리(250)에 대한 메모리 할당의 실패의 종류에 따라 상기 힙 영역(253)의 크기를 증가 또는 감소시킬 수 있다. 일 예로, 상기 메모리 할당의 실패가 상기 가상 메모리(250)에 포함된 영역들 중 상기 힙 영역(253) 이외의 영역에 대한 저장 공간의 부족 시 발생되는 제1 실패인 경우, 상기 프로세서(230)는 상기 힙 영역(253)의 크기를 감소시킬 수 있다. 이를 위해, 상기 프로세서(230)는 상기 프로파일에 상기 힙 영역(253)의 크기를 줄이기 위한 정보를 포함시킬 수 있다. 일 실시예에 따르면, 상기 프로세서(230)는 상기 프로파일에 상기 힙 영역(253)의 크기를 적어도 한 단계 낮은 값으로 설정하도록 하는 정보를 기록할 수 있다. 예를 들어, 상기 힙 영역(253)의 현재의 크기가 상기 제3 단계 값으로 설정된 경우, 상기 프로세서(230)는 상기 프로파일에 상기 힙 영역(253)의 크기를 상기 제2 단계 값 또는 상기 제1 단계 값으로 설정하도록 하는 정보를 기록할 수 있다. 또 다른 예를 들어, 상기 힙 영역(253)의 현재의 크기가 상기 제2 단계 값으로 설정된 경우, 상기 프로세서(230)는 상기 프로파일에 상기 힙 영역(253)의 크기를 상기 제1 단계 값으로 설정하도록 하는 정보를 기록할 수 있다. According to an embodiment, the processor 230 may increase or decrease the size of the heap area 253 according to the type of failure in memory allocation for the virtual memory 250 . For example, when the memory allocation failure is the first failure that occurs when a storage space for a region other than the heap region 253 among regions included in the virtual memory 250 is insufficient, the processor 230 may reduce the size of the heap region 253 . To this end, the processor 230 may include information for reducing the size of the heap area 253 in the profile. According to an embodiment, the processor 230 may record information for setting the size of the heap area 253 to a value that is at least one step lower in the profile. For example, when the current size of the heap region 253 is set to the third stage value, the processor 230 sets the size of the heap region 253 in the profile to the second stage value or the second stage value. You can record information that causes it to be set to a one-step value. As another example, when the current size of the heap region 253 is set to the second stage value, the processor 230 sets the size of the heap region 253 to the first stage value in the profile. You can record information that allows you to set it.

다른 예로, 상기 메모리 할당의 실패가 상기 가상 메모리(250)에 포함된 영역들 중 상기 힙 영역(253)에 대한 저장 공간의 부족 시 발생되는 제2 실패인 경우, 상기 프로세서(230)는 상기 힙 영역(253)의 크기를 증가시킬 수 있다. 이를 위해, 상기 프로세서(230)는 상기 프로파일에 상기 힙 영역(253)의 크기를 늘리기 위한 정보를 포함시킬 수 있다. 일 실시예에 따르면, 상기 프로세서(230)는 상기 프로파일에 상기 힙 영역(253)의 크기를 적어도 한 단계 높은 값으로 설정하도록 하는 정보를 기록할 수 있다. 예를 들어, 상기 힙 영역(253)의 현재의 크기가 상기 제1 단계 값으로 설정된 경우, 상기 프로세서(230)는 상기 프로파일에 상기 힙 영역(253)의 크기를 상기 제2 단계 값 또는 상기 제3 단계 값으로 설정하도록 하는 정보를 기록할 수 있다. 또 다른 예를 들어, 상기 힙 영역(253)의 현재의 크기가 상기 제2 단계 값으로 설정된 경우, 상기 프로세서(230)는 상기 프로파일에 상기 힙 영역(253)의 크기를 상기 제3 단계 값으로 설정하도록 하는 정보를 기록할 수 있다.As another example, when the memory allocation failure is a second failure that occurs when a storage space for the heap area 253 among areas included in the virtual memory 250 is insufficient, the processor 230 performs the The size of the region 253 may be increased. To this end, the processor 230 may include information for increasing the size of the heap area 253 in the profile. According to an embodiment, the processor 230 may record information for setting the size of the heap area 253 to a value that is at least one step higher in the profile. For example, when the current size of the heap region 253 is set to the first stage value, the processor 230 sets the size of the heap region 253 to the second stage value or the second stage value in the profile. You can record information that causes it to be set to a three-level value. As another example, when the current size of the heap region 253 is set to the second stage value, the processor 230 sets the size of the heap region 253 to the third stage value in the profile. You can record information that allows you to set it.

상기 제1 실패는 예를 들어, 파일에 대한 메모리 매핑 기능을 수행하는 함수(예: mmap() 함수)의 사용 시 발생되는 저장 공간의 부족(예: "ENOMEM(out of memory)")에 따른 실패를 나타낼 수 있다. 상기 제2 실패는 예를 들어, JVM 힙 영역의 저장 공간의 부족(예: "JVM OOM(out of memory)")에 따른 실패를 나타낼 수 있다.The first failure is caused by, for example, a lack of storage space (eg, "out of memory (ENOMEM)") that occurs when a function that performs a memory mapping function for a file (eg, mmap() function) is used. may indicate failure. The second failure may indicate, for example, a failure due to insufficient storage space in the JVM heap area (eg, “JVM out of memory (OOM)”).

일 실시예에 따르면, 상기 프로세서(230)는 상기 제1 실패의 발생 시 상기 힙 영역(253)의 실제 사용량에 기반하여 상기 힙 영역(253)의 크기에 대한 변경 여부를 결정할 수 있다. 상기 프로세서(230)는 상기 힙 영역(253)의 실제 사용량이 상기 제1 실패의 발생에 따른 상기 힙 영역(253)의 크기를 감소하기 위한 단계 값보다 작으면, 상기 힙 영역(253)의 크기를 상기 단계 값으로 설정할 수 있다. 예를 들어, 상기 힙 영역(253)의 현재 크기가 상기 제3 단계 값으로 설정된 상태에서, 상기 힙 영역(253)의 실제 사용량이 상기 제2 단계 값보다 작으면, 상기 제1 실패의 발생에 따른 상기 힙 영역(253)의 크기를 상기 제2 단계 값으로 설정할 수 있다. 또 다른 예를 들어, 상기 힙 영역(253)의 현재 크기가 상기 제3 단계 값으로 설정된 상태에서, 상기 힙 영역(253)의 실제 사용량이 상기 제1 단계 값보다 작으면, 상기 제1 실패의 발생에 따른 상기 힙 영역(253)의 크기를 상기 제2 단계 값 또는 상기 제1 단계 값으로 설정할 수 있다.According to an embodiment, when the first failure occurs, the processor 230 may determine whether to change the size of the heap area 253 based on the actual usage of the heap area 253 . If the actual usage of the heap area 253 is smaller than the step value for reducing the size of the heap area 253 according to the occurrence of the first failure, the processor 230 determines the size of the heap area 253 . may be set as the step value. For example, if the current size of the heap area 253 is set to the third step value, and the actual usage of the heap area 253 is less than the second step value, the first failure occurs. Accordingly, the size of the heap region 253 may be set to the value of the second step. As another example, if the actual usage of the heap area 253 is smaller than the first step value in a state where the current size of the heap area 253 is set to the third step value, the first failure The size of the heap region 253 according to the occurrence may be set to the second stage value or the first stage value.

일 실시예에 따르면, 상기 프로세서(230)는 상기 힙 영역(253)의 크기가 동일한 상태에서, 상기 제1 실패의 발생 이력과 상기 제2 실패의 발생 이력이 모두 존재하는 경우, 상기 힙 영역(253)의 크기를 변경하지 않을 수 있다. 예컨대, 상기 힙 영역(253)의 크기가 상기 제2 단계 값으로 설정된 상태에서, 상기 제1 실패 및 상기 제2 실패가 발생한 경우, 상기 프로세서(230)는 상기 힙 영역(253)의 크기를 유지시킬 수 있다.According to an embodiment, the processor 230 determines that when both the history of occurrence of the first failure and the history of occurrence of the second failure exist in a state in which the size of the heap region 253 is the same, the heap region ( 253) may not change the size. For example, when the first failure and the second failure occur while the size of the heap area 253 is set to the second stage value, the processor 230 maintains the size of the heap area 253 . can do it

일 실시예에 따르면, 상기 프로세서(230)는 상기 힙 영역(253)의 크기가 동일하지 않은 상태에서, 상기 제1 실패의 발생 이력과 상기 제2 실패의 발생 이력이 모두 존재하는 경우, 상기 힙 영역(253)의 실제 사용량에 기반하여 상기 힙 영역(253)의 크기에 대한 변경 여부를 결정할 수 있다. 상기 프로세서(230)는 상기 제1 실패가 발생된 시점의 상기 힙 영역(253)의 크기와 상기 제2 실패가 발생된 시점의 상기 힙 영역(253)의 크기 사이에 설정 가능한 크기가 존재하는 경우, 상기 힙 영역(253)의 실제 사용량이 상기 설정 가능한 크기보다 작은지를 판단하고, 상기 힙 영역(253)의 실제 사용량이 상기 설정 가능한 크기보다 작은 경우, 상기 힙 영역(253)의 크기를 상기 설정 가능한 크기로 설정할 수 있다. 예를 들어, 상기 힙 영역(253)의 크기가 상기 제1 단계 값일 때 상기 제2 실패가 발생되었고, 상기 힙 영역(253)의 크기가 상기 제3 단계일 때 상기 제1 실패가 발생되었다면, 상기 프로세서(230)는 상기 힙 영역(253)의 실제 사용량이 상기 제1 단계 값과 상기 제3 단계 값의 사이 값이 상기 제2 단계 값보다 작은지를 확인하고, 상기 힙 영역(253)의 실제 사용량이 상기 제2 단계 값보다 작은 경우, 상기 힙 영역(253)의 크기를 상기 제2 단계 값으로 설정할 수 있다. 또 다른 예를 들어, 상기 힙 영역(253)의 크기가 상기 제1 단계 값일 때 상기 제2 실패가 발생되었고, 상기 힙 영역(253)의 크기가 상기 제2 단계일 때 상기 제1 실패가 발생되었다면, 상기 제1 단계 값과 상기 제2 단계 값 사이에 설정 가능한 단계 값이 존재하지 않기 때문에, 상기 프로세서(230)는 상기 힙 영역(253)의 실제 사용량을 고려하여, 상기 힙 영역(253)의 크기를 상기 제2 단계 값으로 설정할 수 있다.According to an embodiment, the processor 230 determines that when both the history of occurrence of the first failure and the history of occurrence of the second failure exist in a state where the size of the heap area 253 is not the same, the heap Whether to change the size of the heap area 253 may be determined based on the actual usage of the area 253 . When the processor 230 has a settable size between the size of the heap area 253 at the time when the first failure occurs and the size of the heap area 253 at the time when the second failure occurs , it is determined whether the actual usage of the heap area 253 is smaller than the settable size, and when the actual usage of the heap area 253 is smaller than the settable size, the size of the heap area 253 is set It can be set to any possible size. For example, if the second failure occurs when the size of the heap region 253 is the first stage value, and the first failure occurs when the size of the heap region 253 is the third stage, The processor 230 checks whether the actual usage of the heap area 253 is less than the value of the second step between the first step value and the third step value, and the actual amount of the heap area 253 is When the amount used is smaller than the value of the second step, the size of the heap area 253 may be set as the value of the second step. For another example, the second failure occurs when the size of the heap region 253 is the first stage value, and the first failure occurs when the size of the heap region 253 is the second stage , since there is no settable step value between the first step value and the second step value, the processor 230 considers the actual usage of the heap area 253, may be set as the value of the second step.

상술한 설명에서, 상기 힙 영역(253)의 크기가 지정된 개수로 구분된 크기 범위들을 나타내는 단계 값으로 설정되는 경우에 대해 설명하였지만, 이에 한정되는 것은 아니다. 다양한 실시예에 따르면, 상기 프로세서(230)는 상기 힙 영역(253)의 크기를 상기 힙 영역(253)의 실제 사용량보다 지정된 크기 이상 큰 값으로 설정할 수도 있다. 이 경우, 상기 프로세서(230)는 상기 메모리(210)의 단위 처리량(예: 페이지 크기)에 대응되는 크기로 상기 힙 영역(253)의 크기를 설정할 수 있다.In the above description, the case in which the size of the heap area 253 is set to a step value indicating size ranges divided by a specified number has been described, but the present invention is not limited thereto. According to various embodiments, the processor 230 may set the size of the heap area 253 to a value larger than a specified size or more than the actual usage of the heap area 253 . In this case, the processor 230 may set the size of the heap area 253 to a size corresponding to the unit throughput (eg, page size) of the memory 210 .

일 실시예에 따르면, 상기 힙 영역(253)의 크기는 실제 사용량에 기반하여 계산된 메모리의 크기 값(예: 0~1GB)일 수 있다. 예를 들어, 상기 힙 영역(253)의 크기는 실제 사용량 또는 실제 사용량에 마진(margin)값(예: 지정된 크기 값 또는 현재 할당된 힙 영역(253)의 크기에 지정된 비율을 곱한 값)을 더하여 계산된 크기일 수 있다.According to an embodiment, the size of the heap area 253 may be a memory size value (eg, 0 to 1 GB) calculated based on actual usage. For example, the size of the heap area 253 is determined by adding a margin value (eg, a specified size value or a value obtained by multiplying the size of the currently allocated heap area 253 by a specified ratio) to the actual usage or actual usage. It may be a calculated size.

일 실시예에 따르면, 상기 메모리 할당의 실패가 상기 가상 메모리(250)에 포함된 영역들 중 상기 힙 영역(253) 이외의 영역에 대한 저장 공간의 부족 시 발생되는 제1 실패인 경우, 상기 프로세서(230)는 상기 프로파일에 상기 힙 영역(253)의 크기를 지정되거나 계산된 크기만큼 작은 값으로 설정하도록 하는 정보를 기록할 수 있다. 예를 들어, 상기 힙 영역(253)의 현재의 크기가 제1 설정 값으로 설정된 경우, 상기 프로세서(230)는 상기 프로파일에 상기 힙 영역(253)의 크기를 상기 제1 설정 값보다 작은 제2 설정 값으로 설정하도록 하는 정보를 기록할 수 있다. According to an embodiment, when the memory allocation failure is the first failure that occurs when a storage space for a region other than the heap region 253 among regions included in the virtual memory 250 is insufficient, the processor Reference numeral 230 records information for setting the size of the heap area 253 to a value smaller by a specified or calculated size in the profile. For example, when the current size of the heap area 253 is set to a first set value, the processor 230 sets the size of the heap area 253 in the profile to a second value smaller than the first set value. It is possible to record information to set it as a set value.

일 실시예에 따르면, 상기 메모리 할당의 실패가 상기 가상 메모리(250)에 포함된 영역들 중 상기 힙 영역(253)에 대한 저장 공간의 부족 시 발생되는 제2 실패인 경우, 상기 프로세서(230)는 상기 프로파일에 상기 힙 영역(253)의 크기를 지정되거나 계산된 크기만큼 큰 값으로 설정하도록 하는 정보를 기록할 수 있다. 예를 들어, 상기 힙 영역(253)의 현재의 크기가 제1 설정 값으로 설정된 경우, 상기 프로세서(230)는 상기 프로파일에 상기 힙 영역(253)의 크기를 상기 제1 설정 값보다 큰 제2 설정 값으로 설정하도록 하는 정보를 기록할 수 있다. According to an embodiment, when the failure of the memory allocation is the second failure occurring when the storage space for the heap area 253 among the areas included in the virtual memory 250 is insufficient, the processor 230 may record information for setting the size of the heap area 253 to a value as large as a specified or calculated size in the profile. For example, when the current size of the heap area 253 is set to a first set value, the processor 230 sets the size of the heap area 253 in the profile to a second value greater than the first set value. It is possible to record information to set it as a set value.

일 실시예에 따르면, 상기 프로세서(230)는 상기 제1 실패의 발생 시, 상기 어플리케이션(211)의 실행과 관련된 프로세스로 상기 제1 실패의 발생을 나타내는 신호를 전송할 수 있다. 일 실시예에 따르면, 상기 신호는 상기 프로세스의 내부 동작 중 독립적으로 수행가능한 SW 모듈의 결과값(예: 실패 또는 성공의 결과값)을 포함할 수 있다. 상기 SW 모듈은 힙 영역을 설정하는 기능을 수행하는 모듈일 수 있다. 상기 제1 실패의 경우, 한 번 발생될 때 이어서 여러 번 동일한 종류의 실패(제1 실패)가 발생될 수 있기 때문에, 상기 프로세서(230)는 상기 신호를 전송한 후, 지정된 횟수(예: 50회)의 동일한 종류의 다른 제1 실패들이 발생되면, 상기 다른 제1 실패들의 발생을 나타내는 신호들이 상기 프로세스로 전송되지 않도록 제어할 수 있다. 또한, 상기 프로세서(230)는 상기 지정된 횟수의 다른 제1 실패들이 발생된 후, 또 다른 제1 실패가 발생되면, 새롭게 발생된 상기 또 다른 제1 실패의 발생을 나타내는 신호를 상기 프로세스로 전송할 수 있다. 일 실시예에 따르면, 상기 프로세서(230)는 상기 프로세스로 전송된 상기 제1 실패의 발생을 나타내는 신호의 개수에 대한 정보를 상기 프로파일에 포함시킬 수 있다. 예컨대, 상기 프로세서(230)는 상기 제1 실패의 발생을 나타내는 신호의 개수를 상기 프로파일에 기록할 수 있다.According to an embodiment, when the first failure occurs, the processor 230 may transmit a signal indicating the occurrence of the first failure to a process related to the execution of the application 211 . According to an embodiment, the signal may include a result value (eg, a result value of failure or success) of an independently executable SW module during internal operation of the process. The SW module may be a module that performs a function of setting a heap area. In the case of the first failure, since the same type of failure (first failure) may occur several times after being generated once, the processor 230 transmits the signal and then performs a specified number of times (eg, 50 When other first failures of the same type occur, it is possible to control so that signals indicating occurrence of the other first failures are not transmitted to the process. In addition, when another first failure occurs after the other first failures of the specified number of times, the processor 230 may transmit a newly generated signal indicating the occurrence of the other first failure to the process. have. According to an embodiment, the processor 230 may include information on the number of signals indicating the occurrence of the first failure transmitted to the process in the profile. For example, the processor 230 may record the number of signals indicating the occurrence of the first failure in the profile.

일 실시예에 따르면, 상기 프로세서(230)는 상기 프로파일에 포함된 상기 제1 실패의 발생을 나타내는 신호의 개수가 지정된 값(예: 3회)을 초과하면, 상기 힙 영역(253)의 크기에 대한 변경 여부를 결정할 수 있다. 예컨대, 상기 프로세서(230)는 상기 제1 실패의 발생을 나타내는 신호의 개수가 상기 지정된 값을 초과하면, 상기 힙 영역(253)의 실제 사용량 및 상기 제2 실패의 발생 이력에 기반하여, 상기 힙 영역(253)의 크기에 대한 변경 여부를 결정할 수 있다.According to an embodiment, when the number of signals indicating occurrence of the first failure included in the profile exceeds a specified value (eg, three times), the processor 230 determines the size of the heap area 253. You can decide whether to change or not. For example, when the number of signals indicating the occurrence of the first failure exceeds the specified value, the processor 230 is configured to, based on the actual usage of the heap area 253 and the history of occurrence of the second failure, Whether to change the size of the region 253 may be determined.

일 실시예에 따르면, 상기 프로파일에 포함되는 정보 즉, 상기 프로파일에 기록되는 정보는 상기 힙 영역(253)의 크기에 대한 변경 여부에 관한 정보(예: 크기 유지, 크기 감소 및 크기 증가 중 하나를 나타내는 값), 상기 힙 영역(253)의 크기 변경 값(예: 변경할 단계 값 또는 변경할 크기 값), 상기 힙 영역(253)의 실제 사용량, 상기 제1 실패의 발생을 나타내는 신호의 개수, 및 상기 제2 실패의 발생 횟수 중 적어도 하나를 포함할 수 있다.According to an embodiment, the information included in the profile, that is, the information recorded in the profile, includes information on whether the size of the heap area 253 is changed (eg, one of size maintenance, size reduction, and size increase). value), the size change value of the heap area 253 (eg, a step value to change or a size value to change), the actual usage of the heap area 253, the number of signals indicating the occurrence of the first failure, and the It may include at least one of the number of occurrences of the second failure.

상술한 바와 같이, 다양한 실시예에 따르면, 전자 장치(예: 도 2의 전자 장치(200))는, 어플리케이션(예: 도 2의 어플리케이션(211))을 저장하는 메모리(예: 도 2의 메모리(210)), 및 상기 메모리와 작동적으로 연결된 프로세서(예: 도 2의 프로세서(230))를 포함하고, 상기 프로세서는, 상기 어플리케이션의 실행 중 상기 어플리케이션에 대응되는 가상 메모리(예: 도 2의 가상 메모리(250))에 대한 메모리 할당이 실패하면, 상기 메모리 할당의 실패를 나타내는 정보를 설정하고, 상기 어플리케이션의 재실행 시, 상기 설정된 정보가 존재하면, 상기 설정된 정보에 기반하여 상기 가상 메모리에 포함된 힙 영역(예: 도 2의 힙 영역(253))의 크기를 결정하고, 상기 결정된 크기의 힙 영역을 포함하는 상기 가상 메모리를 할당하도록 설정될 수 있다.As described above, according to various embodiments, the electronic device (eg, the electronic device 200 of FIG. 2 ) stores an application (eg, the application 211 of FIG. 2 ) in a memory (eg, the memory of FIG. 2 ) 210), and a processor operatively connected to the memory (eg, the processor 230 of FIG. 2 ), wherein the processor includes a virtual memory corresponding to the application (eg, FIG. 2 ) during execution of the application If the memory allocation to the virtual memory 250 of the , information indicating the failure of the memory allocation is set, and when the application is re-executed, if the set information exists, the information indicating the failure of the memory allocation is stored in the virtual memory based on the set information. The size of the included heap area (eg, the heap area 253 of FIG. 2 ) may be determined and the virtual memory including the heap area of the determined size may be allocated.

다양한 실시예에 따르면, 상기 프로세서는, 상기 어플리케이션의 재실행 시, 상기 설정된 정보가 존재하면, 상기 어플리케이션의 설정 파일에 기재된 상기 힙 영역의 크기 속성의 설정 값을 무시하도록 설정될 수 있다.According to various embodiments, the processor may be set to ignore a setting value of the size attribute of the heap area described in a setting file of the application if the set information exists when the application is re-executed.

다양한 실시예에 따르면, 상기 프로세서는, 상기 어플리케이션의 실행에 따른 상기 힙 영역의 실제 사용량을 상기 설정된 정보에 포함시키고, 상기 힙 영역의 실제 사용량에 기반하여 상기 힙 영역의 크기를 결정하도록 설정될 수 있다.According to various embodiments, the processor may be configured to include the actual usage of the heap area according to the execution of the application in the set information, and to determine the size of the heap area based on the actual usage of the heap area. have.

다양한 실시예에 따르면, 상기 힙 영역의 크기는 지정된 개수로 구분된 크기 범위들을 나타내는 단계 값으로 설정되고, 상기 프로세서는, 상기 크기 범위들 중 상기 힙 영역의 실제 사용량이 포함되는 크기 범위를 나타내는 단계 값으로 상기 힙 영역의 크기를 설정할 수 있다.According to various embodiments, the size of the heap area is set to a step value representing size ranges divided by a specified number, and the processor represents, among the size ranges, a size range in which the actual usage of the heap area is included. The size of the heap area can be set as a value.

다양한 실시예에 따르면, 상기 메모리 할당의 실패는 상기 가상 메모리에 포함된 영역들 중 상기 힙 영역 이외의 영역에 대한 저장 공간의 부족 시 발생되는 제1 실패를 포함할 수 있다.According to various embodiments, the failure of the memory allocation may include a first failure occurring when a storage space for a region other than the heap region among regions included in the virtual memory is insufficient.

다양한 실시예에 따르면, 상기 프로세서는, 상기 제1 실패의 발생 시, 상기 설정된 정보에 상기 힙 영역의 크기를 줄이기 위한 정보를 포함시키도록 설정될 수 있다.According to various embodiments, when the first failure occurs, the processor may be configured to include information for reducing the size of the heap area in the set information.

다양한 실시예에 따르면, 상기 프로세서는, 상기 제1 실패의 발생 시, 상기 어플리케이션의 실행과 관련된 프로세스로 상기 제1 실패의 발생을 나타내는 신호를 전송하도록 설정될 수 있다.According to various embodiments, when the first failure occurs, the processor may be configured to transmit a signal indicating the occurrence of the first failure to a process related to the execution of the application.

다양한 실시예에 따르면, 상기 프로세서는, 상기 신호의 전송 후, 지정된 횟수의 다른 제1 실패들이 발생되면, 상기 다른 제1 실패들의 발생을 나타내는 신호들을 상기 프로세스로 전송하지 않도록 제어하고, 상기 다른 제1 실패들의 발생 후, 또 다른 제1 실패가 발생되면, 상기 또 다른 제1 실패의 발생을 나타내는 신호를 상기 프로세스로 전송하고, 상기 프로세스가 수신한 상기 신호의 개수가 지정된 값을 초과하면, 상기 힙 영역의 크기에 대한 변경 여부를 결정하도록 설정될 수 있다.According to various embodiments, the processor controls not to transmit signals indicating the occurrence of the other first failures to the process, if other first failures of a specified number of times occur after the signal is transmitted, After the occurrence of 1 failures, when another first failure occurs, a signal indicating the occurrence of the another first failure is transmitted to the process, and when the number of the signals received by the process exceeds a specified value, the It can be set to determine whether to change the size of the heap area.

다양한 실시예에 따르면, 상기 메모리 할당의 실패는 상기 가상 메모리에 포함된 영역들 중 상기 힙 영역에 대한 저장 공간의 부족 시 발생되는 제2 실패를 포함할 수 있다.According to various embodiments, the failure of the memory allocation may include a second failure occurring when a storage space for the heap area among the areas included in the virtual memory is insufficient.

다양한 실시예에 따르면, 상기 프로세서는, 상기 제2 실패의 발생 시, 상기 설정된 정보에 상기 힙 영역의 크기를 늘리기 위한 정보를 포함시키도록 설정될 수 있다.According to various embodiments, when the second failure occurs, the processor may be configured to include information for increasing the size of the heap area in the set information.

도 3은 본 발명의 일 실시예에 따른 가상 메모리에 대한 메모리 할당의 실패를 처리하는 방법을 설명하기 위한 도면이다.3 is a diagram for explaining a method of handling a failure in memory allocation to a virtual memory according to an embodiment of the present invention.

도 3을 참조하면, 전자 장치(예: 도 2의 전자 장치(200))의 프로세서(예: 도 2의 프로세서(230))는 동작 310에서, 가상 메모리(예: 도 2의 가상 메모리(250))에 대한 메모리 할당이 실패했는지를 판단할 수 있다. 상기 가상 메모리에 대한 메모리 할당의 실패는 예를 들어, 파일에 대한 메모리 매핑 기능을 수행하는 함수(예: mmap())의 사용 시 발생되는 저장 공간의 부족에 따른 제1 실패, 및 JVM 힙 영역의 저장 공간의 부족에 따른 제2 실패를 포함할 수 있다. 상기 제1 실패 및 상기 제2 실패는 시스템 이벤트의 형태로 발생될 수 있다. 상기 제1 실패는 예를 들어, mmap() 함수의 호출 결과로 실패 값(예: "MAP_FAILED")이 리턴되고, 실패에 대한 식별 값(예: "errno")이 저장 공간의 부족을 나타내는 값(예: "ENOMEM(out of memory)")을 포함하는 상태를 나타낼 수 있다. 또한, 상기 제2 실패는 예를 들어, JVM 힙 영역의 저장 공간의 부족을 나타내는 이벤트(예: "JVM OOM(out of memory)")가 발생된 상태를 나타낼 수 있다. 예를 들어, 상기 제2 실패는 어플리케이션(211) 실행 시 또는 실행 중에 자바 오브젝트(java object)가 힙 영역의 저장 공간 부족으로 상기 힙 영역에 할당되지 못하는 경우, 이벤트(예: “OOM(out of memory)”)가 발생된 상태를 나타낼 수 있다. 즉, 상기 제1 실패는 상기 가상 메모리에 포함된 영역들 중 힙 영역(예: 도 2의 힙 영역(253)) 이외의 영역에 대한 저장 공간의 부족 시 발생될 수 있고, 상기 제2 실패는 상기 가상 메모리에 포함된 영역들 중 상기 힙 영역에 대한 저장 공간의 부족 시 발생될 수 있다.Referring to FIG. 3 , in operation 310 , the processor (eg, the processor 230 of FIG. 2 ) of the electronic device (eg, the electronic device 200 of FIG. 2 ) performs a virtual memory (eg, the virtual memory 250 of FIG. 2 ). )), it can be determined whether memory allocation has failed. The failure of memory allocation for the virtual memory is, for example, the first failure due to lack of storage space that occurs when a function (eg, mmap()) that performs a memory mapping function for a file is used, and the JVM heap area. may include a second failure due to a lack of storage space. The first failure and the second failure may occur in the form of a system event. The first failure is, for example, a failure value (eg, "MAP_FAILED") is returned as a result of calling the mmap() function, and an identification value for failure (eg "errno") is a value indicating insufficient storage space. It can represent a state containing (eg "ENOMEM(out of memory)"). Also, the second failure may indicate, for example, a state in which an event indicating insufficient storage space of the JVM heap area (eg, "JVM out of memory (OOM)") has occurred. For example, the second failure occurs when the application 211 is executed or when a java object cannot be allocated to the heap area due to insufficient storage space of the heap area during execution, an event (eg, "out of memory)”) can indicate the generated state. That is, the first failure may occur when a storage space for a region other than a heap region (eg, the heap region 253 in FIG. 2 ) among regions included in the virtual memory is insufficient, and the second failure It may be generated when a storage space for the heap area among areas included in the virtual memory is insufficient.

상기 가상 메모리에 대한 메모리 할당이 실패했다고 판단되면, 상기 프로세서는 동작 330에서, 상기 가상 메모리에 대한 메모리 할당의 실패를 나타내는 정보(이하, 프로파일이라 한다)를 설정할 수 있다. 또한, 상기 프로세서는 설정된 프로파일을 메모리(예: 도 2의 메모리(210))에 저장할 수 있다. 일 실시예에 따르면, 상기 프로파일이 상기 메모리에 저장되어 있지 않은 경우, 상기 프로세서는 상기 프로파일을 새로 생성할 수 있고, 상기 프로파일이 상기 메모리에 저장되어 있는 경우, 상기 프로세서는 상기 저장된 프로파일을 수정(또는 변경)할 수 있다. 일 실시예에 따르면, 상기 프로파일은 상기 메모리에 파일 형태로 저장될 수 있다.If it is determined that the memory allocation to the virtual memory has failed, in operation 330 , the processor may set information indicating the failure of the memory allocation to the virtual memory (hereinafter, referred to as a profile). Also, the processor may store the set profile in a memory (eg, the memory 210 of FIG. 2 ). According to an embodiment, when the profile is not stored in the memory, the processor may create a new profile, and if the profile is stored in the memory, the processor modifies ( or change). According to an embodiment, the profile may be stored in the memory in the form of a file.

일 실시예에 따르면, 상기 프로파일에 포함되는 정보 즉, 상기 프로파일에 기록되는 정보는 상기 가상 메모리에 포함된 힙 영역(예: 도 2의 힙 영역(253))의 크기에 대한 변경 여부에 관한 정보(예: 크기 유지, 크기 감소 및 크기 증가 중 하나를 나타내는 값), 상기 힙 영역의 크기 변경 값(예: 변경할 단계 값 또는 변경할 크기 값), 상기 힙 영역의 실제 사용량, 상기 제1 실패의 발생을 나타내는 신호의 개수, 및 상기 제2 실패의 발생 횟수 중 적어도 하나를 포함할 수 있다.According to an embodiment, the information included in the profile, that is, information recorded in the profile, is information on whether the size of a heap area included in the virtual memory (eg, the heap area 253 in FIG. 2 ) is changed. (eg, a value indicating one of maintaining size, decreasing size, and increasing size), the size change value of the heap area (eg, the step value to change or the size value to change), the actual usage of the heap area, the occurrence of the first failure It may include at least one of the number of signals indicating , and the number of occurrences of the second failure.

일 실시예에 따르면, 상기 프로세서는 상기 메모리 할당이 실패하면, 어플리케이션(예: 도 2의 어플리케이션(211))의 실행에 따른 상기 힙 영역의 실제 사용량을 상기 프로파일에 포함시킬 수 있다. 예컨대, 상기 프로세서는 상기 힙 영역의 실제 사용량을 상기 프로파일에 기록할 수 있다.According to an embodiment, when the memory allocation fails, the processor may include the actual usage of the heap area according to the execution of an application (eg, the application 211 of FIG. 2 ) in the profile. For example, the processor may record the actual usage of the heap area in the profile.

일 실시예에 따르면, 상기 프로세서는 상기 메모리 할당의 실패가 상기 가상 메모리에 포함된 영역들 중 상기 힙 영역 이외의 영역에 대한 저장 공간의 부족 시 발생되는 제1 실패인 경우, 상기 프로파일에 상기 힙 영역의 크기를 줄이기 위한 정보를 포함시킬 수 있다. 예를 들어, 상기 프로세서는 상기 프로파일에 상기 힙 영역의 크기를 적어도 한 단계 낮은 값으로 설정하도록 하는 정보를 기록할 수 있다. 이 경우, 상기 프로세서는 상기 프로파일에 포함된 상기 힙 영역의 크기에 대한 변경 여부에 관한 정보를 크기 감소를 나타내는 값으로 설정할 수 있다.According to an embodiment, when the failure of the memory allocation is a first failure that occurs when a storage space for a region other than the heap region among regions included in the virtual memory is insufficient, the processor adds the heap to the profile. Information for reducing the size of the region may be included. For example, the processor may record information for setting the size of the heap area to a value lower by at least one step in the profile. In this case, the processor may set information on whether to change the size of the heap area included in the profile as a value indicating a size reduction.

일 실시예에 따르면, 상기 프로세서는 상기 메모리 할당의 실패가 상기 가상 메모리에 포함된 영역들 중 상기 힙 영역에 대한 저장 공간의 부족 시 발생되는 제2 실패인 경우, 상기 프로파일에 상기 힙 영역의 크기를 늘리기 위한 정보를 포함시킬 수 있다. 예를 들어, 상기 프로세서는 상기 프로파일에 상기 힙 영역의 크기를 적어도 한 단계 높은 값으로 설정하도록 하는 정보를 기록할 수 있다. 이 경우, 상기 프로세서는 상기 프로파일에 포함된 상기 힙 영역의 크기에 대한 변경 여부에 관한 정보를 크기 증가를 나타내는 값으로 설정할 수 있다.According to an embodiment, when the failure of the memory allocation is a second failure that occurs when a storage space for the heap region among regions included in the virtual memory is insufficient, the processor includes the size of the heap region in the profile. You can include information to increase For example, the processor may record information for setting the size of the heap area to a value that is at least one step higher in the profile. In this case, the processor may set information on whether to change the size of the heap area included in the profile as a value indicating an increase in size.

일 실시예에 따르면, 상기 프로세서는 상기 제1 실패의 발생 시 상기 힙 영역의 실제 사용량에 기반하여 상기 프로파일에 포함된 상기 힙 영역의 크기 변경 값을 설정할 수 있다. 예를 들어, 상기 프로세서는 상기 힙 영역의 실제 사용량이 상기 제1 실패의 발생에 따른 상기 힙 영역의 크기를 감소하기 위한 단계 값보다 작으면, 상기 힙 영역의 크기를 상기 단계 값으로 설정할 수 있다. 이 경우, 상기 프로세서는 상기 프로파일에 포함된 상기 힙 영역의 크기에 대한 변경 여부에 관한 정보를 크기 감소를 나타내는 값으로 설정할 수 있다.According to an embodiment, when the first failure occurs, the processor may set a size change value of the heap area included in the profile based on the actual usage of the heap area. For example, the processor may set the size of the heap area to the step value when the actual usage of the heap area is smaller than the step value for reducing the size of the heap area according to the occurrence of the first failure . In this case, the processor may set information on whether to change the size of the heap area included in the profile as a value indicating a size reduction.

일 실시예에 따르면, 상기 프로세서는 상기 힙 영역의 크기가 동일한 상태에서, 상기 제1 실패의 발생 이력과 상기 제2 실패의 발생 이력이 모두 존재하는 경우, 상기 프로파일에 포함된 상기 힙 영역의 크기 변경 값을 제로(zero)로 설정하거나 삭제할 수 있다. 예컨대, 상기 프로세서는 상기 힙 영역의 크기가 동일한 상태에서, 상기 제1 실패 및 상기 제2 실패가 모두 발생한 경우, 상기 프로파일에 포함된 상기 힙 영역의 크기에 대한 변경 여부에 관한 정보를 크기 유지를 나타내는 값으로 설정할 수 있다.According to an embodiment, when both the first failure occurrence history and the second failure occurrence history exist in a state in which the size of the heap region is the same, the processor determines the size of the heap region included in the profile The change value can be set to zero or deleted. For example, when both the first failure and the second failure occur in a state in which the size of the heap area is the same, the processor maintains the size of information on whether the size of the heap area included in the profile is changed. It can be set to the indicated value.

일 실시예에 따르면, 상기 프로세서는 상기 힙 영역의 크기가 동일하지 않은 상태에서, 상기 제1 실패의 발생 이력과 상기 제2 실패의 발생 이력이 모두 존재하는 경우, 상기 힙 영역의 실제 사용량에 기반하여 상기 힙 영역의 크기에 대한 변경 여부에 관한 정보를 설정할 수 있다. 예를 들어, 상기 프로세서는 상기 제1 실패가 발생된 시점의 상기 힙 영역의 크기와 상기 제2 실패가 발생된 시점의 상기 힙 영역의 크기 사이에 설정 가능한 크기가 존재하는 경우, 상기 힙 영역의 실제 사용량이 상기 설정 가능한 크기보다 작은지를 판단하고, 상기 힙 영역의 실제 사용량이 상기 설정 가능한 크기보다 작은 경우, 상기 힙 영역의 크기를 상기 설정 가능한 크기로 설정할 수 있다. 이 경우, 상기 프로세서는 상기 프로파일에 포함된 상기 힙 영역의 크기에 대한 변경 여부에 관한 정보를 크기 증가를 나타내는 값으로 설정할 수 있다. 다른 예를 들어, 상기 프로세서는 상기 제1 실패가 발생된 시점의 상기 힙 영역의 크기와 상기 제2 실패가 발생된 시점의 상기 힙 영역의 크기 사이에 설정 가능한 크기가 존재하지 않는 경우, 상기 힙 영역의 실제 사용량을 고려하여, 상기 힙 영역의 크기를 기존의 힙 영역의 크기보다 큰 값으로 설정할 수 있다. 이 경우도, 상기 프로세서는 상기 프로파일에 포함된 상기 힙 영역의 크기에 대한 변경 여부에 관한 정보를 크기 증가를 나타내는 값으로 설정할 수 있다.According to an embodiment, when both the first failure occurrence history and the second failure occurrence history exist in a state in which the size of the heap region is not the same, the processor is based on the actual usage of the heap region Accordingly, information regarding whether to change the size of the heap area can be set. For example, when a settable size exists between the size of the heap area at the time when the first failure occurs and the size of the heap area at the time when the second failure occurs, the processor It is determined whether the actual usage amount is smaller than the settable size, and when the actual usage amount of the heap area is smaller than the settable size, the size of the heap area may be set to the settable size. In this case, the processor may set information on whether to change the size of the heap area included in the profile as a value indicating an increase in size. For another example, if there is no settable size between the size of the heap area at the time when the first failure occurs and the size of the heap area at the time when the second failure occurs, the processor In consideration of the actual usage of the area, the size of the heap area may be set to a value larger than the size of the existing heap area. Also in this case, the processor may set the information on whether the size of the heap area included in the profile is changed as a value indicating an increase in size.

일 실시예에 따르면, 상기 프로세서는 상기 제1 실패의 발생 시, 상기 어플리케이션의 실행과 관련된 프로세스로 상기 제1 실패의 발생을 나타내는 신호를 전송할 수 있고, 상기 신호를 전송한 후, 지정된 횟수의 동일한 종류의 다른 제1 실패들이 발생되면, 상기 다른 제1 실패들의 발생을 나타내는 신호들이 상기 프로세스로 전송되지 않도록 제어할 수 있다. 또한, 상기 프로세서는 상기 지정된 횟수의 다른 제1 실패들이 발생된 후, 또 다른 제1 실패가 발생되면, 새롭게 발생된 상기 또 다른 제1 실패의 발생을 나타내는 신호를 상기 프로세스로 전송할 수 있다. 이때, 상기 프로세서는 상기 프로세스로 전송된 상기 제1 실패의 발생을 나타내는 신호의 개수에 대한 정보를 상기 프로파일에 포함시킬 수 있다. 예컨대, 상기 프로세서는 상기 제1 실패의 발생을 나타내는 신호의 개수를 상기 프로파일에 기록할 수 있다. 또한, 상기 프로세서는 상기 프로파일에 포함된 상기 제1 실패의 발생을 나타내는 신호의 개수가 지정된 값을 초과하면, 상기 프로파일에 포함된 상기 힙 영역의 크기에 대한 변경 여부에 관한 정보를 크기 감소를 나타내는 값으로 설정할 수 있다.According to an embodiment, when the first failure occurs, the processor may transmit a signal indicating the occurrence of the first failure to a process related to the execution of the application, and after transmitting the signal, the same number of times When other first failures of a different kind occur, it is possible to control so that signals indicating occurrence of the other first failures are not transmitted to the process. In addition, when another first failure occurs after the other first failures of the specified number of times, the processor may transmit a signal indicating the occurrence of the new first failure to the process. In this case, the processor may include information on the number of signals indicating the occurrence of the first failure transmitted to the process in the profile. For example, the processor may record the number of signals indicating the occurrence of the first failure in the profile. In addition, when the number of signals indicating occurrence of the first failure included in the profile exceeds a specified value, the processor displays information on whether or not to change the size of the heap region included in the profile to indicate size reduction It can be set as a value.

일 실시예에 따르면, 상기 프로세서는 상기 제2 실패의 발생 시, 상기 프로파일에 포함된 상기 제2 실패의 발생 횟수를 기록할 수 있다. 예컨대, 상기 프로세서는 상기 제2 실패가 발생되는 경우, 상기 프로파일에 포함된 상기 제2 실패의 발생 횟수를 증가시킬 수 있다.According to an embodiment, when the second failure occurs, the processor may record the number of occurrences of the second failure included in the profile. For example, when the second failure occurs, the processor may increase the number of occurrences of the second failure included in the profile.

도 4는 본 발명의 일 실시예에 따른 가상 메모리의 할당 방법을 설명하기 위한 도면이다.4 is a diagram for explaining a virtual memory allocation method according to an embodiment of the present invention.

도 4를 참조하면, 전자 장치(예: 도 2의 전자 장치(200))의 프로세서(예: 도 2의 프로세서(230))는 동작 410에서, 가상 메모리(예: 도 2의 가상 메모리(250))에 대한 메모리 할당의 실패를 나타내는 정보(이하, 프로파일이라 한다)가 존재하는지를 판단할 수 있다. 예를 들어, 상기 프로세서는 메모리(예: 도 2의 메모리(210))에 저장된 어플리케이션(예: 도 2의 어플리케이션(211))의 실행 시, 상기 메모리에 저장된 프로파일이 존재하는지를 판단할 수 있다.Referring to FIG. 4 , in operation 410 , the processor (eg, the processor 230 of FIG. 2 ) of the electronic device (eg, the electronic device 200 of FIG. 2 ) performs a virtual memory (eg, the virtual memory 250 of FIG. 2 ). )), it can be determined whether information indicating the failure of memory allocation (hereinafter referred to as a profile) exists. For example, when an application (eg, the application 211 of FIG. 2 ) stored in a memory (eg, the memory 210 of FIG. 2 ) is executed, the processor may determine whether a profile stored in the memory exists.

상기 프로파일이 존재하지 않는다고 판단된 경우, 상기 프로세서는 동작 430에서, 상기 어플리케이션의 설정 파일(예: 상기 어플리케이션의 패키지에 포함된 "AndroidManifest.xml" 파일)에 기반하여 힙 영역(예: 도 2의 힙 영역(253))의 크기를 결정할 수 있다. 예를 들어, 상기 프로세서는 상기 어플리케이션의 설정 파일에 기재된 힙 영역의 크기 속성(예: "largeHeap"으로 정의되는 속성)의 설정 값(예: "true" 또는 "false"(default 값))에 따라 상기 어플리케이션에 대응되는 가상 메모리의 힙 영역의 크기를 결정할 수 있다. 일 예로, 상기 힙 영역의 크기 속성의 설정 값이 "true"로 설정된 경우, 상기 프로세서는 상기 힙 영역 중 JVM 힙 영역을 최대로 사용 가능한 크기(예: 1GB)로 할당할 수 있다.If it is determined that the profile does not exist, in operation 430, the processor performs a heap area (eg, in FIG. 2 ) based on a setting file of the application (eg, an “AndroidManifest.xml” file included in the package of the application). The size of the heap area 253) may be determined. For example, according to the set value (eg, "true" or "false" (default value)) of the size attribute of the heap area (eg, the attribute defined as "largeHeap") described in the configuration file of the application, the processor The size of the heap area of the virtual memory corresponding to the application may be determined. For example, when the set value of the size attribute of the heap area is set to "true", the processor may allocate the JVM heap area among the heap areas to a maximum usable size (eg, 1 GB).

상기 프로파일이 존재한다고 판단된 경우, 상기 프로세서는 동작 450에서, 상기 프로파일에 기반하여 상기 힙 영역의 크기를 결정할 수 있다. 일 실시예에 따르면, 상기 프로세서는 상기 프로파일에 포함된 상기 힙 영역의 실제 사용량에 기반하여 상기 힙 영역의 크기를 결정할 수 있다. 예를 들어, 상기 프로세서는 상기 힙 영역의 실제 사용량보다 지정된 크기 이상으로 큰 값으로 상기 힙 영역의 크기를 결정할 수 있다. 일 실시예에 따르면, 상기 프로세서는 상기 프로파일에 포함된 상기 힙 영역의 크기 변경 값에 기반하여 상기 힙 영역의 크기를 결정할 수 있다. 예를 들어, 상기 프로세서는 상기 힙 영역의 크기 변경 값으로 상기 힙 영역의 크기를 결정할 수 있다. 여기서, 상기 힙 영역의 크기 변경 값은 상기 힙 영역의 실제 사용량보다 지정된 크기 이상으로 큰 값으로 설정된 값, 또는 상기 힙 영역의 크기를 지정된 개수로 구분한 크기 범위들을 나타내는 단계 값들(예: 제1 단계 값, 제2 단계 값, 또는 제3 단계 값) 중 하나의 단계 값을 포함할 수 있다.If it is determined that the profile exists, the processor may determine the size of the heap area based on the profile in operation 450 . According to an embodiment, the processor may determine the size of the heap area based on the actual usage of the heap area included in the profile. For example, the processor may determine the size of the heap area as a value larger than a specified size or more than the actual usage of the heap area. According to an embodiment, the processor may determine the size of the heap region based on a size change value of the heap region included in the profile. For example, the processor may determine the size of the heap area using the size change value of the heap area. Here, the size change value of the heap area is a value set to a value larger than a specified size or more than the actual usage of the heap area, or step values representing size ranges in which the size of the heap area is divided by a specified number (eg, first a step value, a second step value, or a third step value).

일 실시예에 따르면, 상기 프로세서는 상기 프로파일에 포함된 상기 힙 영역의 크기에 대한 변경 여부에 관한 정보가 크기 유지를 나타내는 값으로 설정된 경우, 상기 힙 영역의 크기를 유지시킬 수 있다. 다른 실시예에 따르면, 상기 프로세서는 상기 프로파일에 포함된 상기 힙 영역의 크기에 대한 변경 여부에 관한 정보가 크기 감소를 나타내는 값으로 설정된 경우, 상기 프로파일에 포함된 상기 힙 영역의 크기 변경 값으로 상기 힙 영역의 크기를 감소시킬 수 있다. 또 다른 실시예에 따르면, 상기 프로세서는 상기 프로파일에 포함된 상기 힙 영역의 크기에 대한 변경 여부에 관한 정보가 크기 증가를 나타내는 값으로 설정된 경우, 상기 프로파일에 포함된 상기 힙 영역의 크기 변경 값으로 상기 힙 영역의 크기를 증가시킬 수 있다.According to an embodiment, the processor may maintain the size of the heap region when the information on whether the size of the heap region included in the profile is set to a value indicating size maintenance. According to another embodiment, when the information on whether the size of the heap area included in the profile is changed is set to a value indicating a size reduction, the processor is configured to use the size change value of the heap area included in the profile. The size of the heap area can be reduced. According to another embodiment, when the information on whether the size of the heap area included in the profile is changed is set to a value indicating an increase in size, the processor is configured to change the size of the heap area included in the profile. The size of the heap area may be increased.

상기 힙 영역의 크기가 결정되면, 상기 프로세서는 동작 470에서, 상기 결정된 크기의 힙 영역을 포함하는 상기 가상 메모리를 설정(또는 할당)할 수 있다.When the size of the heap area is determined, the processor may set (or allocate) the virtual memory including the heap area of the determined size in operation 470 .

도 5는 본 발명의 일 실시예에 따른 가상 메모리에 대한 메모리 할당의 실패와 관련된 정보를 설정하는 방법을 설명하기 위한 도면이다.5 is a diagram for explaining a method of setting information related to a failure in memory allocation to a virtual memory according to an embodiment of the present invention.

도 5를 참조하면, 전자 장치(예: 도 2의 전자 장치(200))의 프로세서(예: 도 2의 프로세서(230))는 가상 메모리(예: 도 2의 가상 메모리(250))에 대한 메모리 할당의 실패의 종류에 따라 상기 가상 메모리에 포함된 힙 영역(예: 도 2의 힙 영역(253))의 크기를 증가 또는 감소시킬 수 있다. 상기 가상 메모리에 대한 메모리 할당의 실패는 예를 들어, 파일에 대한 메모리 매핑 기능을 수행하는 함수의 사용 시 발생되는 저장 공간의 부족에 따른 제1 실패, 및 JVM 힙 영역의 저장 공간의 부족에 따른 제2 실패를 포함할 수 있다. 상기 제1 실패는 상기 가상 메모리에 포함된 영역들 중 상기 힙 영역 이외의 영역에 대한 저장 공간의 부족 시 발생될 수 있고, 상기 제2 실패는 상기 가상 메모리에 포함된 영역들 중 상기 힙 영역에 대한 저장 공간의 부족 시 발생될 수 있다.Referring to FIG. 5 , the processor (eg, the processor 230 of FIG. 2 ) of the electronic device (eg, the electronic device 200 of FIG. 2 ) corresponds to a virtual memory (eg, the virtual memory 250 of FIG. 2 ). According to the type of memory allocation failure, the size of the heap area included in the virtual memory (eg, the heap area 253 of FIG. 2 ) may be increased or decreased. The failure of memory allocation for the virtual memory is, for example, a first failure due to a lack of storage space that occurs when a function performing a memory mapping function for a file is used, and a first failure due to a lack of storage space in the JVM heap area. A second failure may be included. The first failure may occur when a storage space for a region other than the heap region among regions included in the virtual memory is insufficient, and the second failure may occur in the heap region among regions included in the virtual memory. It may occur when there is insufficient storage space for storage.

상기 프로세서는 동작 510에서, 상기 메모리 할당의 실패가 상기 힙 영역에 대한 저장 공간의 부족에 따른 실패(상기 제2 실패)인지를 판단할 수 있다.In operation 510 , the processor may determine whether the failure of the memory allocation is a failure (the second failure) due to insufficient storage space for the heap area.

상기 메모리 할당의 실패가 상기 힙 영역에 대한 저장 공간의 부족에 따른 실패가 아니라고 판단된 경우 즉, 상기 메모리 할당의 실패가 상기 힙 영역 이외의 영역에 대한 저장 공간의 부족에 따른 실패(상기 제1 실패)인 경우, 상기 프로세서는 동작 530에서, 상기 힙 영역의 크기 감소를 위한 정보를 포함하도록 상기 가상 메모리에 대한 메모리 할당의 실패를 나타내는 정보(이하, 프로파일이라 한다)를 설정할 수 있다. 예를 들어, 상기 프로세서는 상기 프로파일에 포함된 상기 힙 영역의 크기에 대한 변경 여부에 관한 정보를 크기 감소를 나타내는 값으로 설정할 수 있다. 또한, 상기 프로세서는 상기 프로파일에 포함된 상기 힙 영역의 크기 변경 값을 상기 힙 영역의 현재 크기보다 작은 값으로 설정하거나, 상기 힙 영역의 현재 크기로 설정된 단계 값보다 적어도 한 단계 낮은 단계 값으로 설정할 수 있다.When it is determined that the failure of the memory allocation is not a failure due to a lack of storage space for the heap region, that is, the failure of the memory allocation is a failure due to a lack of storage space for a region other than the heap region (the first failure), in operation 530 , the processor may set information indicating failure of memory allocation to the virtual memory (hereinafter, referred to as a profile) to include information for reducing the size of the heap region. For example, the processor may set information on whether to change the size of the heap area included in the profile as a value indicating a size reduction. In addition, the processor sets the size change value of the heap area included in the profile to a value smaller than the current size of the heap area, or sets the value at least one step lower than the step value set as the current size of the heap area. can

상기 메모리 할당의 실패가 상기 힙 영역에 대한 저장 공간의 부족에 따른 실패라고 판단된 경우 즉, 상기 메모리 할당의 실패가 상기 힙 영역에 대한 저장 공간의 부족에 따른 실패(상기 제2 실패)인 경우, 상기 프로세서는 동작 550에서, 상기 힙 영역의 크기 증가를 위한 정보를 포함하도록 상기 프로파일을 설정할 수 있다. 예를 들어, 상기 프로세서는 상기 프로파일에 포함된 상기 힙 영역의 크기에 대한 변경 여부에 관한 정보를 크기 증가를 나타내는 값으로 설정할 수 있다. 또한, 상기 프로세서는 상기 프로파일에 포함된 상기 힙 영역의 크기 변경 값을 상기 힙 영역의 현재 크기보다 큰 값으로 설정하거나, 상기 힙 영역의 현재 크기로 설정된 단계 값보다 적어도 한 단계 높은 단계 값으로 설정할 수 있다.When it is determined that the failure of the memory allocation is a failure due to a lack of storage space for the heap area, that is, when the failure of the memory allocation is a failure (the second failure) due to a lack of storage space for the heap area , the processor may set the profile to include information for increasing the size of the heap area in operation 550 . For example, the processor may set information on whether to change the size of the heap area included in the profile as a value indicating an increase in size. In addition, the processor sets the size change value of the heap area included in the profile to a value larger than the current size of the heap area, or sets a step value at least one step higher than the step value set as the current size of the heap area. can

상술한 동작 510에서, 상기 프로세서가 상기 메모리 할당의 실패가 상기 힙 영역에 대한 저장 공간의 부족에 따른 실패(상기 제2 실패)인지를 판단하는 것으로 설명하였지만, 이에 한정되는 것은 아니다. 어떤 실시예에서, 상기 프로세서는 동작 510에서, 상기 메모리 할당의 실패가 상기 힙 영역 이외의 영역에 대한 저장 공간의 부족에 따른 실패(상기 제1 실패)인지를 판단할 수 있다. 이 경우에도 마찬가지로, 상기 프로세서는 상기 메모리 할당의 실패가 상기 힙 영역 이외의 영역에 대한 저장 공간의 부족에 따른 실패라고 판단되면 동작 530을 수행할 수 있고, 상기 메모리 할당의 실패가 상기 힙 영역 이외의 영역에 대한 저장 공간의 부족에 따른 실패가 아니라고 판단되면 동작 550을 수행할 수 있다.In the above-described operation 510, the processor determines whether the failure of the memory allocation is a failure (the second failure) due to insufficient storage space for the heap area, but is not limited thereto. In some embodiments, in operation 510 , the processor may determine whether the failure of the memory allocation is a failure (the first failure) due to insufficient storage space for a region other than the heap region. Likewise in this case, the processor may perform operation 530 if it is determined that the failure of memory allocation is a failure due to insufficient storage space for a region other than the heap region, and the memory allocation failure occurs other than the heap region. If it is determined that the failure is not due to insufficient storage space for the area of , operation 550 may be performed.

상기 힙 영역의 크기 감소 또는 증가를 위한 정보를 포함하도록 상기 프로파일이 설정되면, 상기 프로세서는 동작 570에서, 상기 설정된 프로파일을 저장할 수 있다. 예를 들어, 상기 프로세서는 메모리(예: 도 2의 메모리(210))에 상기 프로파일을 저장할 수 있다. 일 실시예에 따르면, 상기 프로세서는 상기 프로파일을 상기 메모리에 파일 형태로 저장할 수 있다.If the profile is set to include information for reducing or increasing the size of the heap area, the processor may store the set profile in operation 570 . For example, the processor may store the profile in a memory (eg, the memory 210 of FIG. 2 ). According to an embodiment, the processor may store the profile in the memory in the form of a file.

도 6은 본 발명의 일 실시예에 따른 가상 메모리의 할당과 관련된 처리 동작을 설명하기 위한 도면이다.6 is a diagram for explaining a processing operation related to virtual memory allocation according to an embodiment of the present invention.

도 6을 참조하면, 전자 장치(예: 도 2의 전자 장치(200))는 어플리케이션(610)(예: 도 2의 어플리케이션(211)), 가상 머신(630), 및 힙 영역 설정 모듈(650)을 포함할 수 있다. 상기 가상 머신(630)(예: 자바 가상 머신(java virtual machine(JVM)))은 상기 전자 장치의 프로세서(예: 도 2의 프로세서(230))에 의해 실행되는 프로그램으로서, 운영 체제나 응용 프로그램(예: 어플리케이션(610))의 설치 및 실행 환경을 제공할 수 있다. 상기 가상 머신(630)은 상기 어플리케이션(610)에 대응되는 가상 메모리(예: 도 2의 가상 메모리(250))를 할당하는 가상 메모리 설정 모듈(631), 상기 가상 메모리에 대한 메모리 할당의 실패를 감지하는 메모리 할당 실패 감지 모듈(633), 상기 메모리 할당의 실패의 발생을 나타내는 신호를 처리하는 신호 처리 모듈(635), 및 상기 가상 메모리에 대한 메모리 할당의 실패를 나타내는 정보(이하, 프로파일(651)이라 한다)를 설정하는 프로파일 설정 모듈(637)을 포함할 수 있다. 상기 힙 영역 설정 모듈(650)은 상기 어플리케이션(610)에 대응되는 가상 메모리의 힙 영역(예: 도 2의 힙 영역(253))의 크기를 결정할 수 있다.Referring to FIG. 6 , the electronic device (eg, the electronic device 200 of FIG. 2 ) includes an application 610 (eg, the application 211 of FIG. 2 ), a virtual machine 630 , and a heap area setting module 650 . ) may be included. The virtual machine 630 (eg, a java virtual machine (JVM)) is a program executed by a processor (eg, the processor 230 of FIG. 2 ) of the electronic device, and is an operating system or an application program. An installation and execution environment of (eg, the application 610 ) may be provided. The virtual machine 630 detects the failure of the virtual memory setting module 631 for allocating the virtual memory (eg, the virtual memory 250 of FIG. 2 ) corresponding to the application 610 , the memory allocation for the virtual memory. A memory allocation failure detection module 633 for detecting, a signal processing module 635 for processing a signal indicating occurrence of the memory allocation failure, and information indicating a failure of memory allocation for the virtual memory (hereinafter, a profile 651 ) ) may include a profile setting module 637 for setting. The heap area setting module 650 may determine the size of a heap area (eg, the heap area 253 of FIG. 2 ) of the virtual memory corresponding to the application 610 .

상기 어플리케이션(610)에 대한 실행 요청이 발생하면, 상기 가상 머신(630)은 동작 671에서, 상기 어플리케이션(610)을 실행시킬 수 있다. 상기 어플리케이션(610)의 실행 과정에서, 상기 가상 머신(630)의 가상 메모리 설정 모듈(631)은 동작 672에서, 상기 어플리케이션(610)에 대응되는 가상 메모리를 할당할 수 있다. 일 실시예에 따르면, 상기 가상 메모리 설정 모듈(631)은 상기 어플리케이션(610)의 설정 파일(611)(예: 상기 어플리케이션(610)의 패키지에 포함된 "AndroidManifest.xml" 파일)에 기반하여 상기 가상 메모리의 힙 영역의 크기를 결정할 수 있다. 예를 들어, 상기 가상 메모리 설정 모듈(631)은 상기 설정 파일(611)에 기재된 힙 영역의 크기 속성(예: "largeHeap"으로 정의되는 속성)의 설정 값(예: "true" 또는 "false"(default 값))에 따라 상기 가상 메모리의 힙 영역의 크기를 결정할 수 있다.When an execution request for the application 610 occurs, the virtual machine 630 may execute the application 610 in operation 671 . During the execution of the application 610 , the virtual memory setting module 631 of the virtual machine 630 may allocate a virtual memory corresponding to the application 610 in operation 672 . According to an embodiment, the virtual memory setting module 631 is configured to be configured based on the setting file 611 of the application 610 (eg, "AndroidManifest.xml" file included in the package of the application 610). You can determine the size of the heap area of virtual memory. For example, the virtual memory setting module 631 may set a value (eg, "true" or "false") of a size attribute (eg, a attribute defined as "largeHeap") of the heap area described in the setting file 611 . (default value)), the size of the heap area of the virtual memory may be determined.

상기 어플리케이션(610)의 실행 중, 상기 가상 메모리에 포함된 영역들 중 상기 힙 영역 이외의 영역에 대한 저장 공간의 부족에 따른 실패(제1 실패)가 발생하면, 상기 가상 머신(630)의 메모리 할당 실패 감지 모듈(633)은 동작 673에서, 상기 실패를 감지할 수 있다. 상기 실패를 감지한다는 것은 상기 저장 공간의 부족의 따른 메모리 할당의 실패 시 발생되는 시스템 이벤트를 감지하는 것을 의미할 수 있다. 또한, 상기 메모리 할당 실패 감지 모듈(633)은 동작 674에서, 상기 저장 공간 부족에 따른 메모리 할당의 실패 신호(제1 실패의 발생을 나타내는 신호)를 상기 가상 머신(630)의 신호 처리 모듈(635)로 전송할 수 있다. 일 실시예에 따르면, 상기 메모리 할당 실패 감지 모듈(633)은 상기 실패 신호의 전송 후, 지정된 횟수(예: 50회)의 동일한 종류의 다른 실패(제1 실패)들이 감지되면, 상기 다른 실패들의 발생을 나타내는 실패 신호들을 상기 신호 처리 모듈(635)로 전송하지 않을 수 있다. 또한, 상기 메모리 할당 실패 감지 모듈(633)은 상기 지정된 횟수의 동일한 종류의 다른 실패들을 감지한 후, 또 다른 동일한 종류의 실패(제1 실패)를 감지하면, 새롭게 감지된 실패의 발생을 나타내는 실패 신호를 상기 신호 처리 모듈(635)로 전송할 수 있다. 상기 실패 신호를 수신한 상기 신호 처리 모듈(635)은 동작 674-1에서, 상기 프로파일 설정 모듈(637)을 실행시킬 수 있다.When a failure (first failure) occurs due to insufficient storage space for a region other than the heap region among regions included in the virtual memory while the application 610 is running, the memory of the virtual machine 630 is The allocation failure detection module 633 may detect the failure in operation 673 . Detecting the failure may mean detecting a system event that occurs when memory allocation fails due to insufficient storage space. In addition, in operation 674 , the memory allocation failure detection module 633 transmits a memory allocation failure signal (a signal indicating occurrence of a first failure) according to the insufficient storage space to the signal processing module 635 of the virtual machine 630 . ) can be transmitted. According to an embodiment, the memory allocation failure detection module 633 is configured to detect other failures (first failures) of the same type a specified number of times (eg, 50 times) after the transmission of the failure signal. Failure signals indicating occurrence may not be transmitted to the signal processing module 635 . In addition, when the memory allocation failure detection module 633 detects another failure of the same type (first failure) after detecting other failures of the same type for the specified number of times, a failure indicating occurrence of a newly detected failure A signal may be transmitted to the signal processing module 635 . Upon receiving the failure signal, the signal processing module 635 may execute the profile setting module 637 in operation 674-1.

상기 프로파일 설정 모듈(637)이 실행되면, 상기 프로파일 설정 모듈(637)은 동작 675에서, 상기 어플리케이션(610)에 대응되는 상기 프로파일(651)을 설정할 수 있다. 상기 프로파일(651)이 저장되어 있지 않은 경우, 상기 프로파일 설정 모듈(637)은 상기 프로파일(651)을 새로 생성할 수 있고, 상기 프로파일(651)이 저장되어 있는 경우, 상기 프로파일 설정 모듈(637)은 상기 저장된 프로파일(651)을 수정(또는 변경)할 수 있다. 상기 프로파일 설정 모듈(637)은 상기 실패 신호의 수신에 응답하여 상기 프로파일(651)에 상기 실패 신호의 수신 개수(또는 횟수)(상기 제1 실패의 발생을 나타내는 실패 신호의 개수)를 기록할 수 있다.When the profile setting module 637 is executed, the profile setting module 637 may set the profile 651 corresponding to the application 610 in operation 675 . If the profile 651 is not stored, the profile setting module 637 may newly create the profile 651, and if the profile 651 is stored, the profile setting module 637 may modify (or change) the stored profile 651 . The profile setting module 637 may record the number (or number of times) of the reception of the failure signal (the number of failure signals indicating the occurrence of the first failure) in the profile 651 in response to the reception of the failure signal. have.

상기 실패 신호의 수신 개수가 지정된 값(예: 3회)을 초과하는 경우, 상기 프로파일 설정 모듈(637)은 동작 675-1에서, 상기 프로파일(651)을 설정할 수 있다. 일 예로, 상기 프로파일 설정 모듈(637)은 상기 프로파일(651)에 포함된 상기 힙 영역의 크기에 대한 변경 여부에 관한 정보를 크기 감소를 나타내는 값으로 설정할 수 있다.When the number of receptions of the failure signal exceeds a specified value (eg, three times), the profile setting module 637 may set the profile 651 in operation 675 - 1 . For example, the profile setting module 637 may set information on whether to change the size of the heap area included in the profile 651 to a value indicating a size reduction.

상기 프로파일 설정 모듈(637)은 상기 가상 메모리에 포함된 영역들 중 상기 힙 영역에 대한 저장 공간의 부족에 따른 실패(제2 실패)가 발생하면, 동작 675-2에서, 상기 프로파일(651)에 상기 힙 영역에 대한 저장 공간의 부족에 따른 실패의 발생 횟수를 기록할 수 있다. 또한, 상기 프로파일 설정 모듈(637)은 상기 프로파일(651)에 포함된 상기 힙 영역의 크기에 대한 변경 여부에 관한 정보를 크기 증가를 나타내는 값으로 설정할 수 있다. 또한, 상기 프로파일 설정 모듈(637)은 상기 프로파일(651)에 상기 힙 영역의 실제 사용량을 기록할 수 있다.When a failure (second failure) occurs due to a lack of storage space for the heap area among the areas included in the virtual memory, the profile setting module 637 generates the profile 651 in operation 675-2. The number of occurrences of failures due to insufficient storage space for the heap area may be recorded. Also, the profile setting module 637 may set information on whether to change the size of the heap area included in the profile 651 as a value indicating an increase in size. Also, the profile setting module 637 may record the actual usage of the heap area in the profile 651 .

일 실시예에 따르면, 상기 실패 신호의 수신 개수가 상기 지정된 값을 초과하는 경우, 상기 프로파일 설정 모듈(637)은 상기 힙 영역에 대한 저장 공간의 부족에 따른 실패의 발생 횟수를 확인할 수 있다. 상기 힙 영역에 대한 저장 공간의 부족에 따른 실패의 발생 횟수를 고려하여, 상기 프로파일 설정 모듈(637)은 상기 힙 영역의 크기에 대한 변경 여부를 결정할 수 있다. 상기 힙 영역의 크기에 대한 변경이 결정되면, 상기 프로파일 설정 모듈(637)은 상기 프로파일(651)에 상기 힙 영역의 크기에 대한 변경 여부에 관한 정보를 설정할 수 있다. 또한, 상기 프로파일 설정 모듈(637)은 상기 프로파일(651)에 상기 힙 영역의 크기 변경 값을 설정할 수 있다.According to an embodiment, when the number of reception of the failure signal exceeds the specified value, the profile setting module 637 may check the number of occurrences of failure due to insufficient storage space for the heap area. In consideration of the number of occurrences of failures due to insufficient storage space for the heap area, the profile setting module 637 may determine whether to change the size of the heap area. When it is determined to change the size of the heap region, the profile setting module 637 may set information on whether to change the size of the heap region in the profile 651 . Also, the profile setting module 637 may set a size change value of the heap area in the profile 651 .

상기 어플리케이션(610)에 대한 재실행 요청이 발생하면, 상기 가상 머신(630)은 동작 676에서, 상기 어플리케이션(610)을 재실행시킬 수 있다. 상기 어플리케이션(610)의 재실행 과정에서, 상기 가상 메모리 설정 모듈(631)은 상기 어플리케이션(610)에 대응되는 가상 메모리를 할당하게 되는데, 이때 상기 프로파일(651)이 존재하는 경우(상기 프로파일(651)이 저장된 경우), 상기 힙 영역 설정 모듈(650)은 동작 677에서, 상기 프로파일(651)에 기반하여 상기 가상 메모리의 힙 영역의 크기를 결정할 수 있다. 예를 들어, 상기 힙 영역 설정 모듈(650)은 상기 프로파일(651)에 기록된 상기 힙 영역의 크기 변경 값에 기반하여 상기 힙 영역의 크기를 설정(또는 변경)할 수 있다. 예를 들어, 상기 어플리케이션(610)의 설정 파일(611)에 기재된 힙 영역의 크기 속성의 설정 값은 무시될 수 있다. 일 실시예에 따르면, 상기 프로파일(651)에 기반하여 상기 가상 메모리의 힙 영역의 크기가 결정되고 나면, 상기 힙 영역 설정 모듈(650)은 상기 프로파일(651)에 기록된 정보를 리셋할 수 있다. 어떤 실시예에서, 상기 힙 영역 설정 모듈(650)은 상기 프로파일(651)에 기록된 상기 힙 영역의 크기 변경 값을 제외한 나머지 정보를 리셋할 수 있다.When a re-execution request for the application 610 occurs, the virtual machine 630 may re-execute the application 610 in operation 676 . In the process of re-executing the application 610, the virtual memory setting module 631 allocates a virtual memory corresponding to the application 610. At this time, if the profile 651 exists (the profile 651) is stored), the heap area setting module 650 may determine the size of the heap area of the virtual memory based on the profile 651 in operation 677 . For example, the heap area setting module 650 may set (or change) the size of the heap area based on a size change value of the heap area recorded in the profile 651 . For example, the setting value of the size attribute of the heap area described in the setting file 611 of the application 610 may be ignored. According to an embodiment, after the size of the heap area of the virtual memory is determined based on the profile 651 , the heap area setting module 650 may reset information recorded in the profile 651 . . In some embodiments, the heap area setting module 650 may reset information other than the size change value of the heap area recorded in the profile 651 .

다양한 실시예에 따르면, 본 문서에 개시된 다양한 실시예들은 자바 가상 머신(java virtual machine) 뿐만 아니라, CLR(common language runtime)과 같은 Windows 운영체제에서 구현되는 가상 머신에도 적용될 수 있다.According to various embodiments, the various embodiments disclosed in this document may be applied not only to a Java virtual machine, but also to a virtual machine implemented in a Windows operating system such as a common language runtime (CLR).

상술한 바와 같이, 다양한 실시예에 따르면, 전자 장치(예: 도 2의 전자 장치(200))의 가상 메모리의 할당 방법은, 상기 전자 장치의 메모리(예: 도 2의 메모리(210))에 저장된 어플리케이션(예: 도 2의 어플리케이션(211))의 실행 중 상기 어플리케이션에 대응되는 가상 메모리(예: 도 2의 가상 메모리(250))에 대한 메모리 할당이 실패하면, 상기 메모리 할당의 실패를 나타내는 정보를 설정하는 동작(예: 도 3의 동작 330), 상기 어플리케이션의 재실행 시, 상기 설정된 정보가 존재하면, 상기 설정된 정보에 기반하여 상기 가상 메모리에 포함된 힙 영역(예: 도 2의 힙 영역(253))의 크기를 결정하는 동작(예: 도 4의 동작 450), 및 상기 결정된 크기의 힙 영역을 포함하는 상기 가상 메모리를 할당하는 동작(예: 도 4의 동작 470)을 포함할 수 있다.As described above, according to various embodiments, the virtual memory allocation method of the electronic device (eg, the electronic device 200 of FIG. 2 ) is stored in the memory of the electronic device (eg, the memory 210 of FIG. 2 ). If memory allocation for a virtual memory corresponding to the application (eg, the virtual memory 250 of FIG. 2 ) fails during execution of a stored application (eg, the application 211 of FIG. 2 ), it indicates the failure of the memory allocation. In an operation of setting information (eg, operation 330 of FIG. 3 ), when the application is re-executed, if the set information exists, a heap area included in the virtual memory (eg, the heap area of FIG. 2 ) based on the set information (253)), determining the size (eg, operation 450 of FIG. 4), and allocating the virtual memory including the heap region of the determined size (eg, operation 470 of FIG. 4). have.

다양한 실시예에 따르면, 상기 힙 영역의 크기를 결정하는 동작은, 상기 설정된 정보가 존재하면, 상기 어플리케이션의 설정 파일에 기재된 상기 힙 영역의 크기 속성의 설정 값을 무시하는 동작을 포함할 수 있다.According to various embodiments, the operation of determining the size of the heap region may include an operation of ignoring a setting value of the size attribute of the heap region described in a setting file of the application if the set information exists.

다양한 실시예에 따르면, 상기 메모리 할당의 실패를 나타내는 정보를 설정하는 동작은, 상기 어플리케이션의 실행에 따른 상기 힙 영역의 실제 사용량을 상기 설정된 정보에 포함시키는 동작을 포함하고, 상기 힙 영역의 크기를 결정하는 동작은, 상기 힙 영역의 실제 사용량에 기반하여 상기 힙 영역의 크기를 결정하는 동작을 포함할 수 있다.According to various embodiments, the setting of the information indicating the failure of the memory allocation includes including the actual usage of the heap area according to the execution of the application in the set information, and determining the size of the heap area. The determining may include determining the size of the heap area based on the actual usage of the heap area.

다양한 실시예에 따르면, 상기 힙 영역의 크기는 지정된 개수로 구분된 크기 범위들을 나타내는 단계 값으로 설정되고, 상기 힙 영역의 크기를 결정하는 동작은, 상기 크기 범위들 중 상기 힙 영역의 실제 사용량이 포함되는 크기 범위를 나타내는 단계 값으로 상기 힙 영역의 크기를 설정하는 동작을 포함할 수 있다.According to various embodiments, the size of the heap area is set to a step value indicating a size range divided by a specified number, and the operation of determining the size of the heap area includes the actual usage of the heap area among the size ranges. It may include an operation of setting the size of the heap area to a step value indicating the included size range.

다양한 실시예에 따르면, 상기 메모리 할당의 실패는 상기 가상 메모리에 포함된 영역들 중 상기 힙 영역 이외의 영역에 대한 저장 공간의 부족 시 발생되는 제1 실패를 포함할 수 있다.According to various embodiments, the failure of the memory allocation may include a first failure occurring when a storage space for a region other than the heap region among regions included in the virtual memory is insufficient.

다양한 실시예에 따르면, 상기 메모리 할당의 실패를 나타내는 정보를 설정하는 동작은, 상기 제1 실패의 발생 시, 상기 설정된 정보에 상기 힙 영역의 크기를 줄이기 위한 정보를 포함시키는 동작(예: 도 5의 동작 530)을 포함할 수 있다.According to various embodiments, the setting of the information indicating the failure of the memory allocation may include, when the first failure occurs, including information for reducing the size of the heap area in the set information (eg, FIG. 5 ) of operation 530).

다양한 실시예에 따르면, 상기 가상 메모리의 할당 방법은, 상기 제1 실패의 발생 시, 상기 어플리케이션의 실행과 관련된 프로세스로 상기 제1 실패의 발생을 나타내는 신호를 전송하는 동작을 더 포함할 수 있다.According to various embodiments, the method of allocating the virtual memory may further include, when the first failure occurs, transmitting a signal indicating the occurrence of the first failure to a process related to the execution of the application.

다양한 실시예에 따르면, 상기 가상 메모리의 할당 방법은, 상기 신호의 전송 후, 지정된 횟수의 다른 제1 실패들이 발생되면, 상기 다른 제1 실패들의 발생을 나타내는 신호들을 상기 프로세스로 전송하지 않도록 제어하는 동작, 상기 다른 제1 실패들의 발생 후, 또 다른 제1 실패가 발생되면, 상기 또 다른 제1 실패의 발생을 나타내는 신호를 상기 프로세스로 전송하는 동작, 및 상기 프로세스가 수신한 상기 신호의 개수가 지정된 값을 초과하면, 상기 힙 영역의 크기에 대한 변경 여부를 결정하는 동작을 더 포함할 수 있다.According to various embodiments, the method of allocating the virtual memory includes controlling not to transmit signals indicating occurrence of the other first failures to the process when other first failures of a specified number of times occur after the transmission of the signal. after the occurrence of the other first failures, if another first failure occurs, sending a signal indicating the occurrence of the another first failure to the process, and the number of the signals received by the process is When the specified value is exceeded, the method may further include determining whether to change the size of the heap area.

다양한 실시예에 따르면, 상기 메모리 할당의 실패는 상기 가상 메모리에 포함된 영역들 중 상기 힙 영역에 대한 저장 공간의 부족 시 발생되는 제2 실패를 포함할 수 있다.According to various embodiments, the failure of the memory allocation may include a second failure occurring when a storage space for the heap area among the areas included in the virtual memory is insufficient.

다양한 실시예에 따르면, 상기 메모리 할당의 실패를 나타내는 정보를 설정하는 동작은, 상기 제2 실패의 발생 시, 상기 설정된 정보에 상기 힙 영역의 크기를 늘리기 위한 정보를 포함시키는 동작(예: 도 5의 동작 550)을 포함할 수 있다.According to various embodiments, the setting of the information indicating the failure of the memory allocation includes, when the second failure occurs, including information for increasing the size of the heap area in the set information (eg, FIG. 5 ) of operation 550).

본 문서에 개시된 다양한 실시예들에 따른 전자 장치는 다양한 형태의 장치가 될 수 있다. 전자 장치는, 예를 들면, 휴대용 통신 장치(예: 스마트폰), 컴퓨터 장치, 휴대용 멀티미디어 장치, 휴대용 의료 기기, 카메라, 웨어러블 장치, 또는 가전 장치를 포함할 수 있다. 본 문서의 실시예에 따른 전자 장치는 전술한 기기들에 한정되지 않는다.The electronic device according to various embodiments disclosed in this document may have various types of devices. The electronic device may include, for example, a portable communication device (eg, a smart phone), a computer device, a portable multimedia device, a portable medical device, a camera, a wearable device, or a home appliance device. The electronic device according to the embodiment of the present document is not limited to the above-described devices.

본 문서의 다양한 실시예들 및 이에 사용된 용어들은 본 문서에 기재된 기술적 특징들을 특정한 실시예들로 한정하려는 것이 아니며, 해당 실시예의 다양한 변경, 균등물, 또는 대체물을 포함하는 것으로 이해되어야 한다. 도면의 설명과 관련하여, 유사한 또는 관련된 구성요소에 대해서는 유사한 참조 부호가 사용될 수 있다. 아이템에 대응하는 명사의 단수 형은 관련된 문맥상 명백하게 다르게 지시하지 않는 한, 상기 아이템 한 개 또는 복수 개를 포함할 수 있다. 본 문서에서, "A 또는 B", "A 및 B 중 적어도 하나", "A 또는 B 중 적어도 하나", "A, B 또는 C", "A, B 및 C 중 적어도 하나", 및 "A, B, 또는 C 중 적어도 하나"와 같은 문구들 각각은 그 문구들 중 해당하는 문구에 함께 나열된 항목들 중 어느 하나, 또는 그들의 모든 가능한 조합을 포함할 수 있다. "제1", "제2", 또는 "첫째" 또는 "둘째"와 같은 용어들은 단순히 해당 구성요소를 다른 해당 구성요소와 구분하기 위해 사용될 수 있으며, 해당 구성요소들을 다른 측면(예: 중요성 또는 순서)에서 한정하지 않는다. 어떤(예: 제1) 구성요소가 다른(예: 제2) 구성요소에, "기능적으로" 또는 "통신적으로"라는 용어와 함께 또는 이런 용어 없이, "커플드" 또는 "커넥티드"라고 언급된 경우, 그것은 상기 어떤 구성요소가 상기 다른 구성요소에 직접적으로(예: 유선으로), 무선으로, 또는 제 3 구성요소를 통하여 연결될 수 있다는 것을 의미한다.The various embodiments of this document and terms used therein are not intended to limit the technical features described in this document to specific embodiments, but it should be understood to include various modifications, equivalents, or substitutions of the embodiments. In connection with the description of the drawings, like reference numerals may be used for similar or related components. The singular form of the noun corresponding to the item may include one or more of the item, unless the relevant context clearly dictates otherwise. As used herein, "A or B", "at least one of A and B", "at least one of A or B", "A, B or C", "at least one of A, B and C", and "A , B, or C" each may include any one of the items listed together in the corresponding one of the phrases, or all possible combinations thereof. Terms such as “first”, “second”, or “first” or “second” may simply be used to distinguish the component from other components in question, and may refer to components in other aspects (e.g., importance or order) is not limited. It is said that one (eg, first) component is "coupled" or "connected" to another (eg, second) component, with or without the terms "functionally" or "communicatively". When referenced, it means that one component can be connected to the other component directly (eg by wire), wirelessly, or through a third component.

본 문서의 다양한 실시예들에서 사용된 용어 "모듈"은 하드웨어, 소프트웨어 또는 펌웨어로 구현된 유닛을 포함할 수 있으며, 예를 들면, 로직, 논리 블록, 부품, 또는 회로와 같은 용어와 상호 호환적으로 사용될 수 있다. 모듈은, 일체로 구성된 부품 또는 하나 또는 그 이상의 기능을 수행하는, 상기 부품의 최소 단위 또는 그 일부가 될 수 있다. 예를 들면, 일 실시예에 따르면, 모듈은 ASIC(application-specific integrated circuit)의 형태로 구현될 수 있다.The term “module” used in various embodiments of this document may include a unit implemented in hardware, software, or firmware, and is interchangeable with terms such as, for example, logic, logic block, component, or circuit. can be used as A module may be an integrally formed part or a minimum unit or a part of the part that performs one or more functions. For example, according to an embodiment, the module may be implemented in the form of an application-specific integrated circuit (ASIC).

본 문서의 다양한 실시예들은 기기(machine)(예: 전자 장치(101))에 의해 읽을 수 있는 저장 매체(storage medium)(예: 내장 메모리(136) 또는 외장 메모리(138))에 저장된 하나 이상의 명령어들을 포함하는 소프트웨어(예: 프로그램(140))로서 구현될 수 있다. 예를 들면, 기기(예: 전자 장치(101))의 프로세서(예: 프로세서(120))는, 저장 매체로부터 저장된 하나 이상의 명령어들 중 적어도 하나의 명령을 호출하고, 그것을 실행할 수 있다. 이것은 기기가 상기 호출된 적어도 하나의 명령어에 따라 적어도 하나의 기능을 수행하도록 운영되는 것을 가능하게 한다. 상기 하나 이상의 명령어들은 컴파일러에 의해 생성된 코드 또는 인터프리터에 의해 실행될 수 있는 코드를 포함할 수 있다. 기기로 읽을 수 있는 저장 매체는, 비일시적(non-transitory) 저장 매체의 형태로 제공될 수 있다. 여기서, '비일시적'은 저장 매체가 실재(tangible)하는 장치이고, 신호(signal)(예: 전자기파)를 포함하지 않는다는 것을 의미할 뿐이며, 이 용어는 데이터가 저장 매체에 반영구적으로 저장되는 경우와 임시적으로 저장되는 경우를 구분하지 않는다.Various embodiments of the present document include one or more stored in a storage medium (eg, internal memory 136 or external memory 138) readable by a machine (eg, electronic device 101). It may be implemented as software (eg, the program 140) including instructions. For example, a processor (eg, processor 120 ) of a device (eg, electronic device 101 ) may call at least one command among one or more commands stored from a storage medium and execute it. This makes it possible for the device to be operated to perform at least one function according to the called at least one command. The one or more instructions may include code generated by a compiler or code executable by an interpreter. The device-readable storage medium may be provided in the form of a non-transitory storage medium. Here, 'non-transitory' only means that the storage medium is a tangible device and does not include a signal (eg, electromagnetic wave), and this term is used in cases where data is semi-permanently stored in the storage medium and It does not distinguish between temporary storage cases.

일 실시예에 따르면, 본 문서에 개시된 다양한 실시예들에 따른 방법은 컴퓨터 프로그램 제품(computer program product)에 포함되어 제공될 수 있다. 컴퓨터 프로그램 제품은 상품으로서 판매자 및 구매자 간에 거래될 수 있다. 컴퓨터 프로그램 제품은 기기로 읽을 수 있는 저장 매체(예: compact disc read only memory(CD-ROM))의 형태로 배포되거나, 또는 어플리케이션 스토어(예: 플레이 스토어TM)를 통해 또는 두 개의 사용자 장치들(예: 스마트 폰들) 간에 직접, 온라인으로 배포(예: 다운로드 또는 업로드)될 수 있다. 온라인 배포의 경우에, 컴퓨터 프로그램 제품의 적어도 일부는 제조사의 서버, 어플리케이션 스토어의 서버, 또는 중계 서버의 메모리와 같은 기기로 읽을 수 있는 저장 매체에 적어도 일시 저장되거나, 임시적으로 생성될 수 있다.According to an embodiment, the method according to various embodiments disclosed in this document may be included and provided in a computer program product. Computer program products may be traded between sellers and buyers as commodities. The computer program product is distributed in the form of a machine-readable storage medium (eg compact disc read only memory (CD-ROM)), or via an application store (eg Play Store TM ) or on two user devices ( It can be distributed (eg downloaded or uploaded) directly between smartphones (eg: smartphones) and online. In the case of online distribution, at least a part of the computer program product may be temporarily stored or temporarily generated in a machine-readable storage medium such as a memory of a server of a manufacturer, a server of an application store, or a relay server.

다양한 실시예들에 따르면, 상기 기술한 구성요소들의 각각의 구성요소(예: 모듈 또는 프로그램)는 단수 또는 복수의 개체를 포함할 수 있으며, 복수의 개체 중 일부는 다른 구성요소에 분리 배치될 수도 있다. 다양한 실시예들에 따르면, 전술한 해당 구성요소들 중 하나 이상의 구성요소들 또는 동작들이 생략되거나, 또는 하나 이상의 다른 구성요소들 또는 동작들이 추가될 수 있다. 대체적으로 또는 추가적으로, 복수의 구성요소들(예: 모듈 또는 프로그램)은 하나의 구성요소로 통합될 수 있다. 이런 경우, 통합된 구성요소는 상기 복수의 구성요소들 각각의 구성요소의 하나 이상의 기능들을 상기 통합 이전에 상기 복수의 구성요소들 중 해당 구성요소에 의해 수행되는 것과 동일 또는 유사하게 수행할 수 있다. 다양한 실시예들에 따르면, 모듈, 프로그램 또는 다른 구성요소에 의해 수행되는 동작들은 순차적으로, 병렬적으로, 반복적으로, 또는 휴리스틱하게 실행되거나, 상기 동작들 중 하나 이상이 다른 순서로 실행되거나, 생략되거나, 또는 하나 이상의 다른 동작들이 추가될 수 있다.According to various embodiments, each component (eg, module or program) of the above-described components may include a singular or a plurality of entities, and some of the plurality of entities may be separately disposed in other components. have. According to various embodiments, one or more components or operations among the above-described corresponding components may be omitted, or one or more other components or operations may be added. Alternatively or additionally, a plurality of components (eg, a module or a program) may be integrated into one component. In this case, the integrated component may perform one or more functions of each component of the plurality of components identically or similarly to those performed by the corresponding component among the plurality of components prior to the integration. . According to various embodiments, operations performed by a module, program, or other component are executed sequentially, in parallel, repeatedly, or heuristically, or one or more of the operations are executed in a different order, or omitted. or one or more other operations may be added.

Claims (20)

전자 장치에 있어서,
어플리케이션을 저장하는 메모리; 및
상기 메모리와 작동적으로 연결된 프로세서를 포함하고,
상기 프로세서는,
상기 어플리케이션의 실행 중 상기 어플리케이션에 대응되는 가상 메모리에 대한 메모리 할당이 실패하면, 상기 메모리 할당의 실패를 나타내는 정보를 설정하고,
상기 어플리케이션의 재실행 시, 상기 설정된 정보가 존재하면, 상기 설정된 정보에 기반하여 상기 가상 메모리에 포함된 힙 영역의 크기를 결정하고,
상기 결정된 크기의 힙 영역을 포함하는 상기 가상 메모리를 할당하도록 설정된 전자 장치.
In an electronic device,
memory for storing applications; and
a processor operatively coupled to the memory;
The processor is
If memory allocation for the virtual memory corresponding to the application fails during execution of the application, information indicating the failure of the memory allocation is set;
When the application is re-executed, if the set information exists, the size of the heap area included in the virtual memory is determined based on the set information,
The electronic device configured to allocate the virtual memory including the heap area of the determined size.
청구항 1에 있어서,
상기 프로세서는,
상기 어플리케이션의 재실행 시, 상기 설정된 정보가 존재하면, 상기 어플리케이션의 설정 파일에 기재된 상기 힙 영역의 크기 속성의 설정 값을 무시하도록 설정된 전자 장치.
The method according to claim 1,
The processor is
When the application is re-executed, if the set information exists, the electronic device is set to ignore a setting value of the size attribute of the heap area described in the setting file of the application.
청구항 1에 있어서,
상기 프로세서는,
상기 어플리케이션의 실행에 따른 상기 힙 영역의 실제 사용량을 상기 설정된 정보에 포함시키고,
상기 힙 영역의 실제 사용량에 기반하여 상기 힙 영역의 크기를 결정하도록 설정된 전자 장치.
The method according to claim 1,
The processor is
Including the actual usage of the heap area according to the execution of the application in the set information,
The electronic device is configured to determine the size of the heap area based on the actual usage of the heap area.
청구항 3에 있어서,
상기 힙 영역의 크기는 지정된 개수로 구분된 크기 범위들을 나타내는 단계 값으로 설정되고,
상기 프로세서는,
상기 크기 범위들 중 상기 힙 영역의 실제 사용량이 포함되는 크기 범위를 나타내는 단계 값으로 상기 힙 영역의 크기를 설정하는 전자 장치.
4. The method according to claim 3,
The size of the heap area is set to a step value representing size ranges divided by a specified number,
The processor is
The electronic device for setting the size of the heap area as a step value indicating a size range in which the actual usage of the heap area is included among the size ranges.
청구항 1에 있어서,
상기 메모리 할당의 실패는 상기 가상 메모리에 포함된 영역들 중 상기 힙 영역 이외의 영역에 대한 저장 공간의 부족 시 발생되는 제1 실패를 포함하는 전자 장치.
The method according to claim 1,
The failure of the memory allocation includes a first failure occurring when a storage space for a region other than the heap region among regions included in the virtual memory is insufficient.
청구항 5에 있어서,
상기 프로세서는,
상기 제1 실패의 발생 시, 상기 설정된 정보에 상기 힙 영역의 크기를 줄이기 위한 정보를 포함시키도록 설정된 전자 장치.
6. The method of claim 5,
The processor is
The electronic device is configured to include information for reducing the size of the heap area in the set information when the first failure occurs.
청구항 5에 있어서,
상기 프로세서는,
상기 제1 실패의 발생 시, 상기 어플리케이션의 실행과 관련된 프로세스로 상기 제1 실패의 발생을 나타내는 신호를 전송하도록 설정된 전자 장치.
6. The method of claim 5,
The processor is
When the first failure occurs, the electronic device is configured to transmit a signal indicating the occurrence of the first failure to a process related to the execution of the application.
청구항 7에 있어서,
상기 프로세서는,
상기 신호의 전송 후, 지정된 횟수의 다른 제1 실패들이 발생되면, 상기 다른 제1 실패들의 발생을 나타내는 신호들을 상기 프로세스로 전송하지 않도록 제어하고,
상기 다른 제1 실패들의 발생 후, 또 다른 제1 실패가 발생되면, 상기 또 다른 제1 실패의 발생을 나타내는 신호를 상기 프로세스로 전송하고,
상기 프로세스가 수신한 상기 신호의 개수가 지정된 값을 초과하면, 상기 힙 영역의 크기에 대한 변경 여부를 결정하도록 설정된 전자 장치.
8. The method of claim 7,
The processor is
after transmitting the signal, if a specified number of other first failures occur, controlling not to transmit signals indicating the occurrence of the other first failures to the process;
when another first failure occurs after the occurrence of the other first failures, sending a signal indicating the occurrence of the another first failure to the process;
The electronic device is configured to determine whether to change the size of the heap area when the number of signals received by the process exceeds a specified value.
청구항 1에 있어서,
상기 메모리 할당의 실패는 상기 가상 메모리에 포함된 영역들 중 상기 힙 영역에 대한 저장 공간의 부족 시 발생되는 제2 실패를 포함하는 전자 장치.
The method according to claim 1,
The failure of the memory allocation includes a second failure occurring when a storage space for the heap region among regions included in the virtual memory is insufficient.
청구항 9에 있어서,
상기 프로세서는,
상기 제2 실패의 발생 시, 상기 설정된 정보에 상기 힙 영역의 크기를 늘리기 위한 정보를 포함시키도록 설정된 전자 장치.
10. The method of claim 9,
The processor is
The electronic device is configured to include information for increasing the size of the heap area in the set information when the second failure occurs.
전자 장치의 가상 메모리의 할당 방법에 있어서,
상기 전자 장치의 메모리에 저장된 어플리케이션의 실행 중 상기 어플리케이션에 대응되는 가상 메모리에 대한 메모리 할당이 실패하면, 상기 메모리 할당의 실패를 나타내는 정보를 설정하는 동작;
상기 어플리케이션의 재실행 시, 상기 설정된 정보가 존재하면, 상기 설정된 정보에 기반하여 상기 가상 메모리에 포함된 힙 영역의 크기를 결정하는 동작; 및
상기 결정된 크기의 힙 영역을 포함하는 상기 가상 메모리를 할당하는 동작을 포함하는 가상 메모리의 할당 방법.
A method for allocating virtual memory in an electronic device, the method comprising:
setting information indicating failure of memory allocation when memory allocation to a virtual memory corresponding to the application fails during execution of an application stored in the memory of the electronic device;
determining a size of a heap area included in the virtual memory based on the set information if the set information exists when the application is re-executed; and
and allocating the virtual memory including the heap area of the determined size.
청구항 11에 있어서,
상기 힙 영역의 크기를 결정하는 동작은,
상기 설정된 정보가 존재하면, 상기 어플리케이션의 설정 파일에 기재된 상기 힙 영역의 크기 속성의 설정 값을 무시하는 동작을 포함하는 가상 메모리의 할당 방법.
12. The method of claim 11,
The operation of determining the size of the heap area is
and ignoring a setting value of a size attribute of the heap area described in a setting file of the application when the set information exists.
청구항 11에 있어서,
상기 메모리 할당의 실패를 나타내는 정보를 설정하는 동작은,
상기 어플리케이션의 실행에 따른 상기 힙 영역의 실제 사용량을 상기 설정된 정보에 포함시키는 동작을 포함하고,
상기 힙 영역의 크기를 결정하는 동작은,
상기 힙 영역의 실제 사용량에 기반하여 상기 힙 영역의 크기를 결정하는 동작을 포함하는 가상 메모리의 할당 방법.
12. The method of claim 11,
The operation of setting information indicating the failure of the memory allocation comprises:
including the actual usage of the heap area according to the execution of the application in the set information,
The operation of determining the size of the heap area is
and determining a size of the heap area based on the actual usage of the heap area.
청구항 13에 있어서,
상기 힙 영역의 크기는 지정된 개수로 구분된 크기 범위들을 나타내는 단계 값으로 설정되고,
상기 힙 영역의 크기를 결정하는 동작은,
상기 크기 범위들 중 상기 힙 영역의 실제 사용량이 포함되는 크기 범위를 나타내는 단계 값으로 상기 힙 영역의 크기를 설정하는 동작을 포함하는 가상 메모리의 할당 방법.
14. The method of claim 13,
The size of the heap area is set to a step value representing size ranges divided by a specified number,
The operation of determining the size of the heap area is
and setting the size of the heap area to a step value indicating a size range in which the actual usage of the heap area is included among the size ranges.
청구항 11에 있어서,
상기 메모리 할당의 실패는 상기 가상 메모리에 포함된 영역들 중 상기 힙 영역 이외의 영역에 대한 저장 공간의 부족 시 발생되는 제1 실패를 포함하는 가상 메모리의 할당 방법.
12. The method of claim 11,
and the failure of the memory allocation includes a first failure occurring when a storage space for an area other than the heap area among areas included in the virtual memory is insufficient.
청구항 15에 있어서,
상기 메모리 할당의 실패를 나타내는 정보를 설정하는 동작은,
상기 제1 실패의 발생 시, 상기 설정된 정보에 상기 힙 영역의 크기를 줄이기 위한 정보를 포함시키는 동작을 포함하는 가상 메모리의 할당 방법.
16. The method of claim 15,
The operation of setting information indicating the failure of the memory allocation comprises:
and including information for reducing the size of the heap area in the set information when the first failure occurs.
청구항 15에 있어서,
상기 제1 실패의 발생 시, 상기 어플리케이션의 실행과 관련된 프로세스로 상기 제1 실패의 발생을 나타내는 신호를 전송하는 동작을 더 포함하는 가상 메모리의 할당 방법.
16. The method of claim 15,
and transmitting a signal indicating occurrence of the first failure to a process related to execution of the application when the first failure occurs.
청구항 17에 있어서,
상기 신호의 전송 후, 지정된 횟수의 다른 제1 실패들이 발생되면, 상기 다른 제1 실패들의 발생을 나타내는 신호들을 상기 프로세스로 전송하지 않도록 제어하는 동작;
상기 다른 제1 실패들의 발생 후, 또 다른 제1 실패가 발생되면, 상기 또 다른 제1 실패의 발생을 나타내는 신호를 상기 프로세스로 전송하는 동작; 및
상기 프로세스가 수신한 상기 신호의 개수가 지정된 값을 초과하면, 상기 힙 영역의 크기에 대한 변경 여부를 결정하는 동작을 더 포함하는 가상 메모리의 할당 방법.
18. The method of claim 17,
after transmitting the signal, when other first failures occur a specified number of times, controlling not to transmit signals indicating occurrence of the other first failures to the process;
when another first failure occurs after the occurrence of the other first failures, transmitting a signal indicating the occurrence of the another first failure to the process; and
and determining whether to change the size of the heap area when the number of signals received by the process exceeds a specified value.
청구항 11에 있어서,
상기 메모리 할당의 실패는 상기 가상 메모리에 포함된 영역들 중 상기 힙 영역에 대한 저장 공간의 부족 시 발생되는 제2 실패를 포함하는 가상 메모리의 할당 방법.
12. The method of claim 11,
and the failure of the memory allocation includes a second failure occurring when a storage space for the heap area among the areas included in the virtual memory is insufficient.
청구항 19에 있어서,
상기 메모리 할당의 실패를 나타내는 정보를 설정하는 동작은,
상기 제2 실패의 발생 시, 상기 설정된 정보에 상기 힙 영역의 크기를 늘리기 위한 정보를 포함시키는 동작을 포함하는 가상 메모리의 할당 방법.
20. The method of claim 19,
The operation of setting information indicating the failure of the memory allocation comprises:
and including information for increasing the size of the heap area in the set information when the second failure occurs.
KR1020200097640A 2020-08-04 2020-08-04 Method for allocating of virtual memory and electronic device supporting the same KR20220017309A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
KR1020200097640A KR20220017309A (en) 2020-08-04 2020-08-04 Method for allocating of virtual memory and electronic device supporting the same
PCT/KR2021/010169 WO2022030964A1 (en) 2020-08-04 2021-08-03 Method for allocating virtual memory and electronic device supporting same

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020200097640A KR20220017309A (en) 2020-08-04 2020-08-04 Method for allocating of virtual memory and electronic device supporting the same

Publications (1)

Publication Number Publication Date
KR20220017309A true KR20220017309A (en) 2022-02-11

Family

ID=80118644

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020200097640A KR20220017309A (en) 2020-08-04 2020-08-04 Method for allocating of virtual memory and electronic device supporting the same

Country Status (2)

Country Link
KR (1) KR20220017309A (en)
WO (1) WO2022030964A1 (en)

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20060033606A (en) * 2004-10-15 2006-04-19 주식회사 팬택앤큐리텔 Apparatus and method for controlling a memory allocation
KR20080012664A (en) * 2006-08-04 2008-02-12 한국과학기술원 Safe sharing of heap memory among multiple applications without the virtual memory capabilities and thereof computer
JP2009199549A (en) * 2008-02-25 2009-09-03 Nec Corp Computer system, method and program for allocating resources to virtual machines
US9880761B2 (en) * 2015-12-28 2018-01-30 International Business Machines Corporation Restorable memory allocator
KR102498668B1 (en) * 2017-05-17 2023-02-09 삼성전자주식회사 Method and host device for flash-aware heap memory management

Also Published As

Publication number Publication date
WO2022030964A1 (en) 2022-02-10

Similar Documents

Publication Publication Date Title
US20230342074A1 (en) Electronic device and method for operation of storage of electronic device
KR20220132865A (en) Electronic device including storage and method of the same
KR20220033912A (en) Electronic device and operation method in the electronic device and non-transitory storage medium for managing memory
KR20220102421A (en) Electronic device and memory management method of the electronic device
KR20230052022A (en) Method of controlling memory and electronic device performing the method
KR20220017309A (en) Method for allocating of virtual memory and electronic device supporting the same
KR20220101789A (en) Electronic device and operation method thereof
KR20220102056A (en) Electronic device for managing memory and method of operating the same
KR20220102405A (en) Electronic device and operation method thereof
US12086420B2 (en) Memory management method and electronic device
US12038815B2 (en) Electronic device and operation method thereof
US20230342209A1 (en) Service operation method and electronic device supporting same
US11907166B2 (en) Electronic device and method for updating database based on reserved space
US20230236744A1 (en) Electronic device and method for managing memory of electronic device
EP4261681A1 (en) Electronic device and method for loading kernel module of electronic device
EP4411548A1 (en) Memory control method and electronic device for performing same
US20230118797A1 (en) Data swapping method and electronic device supporting same
US20240211137A1 (en) Electronic device for managing memory and operating method thereof
US20230237025A1 (en) Electronic device for managing journal file and operation method thereof
KR20240133101A (en) Method for dynamically changing size of execution screen and electronic device thereof
KR20220102489A (en) Electronic device and method for updating database based on reserve space
KR20240092515A (en) Electronic device and method for managing memory
KR20240025417A (en) Method for managing memory and electronic device supporting the same
KR20240020133A (en) Apparatus for detecting frame drop and operating method of thereof
KR20230022772A (en) Electronic device for changing screen based on swipe input and method of opearating the same