IP Library Granted Patent US 11,137,934
Granted Patent B2
US 11,137,934 · App. 16/622,982 · Granted Oct 5, 2021

Memory block type processing method applicable to electronic device electronic device and non-transitory computer readable storage medium

Inventors: Kengyu Lin (Shenzhen, CN); Wenyen Chang (Shenzhen, CN)
Assignee: ONEPLUS TECHNOLOGY (SHENZHEN) CO., LTD.
G06F3/0655G06F3/0604G06F3/0679
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 11,137,934
App. No.
16/622,982
Granted
Oct 5, 2021
Kind
B2
Abstract

A memory block type processing method includes: a state of each memory block in the electronic device is monitored; when it is monitored that a memory block is released, a type of the released memory block is detected; responsive to that it is detected that an original type of the released memory block is inconsistent with a present type of the released memory block, a released memory capacity of the released memory block is detected; and the present type of the released memory block is adjusted according to the detected released memory capacity. Therefore, sufficient regional ranges of memory partitions of the reclaimable and/or movable types can be ensured, and during memory compaction, a continuous memory that is sufficient for a user to use can be effectively provided by compaction to alleviate the memory fragmentation problem.

Claims (56)

1. A memory block type processing method, applied to an electronic device, a memory of the electronic device comprising a plurality of memory blocks of a movable type, a plurality of memory blocks of a reclaimable type and a plurality of memory blocks of an unmovable type, the method comprising:

monitoring a state of each memory block in the electronic device;

when it is monitored that a memory block is released, detecting a type of the released memory block;

responsive to detecting that an original type of the released memory block is inconsistent with a present type of the released memory block, detecting a released memory capacity of the released memory block; and

adjusting the present type of the released memory block according to the detected released memory capacity.

2. The method of claim 1 , further comprising:

responsive to detecting that the original type of the released memory block is consistent with the present type of the released memory block, not adjusting the present type of the released memory block.

3. The method of claim 1 , wherein detecting the type of the released memory block comprises:

detecting the present type of the released memory block and the original type of the released memory block;

responsive to detecting that the present type of the released memory block is the unmovable type and the original type of the released memory block is the movable type or the reclaimable type, determining that the original type of the released memory block is inconsistent with the present type of the released memory block; and

responsive to detecting that the present type of the released memory block coincides with the original type of the released memory block, determining that the original type of the released memory block is consistent with the present type of the released memory block.

4. The method of claim 3 , further comprising: after detecting the released memory capacity of the released memory block,

comparing the detected released memory capacity with a preset capacity threshold value.

5. The method of claim 4 , wherein adjusting the present type of the released memory block according to the detected released memory capacity comprises:

when the detected released memory capacity is not less than the preset capacity threshold value, adjusting the present type of the released memory block into the original type of the released memory block.

6. The method of claim 5 , wherein adjusting the present type of the released memory block into the original type of the released memory block comprises:

when the original type of the released memory block is the reclaimable type, adjusting the present type of the released memory block into the reclaimable type; and

when the original type of the released memory block is the movable type, adjusting the present type of the released memory block into the movable type.

7. An electronic device, comprising:

a processor; and

a memory comprising a plurality of memory blocks of a movable type, a plurality of memory blocks of a reclaimable type and a plurality of memory blocks of an unmovable type, and storing one or more instructions for execution by the processor, the one or more instructions comprising:

instructions for monitoring a state of each memory block in the electronic device;

instructions for, when it is monitored that a memory block is released, detecting a type of the released memory block;

instructions for, responsive to detecting that an original type of the released memory block is inconsistent with a present type of the released memory block, detecting a released memory capacity of the released memory block; and

instructions for adjusting the present type of the released memory block according to the detected released memory capacity.

8. The electronic device of claim 7 , wherein the one or more instructions further comprise:

instructions for, responsive to detecting that the original type of the released memory block is consistent with the present type of the released memory block, not adjusting the present type of the released memory block.

9. The electronic device of claim 7 , wherein the instructions for detecting the type of the released memory block comprise:

instructions for detecting the present type of the released memory block and the original type of the released memory block;

instructions for, responsive to detecting that the present type of the released memory block is the unmovable type and the original type of the released memory block is the movable type or the reclaimable type, determining that the original type of the released memory block is inconsistent with the present type of the released memory block; and

instructions for, responsive to detecting that the present type of the released memory block coincides with the original type of the released memory block, determining that the original type of the released memory block is consistent with the present type of the released memory block.

10. The electronic device of claim 9 , wherein the one or more instructions further comprise:

instructions for, after detecting the released memory capacity of the released memory block, comparing the detected released memory capacity with a preset capacity threshold value.

11. The electronic device of claim 10 , wherein the instructions for adjusting the present type of the released memory block according to the detected released memory capacity comprise:

when the detected released memory capacity is not less than the preset capacity threshold value, adjusting the present type of the released memory block into the original type of the released memory block.

12. The electronic device of claim 11 , wherein the instructions for adjusting the present type of the released memory block into the original type of the released memory block comprise:

instructions for, when the original type of the released memory block is the reclaimable type, adjusting the present type of the released memory block into the reclaimable type; and

instructions for, when the original type of the released memory block is the movable type, adjusting the present type of the released memory block into the movable type.

13. A non-transitory readable storage medium having stored thereon a computer program that, when executed, causes a processor of an electronic device where the non-transitory readable storage medium is located to implement a memory block type processing method, a memory of the electronic device comprising a plurality of memory blocks of a movable type, a plurality of memory blocks of a reclaimable type and a plurality of memory blocks of an unmovable type, the method comprising:

monitoring a state of each memory block in the electronic device;

when it is monitored that a memory block is released, detecting a type of the released memory block;

responsive to detecting that an original type of the released memory block is inconsistent with a present type of the released memory block, detecting a released memory capacity of the released memory block; and

adjusting the present type of the released memory block according to the detected released memory capacity.

14. The non-transitory readable storage medium of claim 13 , wherein the method further comprises:

responsive to detecting that the original type of the released memory block is consistent with the present type of the released memory block, not adjusting the present type of the released memory block.

15. The non-transitory readable storage medium of claim 13 , wherein the detecting the type of the released memory block comprises:

detecting the present type of the released memory block and the original type of the released memory block;

responsive to detecting that the present type of the released memory block is the unmovable type and the original type of the released memory block is the movable type or the reclaimable type, determining that the original type of the released memory block is inconsistent with the present type of the released memory block; and

responsive to detecting that the present type of the released memory block coincides with the original type of the released memory block, determining that the original type of the released memory block is consistent with the present type of the released memory block.

16. The non-transitory readable storage medium of claim 15 , wherein the method further comprises: after detecting the released memory capacity of the released memory block,

comparing the detected released memory capacity with a preset capacity threshold value.

17. The non-transitory readable storage medium of claim 16 , wherein the adjusting the present type of the released memory block according to the detected released memory capacity comprises:

when the detected released memory capacity is not less than the preset capacity threshold value, adjusting the present type of the released memory block into the original type of the released memory block.

18. The non-transitory readable storage medium of claim 17 , wherein the adjusting the present type of the released memory block into the original type of the released memory block comprises:

when the original type of the released memory block is the reclaimable type, adjusting the present type of the released memory block into the reclaimable type; and

when the original type of the released memory block is the movable type, adjusting the present type of the released memory block into the movable type.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Mar 22, 2020
From: LIN, KENGYU; CHANG, WENYEN
To: ONEPLUS TECHNOLOGY (SHENZHEN) CO., LTD.
Reel/Frame 052204/0139 →
Priority Claims (1)
CN 201710457639.6 · Jun 16, 2017 · national
Continuity (1)
Related Publication 20210149582A1 · May 20, 2021