Dynamic memory management method based on energy consumption perception in Java program running

Through the dynamic memory management method based on energy consumption perception in Java programs, and the GC algorithm is used for dynamic memory allocation and recycling, the problem of memory management in the existing technology that does not fully consider energy consumption and thread priority is solved, and the system energy efficiency is significantly improved and energy saving is achieved.

CN120029770APending Publication Date: 2025-05-23INSPUR SOFTWARE TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510105557.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-23
Publication Date
2025-05-23

AI Technical Summary

Technical Problem

In the prior art, memory allocation and recycling do not fully consider the energy consumption characteristics and thread priority of each memory block, and have little impact on system energy efficiency, resulting in low energy efficiency and waste of energy when handling a large number of concurrent tasks.

Method used

It provides a dynamic memory management method based on energy consumption perception in Java program operation. By initializing the memory block collection and establishing a thread/process perception model, using GC algorithm to dynamically allocate and recover memory, monitoring the activity level and energy consumption value of memory blocks in real time, and dynamically adjusting the memory block recycling strategy.

Benefits of technology

It significantly improves the overall energy efficiency of the system. By dynamically adjusting memory allocation and recycling strategies, it ensures that the memory requirements of high-priority threads are responded in a timely manner, reduces unnecessary energy consumption, maximizes and reduces ineffective energy consumption, saves energy and reduces the system's carbon footprint.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120029770A_ABST
    Figure CN120029770A_ABST
Patent Text Reader

Abstract

The invention discloses a memory dynamic management method based on energy consumption perception in Java program running, and relates to the technical field of memory management. Comprising the steps that S1, a memory block set is initialized, and a thread / process perception model is established; S2, dynamic memory allocation is conducted through a GC algorithm; S3, the active degree and the energy consumption value of memory blocks are dynamically monitored, and candidate memory blocks are selected and recycled; S4, memory block recycling is dynamically adjusted, s5, regularly evaluating energy efficiency and performance balance to obtain an evaluation result, and S6, cleaning resources at the end: recycling all residual memory blocks by using a GC algorithm to ensure that all memories are effectively recycled, and releasing the resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention discloses a memory dynamic management method based on energy consumption perception during Java program operation, and relates to the technical field of memory management. Background Art

[0002] Memory allocation and recycling in existing technologies do not fully consider the energy consumption characteristics of each memory block and the impact of thread priority on system energy efficiency. Existing memory management strategies rely on a fixed recycling mechanism and lack the ability to dynamically perceive the memory usage of different threads. This makes it impossible for the system to flexibly adjust the memory management method according to actual resource requirements when processing a large number of concurrent tasks, resulting in low system energy efficiency and energy waste. Summary of the invention

[0003] In view of the problems of the prior art, the present invention provides a memory dynamic management method based on energy consumption perception during Java program operation, which has the characteristics of strong versatility and simple implementation, and has broad application prospects.

[0004] The specific scheme proposed by the present invention is:

[0005] The present invention provides a memory dynamic management method based on energy consumption perception during Java program operation, comprising:

[0006] S1 initializes a memory block set and establishes a thread / process awareness model: Initializes a memory block set, allocates an independent memory management area for each thread or process, and establishes a memory usage and energy consumption model for each thread or process.

[0007] S2 uses the GC algorithm to dynamically allocate memory: it dynamically adjusts memory allocation based on the priority and activity of threads or processes. For low-priority threads or processes, it allocates memory blocks with lower energy consumption; for high-priority threads or processes, it allocates memory blocks with higher activity.

[0008] S3 dynamically monitors the activity and energy consumption of memory blocks and selects candidate memory blocks for recycling: It monitors memory usage, activity, and energy consumption data in real time and decides whether to recycle or migrate memory blocks based on the activity and energy consumption data of memory blocks.

[0009] S4 dynamically adjusts memory block recycling: puts the selected memory blocks into the candidate recycling set and performs memory recycling operations.

[0010] S5 regularly evaluates energy efficiency and performance balance and obtains evaluation results.

[0011] Clean up resources at the end of S6: Use the GC algorithm to recycle all remaining memory blocks, ensure that all memory is effectively recycled, and release resources.

[0012] Furthermore, the step of selecting a candidate memory block for recycling in S3 of the method for dynamic memory management based on energy consumption awareness during the running of a Java program includes:

[0013] Use the GC algorithm to select global memory block recovery and local memory block recovery, among which global memory block recovery: regularly monitor memory usage M g and CPU utilization U CPU ,

[0014] When the global memory usage M g >T m Or CPU utilization U CPU >T c When global GC recovery is triggered, T m is the global recycling threshold, T c is the CPU utilization threshold,

[0015] During the global memory block recycling process, the recycling priority R of each memory block is evaluated. i , sort by priority and choose to recycle memory blocks with high energy consumption and low activity;

[0016] Perform local memory block recovery: monitor the memory usage M of each thread / process l , when M l >T l When the local GC of the thread is triggered, T i is the local recovery threshold,

[0017] During the local memory block recovery process, according to the thread priority P t and the energy consumption data and activity level of the memory blocks, and select memory blocks for recycling.

[0018] Furthermore, the energy consumption-aware memory dynamic management method in the running of a Java program evaluates the recycling priority R of each memory block. i ,include:

[0019] Using the following formula:

[0020] R i =α·E i +β·(1-A i )

[0021] Reclaim the memory block with priority R i Calculation, E i is the energy consumption of the memory block, A i is the activity of the memory block, and α and β are weight factors.

[0022] Furthermore, in S2 of the method for dynamic memory management based on energy consumption awareness during the running of a Java program, memory allocation is dynamically adjusted according to the priority and activity of the thread or process, including:

[0023] Using the following formula:

[0024] S i =P t ·A i +(1-P t )·(1-E i )

[0025] Get the assigned priority S of a thread or process i , where thread or process t has an allocation priority S for memory block i i According to the thread or process priority P t 、Memory block activity A i Energy consumption i Obtained by calculation.

[0026] The present invention also provides a memory dynamic management device based on energy consumption perception during Java program operation, which is characterized by comprising an initialization module, an allocation module, a monitoring module, a recycling module, an evaluation module and a cleaning module.

[0027] The initialization module initializes the memory block set and establishes a thread / process awareness model: initializes the memory block set, allocates an independent memory management area for each thread or process, and establishes a memory usage and energy consumption model for each thread or process.

[0028] The allocation module uses the GC algorithm to dynamically allocate memory: according to the priority and activity of the thread or process, the memory allocation is dynamically adjusted. For low-priority threads or processes, memory blocks with lower energy consumption are allocated; for high-priority threads or processes, memory blocks with higher activity are allocated.

[0029] The monitoring module dynamically monitors the activity and energy consumption of memory blocks and selects candidate memory blocks for recycling: real-time monitoring of memory usage, activity and energy consumption data, and decides whether to recycle or migrate memory blocks based on the activity and energy consumption data of memory blocks.

[0030] The recycling module dynamically adjusts memory block recycling: it puts the selected memory blocks into the candidate recycling set and performs memory recycling operations.

[0031] The evaluation module regularly evaluates energy efficiency and performance balance and obtains evaluation results.

[0032] Clean up resources at the end of the cleanup module: use the GC algorithm to recycle all remaining memory blocks, ensure that all memory is effectively recycled, and release resources.

[0033] Furthermore, the monitoring module of the memory dynamic management device based on energy consumption awareness during the running of a Java program selects and reclaims a candidate memory block, including:

[0034] Use the GC algorithm to select global memory block recovery and local memory block recovery, among which global memory block recovery: regularly monitor memory usage M g and CPU utilization U CPU ,

[0035] When the global memory usage M g >T m Or CPU utilization U CPU >T c When the global GC recovery is triggered, T m is the global recycling threshold, T c is the CPU utilization threshold,

[0036] During the global memory block recycling process, the recycling priority R of each memory block is evaluated. i , sort by priority and choose to recycle memory blocks with high energy consumption and low activity;

[0037] Perform local memory block recovery: monitor the memory usage M of each thread / process l , when M l >T l When the local GC of the thread is triggered, T i is the local recovery threshold,

[0038] During the local memory block recovery process, according to the thread priority P t and the energy consumption data and activity level of the memory blocks, and select memory blocks for recycling.

[0039] Furthermore, the monitoring module of the memory dynamic management device based on energy consumption awareness during the operation of the Java program evaluates the recycling priority R of each memory block. i ,include:

[0040] Using the following formula:

[0041] R i =α·E i +β·(1-A i )

[0042] Reclaim the memory block with priority R i Calculation, E i is the energy consumption of the memory block, A i is the activity of the memory block, and α and β are weight factors.

[0043] Furthermore, the allocation module of the energy consumption-aware dynamic memory management device during the operation of a Java program dynamically adjusts memory allocation according to the priority and activity of a thread or process, including:

[0044] Using the following formula:

[0045] S i =P t ·A i +(1-P t )·(1-E i )

[0046] Get the assigned priority S of a thread or process i , where thread or process t has an allocation priority S for memory block i i According to the thread or process priority P t 、Memory block activity A i , Energy consumption E i Obtained by calculation.

[0047] The benefits of the present invention are:

[0048] The present invention utilizes a GC algorithm combined with multi-level energy consumption optimization, and significantly improves the overall energy efficiency of the system by dynamically adjusting the allocation and recycling strategies of memory blocks. Based on the thread priority and the activity of the memory block, the GC algorithm first allocates memory blocks of different energy consumption to the thread according to its needs: low-priority threads are allocated low-energy memory blocks, while high-priority threads are allocated high-activity memory blocks, ensuring that the performance of the program is not affected while reducing unnecessary energy consumption. When the system is running, the GC algorithm continuously monitors the energy consumption and activity of the memory blocks, and preferentially recycles memory blocks with higher energy consumption and lower activity, maximizing the reduction of invalid energy consumption, thereby ensuring the maximization of the system's energy efficiency, thereby saving energy and reducing the system's carbon footprint.

[0049] The present invention utilizes a multi-level energy consumption optimization GC algorithm to ensure energy saving while guaranteeing the performance of the program. The multi-level energy consumption optimization GC algorithm dynamically adjusts memory allocation according to the thread priority and the activity level of the memory block, ensuring that the memory requirements of high-priority threads are responded to in a timely manner, and avoiding performance bottlenecks caused by insufficient resources through a dynamic recycling mechanism. Especially under high load conditions, the algorithm can accurately allocate and recycle memory according to the usage pattern and energy consumption value of the memory block, avoiding unnecessary performance consumption and memory fragmentation. When the load is low, the multi-level energy consumption optimization GC algorithm will reduce the frequency of memory recycling, thereby avoiding frequent recycling operations from having an adverse effect on program performance. The flexibility and efficiency of memory management are balanced through optimization, so that the program can work stably and efficiently in various operating scenarios.

[0050] The present invention uses a multi-level energy consumption optimization GC algorithm to achieve more intelligent and adaptive memory management. By real-time monitoring of the activity, energy consumption and usage mode of each memory block, the multi-level energy consumption optimization GC algorithm dynamically adjusts the allocation strategy of the memory block to ensure that the memory resources of each thread / process are reasonably allocated and optimally utilized. During the memory recycling process, the system automatically selects memory blocks with higher energy consumption and lower activity for recycling based on the comprehensive weight of the energy consumption value and activity level of the memory block, thereby reducing the waste of system memory and optimizing resource utilization. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] Figure 1 It is a schematic diagram of the process of initializing a memory block set in the method of the present invention.

[0052] Figure 2 It is a timing diagram for monitoring the activity and energy consumption of memory blocks.

[0053] Figure 3 It is a memory recycling selection and adjustment flowchart.

[0054] Figure 4 It is a schematic diagram of energy efficiency and performance balance evaluation. DETAILED DESCRIPTION

[0055] The present invention is further described below in conjunction with the accompanying drawings and specific embodiments so that those skilled in the art can better understand the present invention and implement it, but the embodiments are not intended to limit the present invention.

[0056] Example 1

[0057] The present invention provides a memory dynamic management method based on energy consumption perception during Java program operation, comprising:

[0058] S1 initializes a memory block set and establishes a thread / process awareness model: initializes a memory block set, allocates an independent memory management area for each thread or process, and establishes a memory usage and energy consumption model for each thread or process.

[0059] After initialization, some parameters can be recorded or preset, including:

[0060] Thread or process priority P t : The value range is [0,1], 0 is the lowest priority, 1 is the highest priority;

[0061] Memory block activity level A i : Indicates the activity level of a memory block, usually the frequency with which the memory block is accessed, normalized to [0,1];

[0062] Memory block energy consumption E i : The energy consumption of each memory block is calculated by access pattern and memory type;

[0063] Memory block usage frequency U i : The usage frequency of a memory block, that is, the number of times or time a memory block is used, is related to activity but is more accurate;

[0064] Thread or process memory requirement N t : The amount of memory required by thread or process t;

[0065] Global memory usage M g : Total usage of all memory blocks in the system;

[0066] Local memory usage M l : Local memory usage for each thread / process;

[0067] Memory recycling threshold T m : Global memory usage threshold, which determines when to trigger global GC collection;

[0068] Local GC recovery threshold T l : Memory recovery threshold for a specific thread / process, used to trigger local GC recovery;

[0069] Recycling priority threshold T r : The memory block recycling priority threshold determines which memory blocks will be recycled.

[0070] S2 uses the GC algorithm for dynamic memory allocation: it dynamically adjusts memory allocation based on the priority and activity of the thread or process. For low-priority threads or processes, memory blocks with lower energy consumption are allocated; for high-priority threads or processes, memory blocks with higher activity are allocated.

[0071] The dynamically adjusting memory allocation according to the priority and activity of the thread or process may include:

[0072] Using the following formula:

[0073] S i =P t ·A i +(1-P t )·(1-E i )

[0074] Get the assigned priority S of a thread or process i , where thread or process t has an allocation priority S for memory block i i According to the thread or process priority P t 、Memory block activity A i Energy consumption i Obtained by calculation.

[0075] S3 dynamically monitors the activity and energy consumption of memory blocks and selects candidate memory blocks for recycling: It monitors memory usage, activity, and energy consumption data in real time and decides whether to recycle or migrate memory blocks based on the activity and energy consumption data of memory blocks.

[0076] The selection of the candidate memory block for recycling may include:

[0077] Use the GC algorithm to select global memory block recovery and local memory block recovery, among which global memory block recovery: regularly monitor memory usage M g and CPU utilization U CPU ,

[0078] When the global memory usage M g >T m Or CPU utilization U CPU >T c When the global GC recovery is triggered, T m is the global recycling threshold, T c is the CPU utilization threshold,

[0079] During the global memory block recycling process, the recycling priority R of each memory block is evaluated. i , sort by priority and choose to recycle memory blocks with high energy consumption and low activity;

[0080] Perform local memory block recovery: monitor the memory usage M of each thread / process l , when M l >T l When the local GC of the thread is triggered, T i is the local recovery threshold,

[0081] During the local memory block recovery process, according to the thread priority P t and the energy consumption data and activity level of the memory blocks, and select memory blocks for recycling.

[0082] Evaluate the recycling priority R of each memory block i When

[0083] Using the following formula:

[0084] R i =α·E i +β·(1-A i )

[0085] Reclaim the memory block with priority R i Calculation, E i is the energy consumption of the memory block, A i is the activity of the memory block, and α and β are weight factors.

[0086] S4 dynamically adjusts memory block recycling: puts the selected memory blocks into the candidate recycling set and performs memory recycling operations.

[0087] S5 can regularly evaluate energy efficiency and performance balance based on recorded or preset parameters and obtain evaluation results.

[0088] Clean up resources at the end of S6: Use the GC algorithm to recycle all remaining memory blocks, ensure that all memory is effectively recycled, and release resources.

[0089] Example 2

[0090] The present invention also provides a memory dynamic management device based on energy consumption perception during Java program operation, which is characterized by comprising an initialization module, an allocation module, a monitoring module, a recycling module, an evaluation module and a cleaning module.

[0091] The initialization module initializes the memory block set and establishes a thread / process awareness model: initializes the memory block set, allocates an independent memory management area for each thread or process, and establishes a memory usage and energy consumption model for each thread or process.

[0092] The allocation module uses the GC algorithm to dynamically allocate memory: according to the priority and activity of the thread or process, the memory allocation is dynamically adjusted. For low-priority threads or processes, memory blocks with lower energy consumption are allocated; for high-priority threads or processes, memory blocks with higher activity are allocated.

[0093] The monitoring module dynamically monitors the activity and energy consumption of memory blocks and selects candidate memory blocks for recycling: real-time monitoring of memory usage, activity and energy consumption data, and decides whether to recycle or migrate memory blocks based on the activity and energy consumption data of memory blocks.

[0094] The recycling module dynamically adjusts memory block recycling: it puts the selected memory blocks into the candidate recycling set and performs memory recycling operations.

[0095] The evaluation module regularly evaluates energy efficiency and performance balance and obtains evaluation results.

[0096] Clean up resources at the end of the cleanup module: use the GC algorithm to recycle all remaining memory blocks, ensure that all memory is effectively recycled, and release resources.

[0097] It should be noted that not all steps and modules in the above-mentioned processes and device structures are necessary, and some steps or modules can be ignored according to actual needs. The execution order of each step is not fixed and can be adjusted as needed. The system structure described in the above-mentioned embodiments can be a physical structure or a logical structure, that is, some modules may be implemented by the same physical entity, or some modules may be implemented by multiple physical entities, or some components in multiple independent devices may be implemented together.

[0098] As the information interaction and execution process between the modules in the above-mentioned device are based on the same concept as the embodiment of the method of the present invention, the specific contents can be found in the description of the embodiment of the method of the present invention and will not be repeated here.

[0099] Similarly, the device of the present invention utilizes a GC algorithm combined with multi-level energy consumption optimization, and significantly improves the overall energy efficiency of the system by dynamically adjusting the allocation and recovery strategies of memory blocks. Based on the thread priority and the activity of the memory block, the GC algorithm first allocates memory blocks of different energy consumption to the thread according to its needs: low-priority threads are allocated low-energy memory blocks, while high-priority threads are allocated high-activity memory blocks, ensuring that the performance of the program is not affected while reducing unnecessary energy consumption. When the system is running, the GC algorithm continuously monitors the energy consumption and activity of the memory blocks, and preferentially recycles memory blocks with higher energy consumption and lower activity, maximizing the reduction of invalid energy consumption, thereby ensuring the maximization of the system's energy efficiency, thereby saving energy and reducing the system's carbon footprint.

[0100] The device of the present invention utilizes a multi-level energy consumption optimization GC algorithm to ensure energy saving while guaranteeing the performance of the program. The multi-level energy consumption optimization GC algorithm dynamically adjusts memory allocation according to the thread priority and the activity level of the memory block, ensuring that the memory requirements of high-priority threads are responded to in a timely manner, and avoiding performance bottlenecks caused by insufficient resources through a dynamic recycling mechanism. Especially under high load conditions, the algorithm can accurately allocate and recycle memory according to the usage pattern and energy consumption value of the memory block, avoiding unnecessary performance consumption and memory fragmentation. When the load is low, the multi-level energy consumption optimization GC algorithm will reduce the frequency of memory recycling, thereby avoiding frequent recycling operations from having an adverse effect on program performance. The flexibility and efficiency of memory management are balanced through optimization, so that the program can work stably and efficiently in various operating scenarios.

[0101] The device of the present invention uses a multi-level energy consumption optimization GC algorithm to achieve more intelligent and adaptive memory management. By real-time monitoring of the activity, energy consumption and usage mode of each memory block, the multi-level energy consumption optimization GC algorithm dynamically adjusts the allocation strategy of the memory block to ensure that the memory resources of each thread / process are reasonably allocated and optimally utilized. During the memory recycling process, the system automatically selects memory blocks with higher energy consumption and lower activity for recycling based on the comprehensive weight of the energy consumption value and activity level of the memory block, thereby reducing the waste of system memory and optimizing resource utilization.

[0102] It should be noted that not all steps and modules in the above-mentioned processes and device structures are necessary, and some steps or modules can be ignored according to actual needs. The execution order of each step is not fixed and can be adjusted as needed. The system structure described in the above-mentioned embodiments can be a physical structure or a logical structure, that is, some modules may be implemented by the same physical entity, or some modules may be implemented by multiple physical entities, or some components in multiple independent devices may be implemented together.

[0103] The above-described embodiments are only preferred embodiments for fully illustrating the present invention, and the protection scope of the present invention is not limited thereto. Equivalent substitutions or changes made by those skilled in the art based on the present invention are within the protection scope of the present invention. The protection scope of the present invention shall be subject to the claims.

Claims

1. A method for dynamic memory management based on energy consumption awareness during Java program operation, characterized in that include: S1 initializes a memory block set and establishes a thread / process awareness model: Initializes a memory block set, allocates an independent memory management area for each thread or process, and establishes a memory usage and energy consumption model for each thread or process. S2 uses the GC algorithm to dynamically allocate memory: it dynamically adjusts memory allocation based on the priority and activity of threads or processes. For low-priority threads or processes, it allocates memory blocks with lower energy consumption; for high-priority threads or processes, it allocates memory blocks with higher activity. S3 dynamically monitors the activity and energy consumption of memory blocks and selects candidate memory blocks for recycling: It monitors memory usage, activity, and energy consumption data in real time and decides whether to recycle or migrate memory blocks based on the activity and energy consumption data of memory blocks. S4 dynamically adjusts memory block recycling: puts the selected memory blocks into the candidate recycling set and performs memory recycling operations. S5 regularly evaluates energy efficiency and performance balance and obtains evaluation results. Clean up resources at the end of S6: Use the GC algorithm to recycle all remaining memory blocks, ensure that all memory is effectively recycled, and release resources.

2. According to the method for dynamic memory management based on energy consumption awareness in the running of a Java program in claim 1, the method is characterized in that the step of selecting a candidate memory block for recycling in S3 comprises: Use the GC algorithm to select global memory block recovery and local memory block recovery, among which global memory block recovery: regularly monitor memory usage M g and CPU utilization U CPU , When the global memory usage M g >T m Or CPU utilization U CPU >T c When the global GC recovery is triggered, T m is the global recycling threshold, T c is the CPU utilization threshold, During the global memory block recycling process, the recycling priority R of each memory block is evaluated. i , sort by priority and choose to recycle memory blocks with high energy consumption and low activity; Perform local memory block recovery: monitor the memory usage M of each thread / process l , when M l >T l When the local GC of the thread is triggered, T i is the local recovery threshold, During the local memory block recovery process, according to the thread priority P t and the energy consumption data and activity level of the memory blocks, and select memory blocks for recycling.

3. According to claim 2, a method for dynamic memory management based on energy consumption awareness during Java program operation, characterized in that The evaluation of the recycling priority R of each memory block i ,include: Using the following formula: R i =α·E i +β·(1-A i ) Reclaim the memory block with priority R i Calculation, E i is the energy consumption of the memory block, A i is the activity of the memory block, and α and β are weight factors.

4. According to claim 1, a method for dynamic memory management based on energy consumption awareness in Java program operation, characterized in that S2 dynamically adjusts memory allocation according to the priority and activity of the thread or process, including: Using the following formula: S i =P t ·A i +(1-P t )·(1-E i ) Get the assigned priority S of a thread or process i , where thread or process t has an allocation priority S for memory block i i According to the thread or process priority P t 、Memory block activity A i , Energy consumption E i Obtained by calculation.

5. A memory dynamic management device based on energy consumption perception during Java program operation, characterized in that It includes initialization module, allocation module, monitoring module, recycling module, evaluation module and cleaning module. The initialization module initializes the memory block set and establishes a thread / process awareness model: initializes the memory block set, allocates an independent memory management area for each thread or process, and establishes a memory usage and energy consumption model for each thread or process. The allocation module uses the GC algorithm to dynamically allocate memory: according to the priority and activity of the thread or process, the memory allocation is dynamically adjusted. For low-priority threads or processes, memory blocks with lower energy consumption are allocated; for high-priority threads or processes, memory blocks with higher activity are allocated. The monitoring module dynamically monitors the activity and energy consumption of memory blocks and selects candidate memory blocks for recycling: real-time monitoring of memory usage, activity and energy consumption data, and decides whether to recycle or migrate memory blocks based on the activity and energy consumption data of memory blocks. The recycling module dynamically adjusts memory block recycling: it puts the selected memory blocks into the candidate recycling set and performs memory recycling operations. The evaluation module regularly evaluates energy efficiency and performance balance and obtains evaluation results. Clean up resources at the end of the cleanup module: use the GC algorithm to recycle all remaining memory blocks, ensure that all memory is effectively recycled, and release resources.

6. The device for dynamic memory management based on energy consumption awareness during Java program operation according to claim 5, characterized in that The monitoring module selects candidate memory blocks for recycling, including: Use the GC algorithm to select global memory block recovery and local memory block recovery, among which global memory block recovery: regularly monitor memory usage M g and CPU utilization U CPU , When the global memory usage M g >T m Or CPU utilization U CPU >T c When the global GC recovery is triggered, T m is the global recycling threshold, T c is the CPU utilization threshold, During the global memory block recycling process, the recycling priority R of each memory block is evaluated. i , sort by priority and choose to recycle memory blocks with high energy consumption and low activity; Perform local memory block recovery: monitor the memory usage M of each thread / process l , when M l >T l When the local GC of the thread is triggered, T i is the local recovery threshold, During the local memory block recovery process, according to the thread priority P t and the energy consumption data and activity level of the memory blocks, and select memory blocks for recycling.

7. The device for dynamic memory management based on energy consumption awareness during Java program operation according to claim 6, characterized in that The monitoring module evaluates the recycling priority R of each memory block. i ,include: Using the following formula: R i =α·E i +β·(1-A i ) Reclaim the memory block with priority R i Calculation, E i is the energy consumption of the memory block, A i is the activity of the memory block, and α and β are weight factors.

8. The device for dynamic memory management based on energy consumption awareness during Java program operation according to claim 5, characterized in that The allocation module dynamically adjusts memory allocation based on the priority and activity of threads or processes, including: Using the following formula: S i =P t ·A i +(1-P t )·(1-E i ) Get the assigned priority S of a thread or process i , where thread or process t has an allocation priority S for memory block i i According to the thread or process priority P t 、Memory block activity A i , Energy consumption E i Obtained by calculation.

Citation Information

Cited By

  • Container recovery method and system based on dynamic priority

    CN120821532A