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 PDFInfo
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0629—Configuration or reconfiguration of storage systems
- G06F3/0631—Configuration or reconfiguration of storage systems by allocating resources to storage systems
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F12/00—Accessing, addressing or allocating within memory systems or architectures
- G06F12/02—Addressing or allocation; Relocation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F12/00—Accessing, addressing or allocating within memory systems or architectures
- G06F12/02—Addressing or allocation; Relocation
- G06F12/0223—User address space allocation, e.g. contiguous or non contiguous base addressing
- G06F12/023—Free address space management
- G06F12/0238—Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0638—Organizing or formatting or addressing of data
- G06F3/0644—Management of space entities, e.g. partitions, extents, pools
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0653—Monitoring storage devices or systems
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0662—Virtualisation aspects
- G06F3/0665—Virtualisation aspects at area level, e.g. provisioning of virtual or logical volumes
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0662—Virtualisation aspects
- G06F3/0667—Virtualisation 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
Description
본 발명의 다양한 실시예들은 가상 메모리의 할당 기술에 관한 것이다.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
프로세서(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
보조 프로세서(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
메모리(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
프로그램(140)은 메모리(130)에 소프트웨어로서 저장될 수 있으며, 예를 들면, 운영 체제(142), 미들웨어(144) 또는 어플리케이션(146)을 포함할 수 있다.The
입력 모듈(150)은, 전자 장치(101)의 구성요소(예: 프로세서(120))에 사용될 명령 또는 데이터를 전자 장치(101)의 외부(예: 사용자)로부터 수신할 수 있다. 입력 모듈(150)은, 예를 들면, 마이크, 마우스, 키보드, 키(예: 버튼), 또는 디지털 펜(예: 스타일러스 펜)을 포함할 수 있다.The
음향 출력 모듈(155)은 음향 신호를 전자 장치(101)의 외부로 출력할 수 있다. 음향 출력 모듈(155)은, 예를 들면, 스피커 또는 리시버를 포함할 수 있다. 스피커는 멀티미디어 재생 또는 녹음 재생과 같이 일반적인 용도로 사용될 수 있다. 리시버는 착신 전화를 수신하기 위해 사용될 수 있다. 일 실시예에 따르면, 리시버는 스피커와 별개로, 또는 그 일부로서 구현될 수 있다.The
디스플레이 모듈(160)은 전자 장치(101)의 외부(예: 사용자)로 정보를 시각적으로 제공할 수 있다. 디스플레이 모듈(160)은, 예를 들면, 디스플레이, 홀로그램 장치, 또는 프로젝터 및 해당 장치를 제어하기 위한 제어 회로를 포함할 수 있다. 일 실시예에 따르면, 디스플레이 모듈(160)은 터치를 감지하도록 설정된 터치 센서, 또는 상기 터치에 의해 발생되는 힘의 세기를 측정하도록 설정된 압력 센서를 포함할 수 있다.The
오디오 모듈(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
센서 모듈(176)은 전자 장치(101)의 작동 상태(예: 전력 또는 온도), 또는 외부의 환경 상태(예: 사용자 상태)를 감지하고, 감지된 상태에 대응하는 전기 신호 또는 데이터 값을 생성할 수 있다. 일 실시예에 따르면, 센서 모듈(176)은, 예를 들면, 제스처 센서, 자이로 센서, 기압 센서, 마그네틱 센서, 가속도 센서, 그립 센서, 근접 센서, 컬러 센서, IR(infrared) 센서, 생체 센서, 온도 센서, 습도 센서, 또는 조도 센서를 포함할 수 있다.The
인터페이스(177)는 전자 장치(101)가 외부 전자 장치(예: 전자 장치(102))와 직접 또는 무선으로 연결되기 위해 사용될 수 있는 하나 이상의 지정된 프로토콜들을 지원할 수 있다. 일 실시예에 따르면, 인터페이스(177)는, 예를 들면, HDMI(high definition multimedia interface), USB(universal serial bus) 인터페이스, SD카드 인터페이스, 또는 오디오 인터페이스를 포함할 수 있다.The
연결 단자(178)는, 그를 통해서 전자 장치(101)가 외부 전자 장치(예: 전자 장치(102))와 물리적으로 연결될 수 있는 커넥터를 포함할 수 있다. 일 실시예에 따르면, 연결 단자(178)는, 예를 들면, HDMI 커넥터, USB 커넥터, SD 카드 커넥터, 또는 오디오 커넥터(예: 헤드폰 커넥터)를 포함할 수 있다.The
햅틱 모듈(179)은 전기적 신호를 사용자가 촉각 또는 운동 감각을 통해서 인지할 수 있는 기계적인 자극(예: 진동 또는 움직임) 또는 전기적인 자극으로 변환할 수 있다. 일 실시예에 따르면, 햅틱 모듈(179)은, 예를 들면, 모터, 압전 소자, 또는 전기 자극 장치를 포함할 수 있다.The
카메라 모듈(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
통신 모듈(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
무선 통신 모듈(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
다양한 실시예에 따르면, 안테나 모듈(197)은 mmWave 안테나 모듈을 형성할 수 있다. 일 실시예에 따르면, mmWave 안테나 모듈은 인쇄 회로 기판, 상기 인쇄 회로 기판의 제1 면(예: 아래 면)에 또는 그에 인접하여 배치되고 지정된 고주파 대역(예: mmWave 대역)을 지원할 수 있는 RFIC, 및 상기 인쇄 회로 기판의 제2 면(예: 윗 면 또는 측 면)에 또는 그에 인접하여 배치되고 상기 지정된 고주파 대역의 신호를 송신 또는 수신할 수 있는 복수의 안테나들(예: 어레이 안테나)을 포함할 수 있다.According to various embodiments, the
상기 구성요소들 중 적어도 일부는 주변 기기들간 통신 방식(예: 버스, 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
도 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
상기 메모리(210)는 전자 장치(200)의 적어도 하나의 구성요소에 의해 사용되는 다양한 데이터를 저장할 수 있다. 일 실시예에 따르면, 상기 메모리(210)는 상기 프로세서(230)에 의해 실행될 수 있는 어플리케이션(211)을 저장할 수 있다.The
상기 프로세서(230)는 전자 장치(200)의 적어도 하나의 다른 구성요소를 제어할 수 있고, 다양한 데이터 처리 또는 연산을 수행할 수 있다. 일 실시예에 따르면, 상기 프로세서(230)는 상기 메모리(210)에 저장된 상기 어플리케이션(211)을 실행시킬 수 있다. 상기 프로세서(230)는 상기 어플리케이션(211)을 실행시키는 과정에서, 상기 메모리(210)의 제한적인 저장 공간을 보다 효율적으로 사용하기 위해, 가상 메모리(250)를 사용하여 실제 물리적으로 존재하는 메모리(210)의 용량보다 더 많은 저장 공간을 제공할 수 있다. 예를 들어, 상기 프로세서(230)는 상기 메모리(210)의 저장 공간 일부를 가상 메모리(250)로 설정하고, 가상 메모리(250)로 설정된 상기 메모리(210)의 저장 공간에 대한 접근을 가상 주소(또는 논리 주소)를 통해 수행되도록 제어할 수 있다.The
상기 가상 메모리(250)는 특정 어플리케이션(211)의 프로세스의 고유 공간인 사용자 영역 및 모든 어플리케이션(211)들의 프로세스들이 공유하는 공간인 커널 영역을 포함할 수 있다. 여기서, 프로세스는 하나의 시스템 즉, 전자 장치(200) 내에서 작동되는 프로그램을 나타낼 수 있다. 상기 사용자 영역은 어플리케이션(211)이 사용하는 지역 변수와 같이 임시로 저장되는 데이터의 저장 공간인 스택 영역(251), 어플리케이션(211)에 의해 동적으로 할당하는 공간인 힙 영역(253), 어플리케이션(211)이 사용하는 전역 변수 또는 정적 변수와 같이 어플리케이션(211)이 실행될 때 생성되고 어플리케이션(211)이 종료되면 시스템에 반환되는 공간인 데이터 영역(255), 및 어플리케이션(211)의 명령어(또는 코드)가 기계어의 형태로 저장되는 공간인 코드 영역(257)을 포함할 수 있다.The
일 실시예에 따르면, 상기 프로세서(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
일 실시예에 따르면, 상기 프로세서(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
일 실시예에 따르면, 상기 프로세서(230)는 상기 메모리 할당이 실패하면, 상기 어플리케이션(211)의 실행에 따른 상기 힙 영역(253)의 실제 사용량을 상기 프로파일에 포함시킬 수 있다. 예컨대, 상기 프로세서(230)는 상기 메모리 할당이 실패하는 경우, 상기 메모리 할당이 실패한 시점을 기준으로 상기 힙 영역(253)의 실제 사용량에 대한 정보를 확인하여 상기 프로파일에 기록할 수 있다. 또한, 상기 프로세서(230)는 상기 가상 메모리(250)의 할당 시, 상기 프로파일에 기록된 상기 힙 영역(253)의 실제 사용량에 기반하여 상기 힙 영역(253)의 크기를 결정할 수 있다. 상기 힙 영역(253)의 크기가 상기 프로파일에 기록된 상기 힙 영역(253)의 실제 사용량에 기반하여 결정됨에 따라, 상기 가상 메모리(250)의 저장 공간에 대한 효율성이 극대화될 수 있으며, 상기 가상 메모리(250)에 대한 메모리 할당의 실패 확률이 낮아질 수 있다.According to an embodiment, when the memory allocation fails, the
일 실시예에 따르면, 상기 힙 영역(253)의 실제 사용량은 가상 메모리의 저장 공간 부족(out of memory)에 따른 메모리 할당에 대한 실패 신호의 발생시, 확인된 상기 힙 영역(253)의 사용량을 기반으로 계산될 수 있다.According to an embodiment, the actual usage of the
일 실시예에 따르면, 상기 힙 영역(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
일 실시예에 따르면, 상기 프로세서(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
다른 예로, 상기 메모리 할당의 실패가 상기 가상 메모리(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
상기 제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
일 실시예에 따르면, 상기 프로세서(230)는 상기 힙 영역(253)의 크기가 동일한 상태에서, 상기 제1 실패의 발생 이력과 상기 제2 실패의 발생 이력이 모두 존재하는 경우, 상기 힙 영역(253)의 크기를 변경하지 않을 수 있다. 예컨대, 상기 힙 영역(253)의 크기가 상기 제2 단계 값으로 설정된 상태에서, 상기 제1 실패 및 상기 제2 실패가 발생한 경우, 상기 프로세서(230)는 상기 힙 영역(253)의 크기를 유지시킬 수 있다.According to an embodiment, the
일 실시예에 따르면, 상기 프로세서(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
상술한 설명에서, 상기 힙 영역(253)의 크기가 지정된 개수로 구분된 크기 범위들을 나타내는 단계 값으로 설정되는 경우에 대해 설명하였지만, 이에 한정되는 것은 아니다. 다양한 실시예에 따르면, 상기 프로세서(230)는 상기 힙 영역(253)의 크기를 상기 힙 영역(253)의 실제 사용량보다 지정된 크기 이상 큰 값으로 설정할 수도 있다. 이 경우, 상기 프로세서(230)는 상기 메모리(210)의 단위 처리량(예: 페이지 크기)에 대응되는 크기로 상기 힙 영역(253)의 크기를 설정할 수 있다.In the above description, the case in which the size of the
일 실시예에 따르면, 상기 힙 영역(253)의 크기는 실제 사용량에 기반하여 계산된 메모리의 크기 값(예: 0~1GB)일 수 있다. 예를 들어, 상기 힙 영역(253)의 크기는 실제 사용량 또는 실제 사용량에 마진(margin)값(예: 지정된 크기 값 또는 현재 할당된 힙 영역(253)의 크기에 지정된 비율을 곱한 값)을 더하여 계산된 크기일 수 있다.According to an embodiment, the size of the
일 실시예에 따르면, 상기 메모리 할당의 실패가 상기 가상 메모리(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
일 실시예에 따르면, 상기 메모리 할당의 실패가 상기 가상 메모리(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
일 실시예에 따르면, 상기 프로세서(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
일 실시예에 따르면, 상기 프로세서(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
일 실시예에 따르면, 상기 프로파일에 포함되는 정보 즉, 상기 프로파일에 기록되는 정보는 상기 힙 영역(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
상술한 바와 같이, 다양한 실시예에 따르면, 전자 장치(예: 도 2의 전자 장치(200))는, 어플리케이션(예: 도 2의 어플리케이션(211))을 저장하는 메모리(예: 도 2의 메모리(210)), 및 상기 메모리와 작동적으로 연결된 프로세서(예: 도 2의 프로세서(230))를 포함하고, 상기 프로세서는, 상기 어플리케이션의 실행 중 상기 어플리케이션에 대응되는 가상 메모리(예: 도 2의 가상 메모리(250))에 대한 메모리 할당이 실패하면, 상기 메모리 할당의 실패를 나타내는 정보를 설정하고, 상기 어플리케이션의 재실행 시, 상기 설정된 정보가 존재하면, 상기 설정된 정보에 기반하여 상기 가상 메모리에 포함된 힙 영역(예: 도 2의 힙 영역(253))의 크기를 결정하고, 상기 결정된 크기의 힙 영역을 포함하는 상기 가상 메모리를 할당하도록 설정될 수 있다.As described above, according to various embodiments, the electronic device (eg, the
다양한 실시예에 따르면, 상기 프로세서는, 상기 어플리케이션의 재실행 시, 상기 설정된 정보가 존재하면, 상기 어플리케이션의 설정 파일에 기재된 상기 힙 영역의 크기 속성의 설정 값을 무시하도록 설정될 수 있다.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
상기 가상 메모리에 대한 메모리 할당이 실패했다고 판단되면, 상기 프로세서는 동작 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
일 실시예에 따르면, 상기 프로파일에 포함되는 정보 즉, 상기 프로파일에 기록되는 정보는 상기 가상 메모리에 포함된 힙 영역(예: 도 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
일 실시예에 따르면, 상기 프로세서는 상기 메모리 할당이 실패하면, 어플리케이션(예: 도 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
일 실시예에 따르면, 상기 프로세서는 상기 메모리 할당의 실패가 상기 가상 메모리에 포함된 영역들 중 상기 힙 영역 이외의 영역에 대한 저장 공간의 부족 시 발생되는 제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
상기 프로파일이 존재하지 않는다고 판단된 경우, 상기 프로세서는 동작 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
일 실시예에 따르면, 상기 프로세서는 상기 프로파일에 포함된 상기 힙 영역의 크기에 대한 변경 여부에 관한 정보가 크기 유지를 나타내는 값으로 설정된 경우, 상기 힙 영역의 크기를 유지시킬 수 있다. 다른 실시예에 따르면, 상기 프로세서는 상기 프로파일에 포함된 상기 힙 영역의 크기에 대한 변경 여부에 관한 정보가 크기 감소를 나타내는 값으로 설정된 경우, 상기 프로파일에 포함된 상기 힙 영역의 크기 변경 값으로 상기 힙 영역의 크기를 감소시킬 수 있다. 또 다른 실시예에 따르면, 상기 프로세서는 상기 프로파일에 포함된 상기 힙 영역의 크기에 대한 변경 여부에 관한 정보가 크기 증가를 나타내는 값으로 설정된 경우, 상기 프로파일에 포함된 상기 힙 영역의 크기 변경 값으로 상기 힙 영역의 크기를 증가시킬 수 있다.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
도 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
상기 프로세서는 동작 510에서, 상기 메모리 할당의 실패가 상기 힙 영역에 대한 저장 공간의 부족에 따른 실패(상기 제2 실패)인지를 판단할 수 있다.In
상기 메모리 할당의 실패가 상기 힙 영역에 대한 저장 공간의 부족에 따른 실패가 아니라고 판단된 경우 즉, 상기 메모리 할당의 실패가 상기 힙 영역 이외의 영역에 대한 저장 공간의 부족에 따른 실패(상기 제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
상기 메모리 할당의 실패가 상기 힙 영역에 대한 저장 공간의 부족에 따른 실패라고 판단된 경우 즉, 상기 메모리 할당의 실패가 상기 힙 영역에 대한 저장 공간의 부족에 따른 실패(상기 제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
상술한 동작 510에서, 상기 프로세서가 상기 메모리 할당의 실패가 상기 힙 영역에 대한 저장 공간의 부족에 따른 실패(상기 제2 실패)인지를 판단하는 것으로 설명하였지만, 이에 한정되는 것은 아니다. 어떤 실시예에서, 상기 프로세서는 동작 510에서, 상기 메모리 할당의 실패가 상기 힙 영역 이외의 영역에 대한 저장 공간의 부족에 따른 실패(상기 제1 실패)인지를 판단할 수 있다. 이 경우에도 마찬가지로, 상기 프로세서는 상기 메모리 할당의 실패가 상기 힙 영역 이외의 영역에 대한 저장 공간의 부족에 따른 실패라고 판단되면 동작 530을 수행할 수 있고, 상기 메모리 할당의 실패가 상기 힙 영역 이외의 영역에 대한 저장 공간의 부족에 따른 실패가 아니라고 판단되면 동작 550을 수행할 수 있다.In the above-described
상기 힙 영역의 크기 감소 또는 증가를 위한 정보를 포함하도록 상기 프로파일이 설정되면, 상기 프로세서는 동작 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
도 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
상기 어플리케이션(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
상기 어플리케이션(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
상기 프로파일 설정 모듈(637)이 실행되면, 상기 프로파일 설정 모듈(637)은 동작 675에서, 상기 어플리케이션(610)에 대응되는 상기 프로파일(651)을 설정할 수 있다. 상기 프로파일(651)이 저장되어 있지 않은 경우, 상기 프로파일 설정 모듈(637)은 상기 프로파일(651)을 새로 생성할 수 있고, 상기 프로파일(651)이 저장되어 있는 경우, 상기 프로파일 설정 모듈(637)은 상기 저장된 프로파일(651)을 수정(또는 변경)할 수 있다. 상기 프로파일 설정 모듈(637)은 상기 실패 신호의 수신에 응답하여 상기 프로파일(651)에 상기 실패 신호의 수신 개수(또는 횟수)(상기 제1 실패의 발생을 나타내는 실패 신호의 개수)를 기록할 수 있다.When the
상기 실패 신호의 수신 개수가 지정된 값(예: 3회)을 초과하는 경우, 상기 프로파일 설정 모듈(637)은 동작 675-1에서, 상기 프로파일(651)을 설정할 수 있다. 일 예로, 상기 프로파일 설정 모듈(637)은 상기 프로파일(651)에 포함된 상기 힙 영역의 크기에 대한 변경 여부에 관한 정보를 크기 감소를 나타내는 값으로 설정할 수 있다.When the number of receptions of the failure signal exceeds a specified value (eg, three times), the
상기 프로파일 설정 모듈(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
일 실시예에 따르면, 상기 실패 신호의 수신 개수가 상기 지정된 값을 초과하는 경우, 상기 프로파일 설정 모듈(637)은 상기 힙 영역에 대한 저장 공간의 부족에 따른 실패의 발생 횟수를 확인할 수 있다. 상기 힙 영역에 대한 저장 공간의 부족에 따른 실패의 발생 횟수를 고려하여, 상기 프로파일 설정 모듈(637)은 상기 힙 영역의 크기에 대한 변경 여부를 결정할 수 있다. 상기 힙 영역의 크기에 대한 변경이 결정되면, 상기 프로파일 설정 모듈(637)은 상기 프로파일(651)에 상기 힙 영역의 크기에 대한 변경 여부에 관한 정보를 설정할 수 있다. 또한, 상기 프로파일 설정 모듈(637)은 상기 프로파일(651)에 상기 힙 영역의 크기 변경 값을 설정할 수 있다.According to an embodiment, when the number of reception of the failure signal exceeds the specified value, the
상기 어플리케이션(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
다양한 실시예에 따르면, 본 문서에 개시된 다양한 실시예들은 자바 가상 머신(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
다양한 실시예에 따르면, 상기 힙 영역의 크기를 결정하는 동작은, 상기 설정된 정보가 존재하면, 상기 어플리케이션의 설정 파일에 기재된 상기 힙 영역의 크기 속성의 설정 값을 무시하는 동작을 포함할 수 있다.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.
상기 프로세서는,
상기 어플리케이션의 재실행 시, 상기 설정된 정보가 존재하면, 상기 어플리케이션의 설정 파일에 기재된 상기 힙 영역의 크기 속성의 설정 값을 무시하도록 설정된 전자 장치.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.
상기 프로세서는,
상기 어플리케이션의 실행에 따른 상기 힙 영역의 실제 사용량을 상기 설정된 정보에 포함시키고,
상기 힙 영역의 실제 사용량에 기반하여 상기 힙 영역의 크기를 결정하도록 설정된 전자 장치.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.
상기 힙 영역의 크기는 지정된 개수로 구분된 크기 범위들을 나타내는 단계 값으로 설정되고,
상기 프로세서는,
상기 크기 범위들 중 상기 힙 영역의 실제 사용량이 포함되는 크기 범위를 나타내는 단계 값으로 상기 힙 영역의 크기를 설정하는 전자 장치.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 실패를 포함하는 전자 장치.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.
상기 프로세서는,
상기 제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.
상기 프로세서는,
상기 제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.
상기 프로세서는,
상기 신호의 전송 후, 지정된 횟수의 다른 제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.
상기 메모리 할당의 실패는 상기 가상 메모리에 포함된 영역들 중 상기 힙 영역에 대한 저장 공간의 부족 시 발생되는 제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.
상기 프로세서는,
상기 제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.
상기 힙 영역의 크기를 결정하는 동작은,
상기 설정된 정보가 존재하면, 상기 어플리케이션의 설정 파일에 기재된 상기 힙 영역의 크기 속성의 설정 값을 무시하는 동작을 포함하는 가상 메모리의 할당 방법.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.
상기 메모리 할당의 실패를 나타내는 정보를 설정하는 동작은,
상기 어플리케이션의 실행에 따른 상기 힙 영역의 실제 사용량을 상기 설정된 정보에 포함시키는 동작을 포함하고,
상기 힙 영역의 크기를 결정하는 동작은,
상기 힙 영역의 실제 사용량에 기반하여 상기 힙 영역의 크기를 결정하는 동작을 포함하는 가상 메모리의 할당 방법.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.
상기 힙 영역의 크기는 지정된 개수로 구분된 크기 범위들을 나타내는 단계 값으로 설정되고,
상기 힙 영역의 크기를 결정하는 동작은,
상기 크기 범위들 중 상기 힙 영역의 실제 사용량이 포함되는 크기 범위를 나타내는 단계 값으로 상기 힙 영역의 크기를 설정하는 동작을 포함하는 가상 메모리의 할당 방법.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.
상기 메모리 할당의 실패는 상기 가상 메모리에 포함된 영역들 중 상기 힙 영역 이외의 영역에 대한 저장 공간의 부족 시 발생되는 제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.
상기 메모리 할당의 실패를 나타내는 정보를 설정하는 동작은,
상기 제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.
상기 제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.
상기 신호의 전송 후, 지정된 횟수의 다른 제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.
상기 메모리 할당의 실패는 상기 가상 메모리에 포함된 영역들 중 상기 힙 영역에 대한 저장 공간의 부족 시 발생되는 제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.
상기 메모리 할당의 실패를 나타내는 정보를 설정하는 동작은,
상기 제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.
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)
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 |
-
2020
- 2020-08-04 KR KR1020200097640A patent/KR20220017309A/en unknown
-
2021
- 2021-08-03 WO PCT/KR2021/010169 patent/WO2022030964A1/en active Application Filing
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 |