CN111158913A - Management method, management device, electronic equipment and storage medium - Google Patents

Management method, management device, electronic equipment and storage medium Download PDF

Info

Publication number
CN111158913A
CN111158913A CN201911398711.8A CN201911398711A CN111158913A CN 111158913 A CN111158913 A CN 111158913A CN 201911398711 A CN201911398711 A CN 201911398711A CN 111158913 A CN111158913 A CN 111158913A
Authority
CN
China
Prior art keywords
memory
application
function
condition
service list
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201911398711.8A
Other languages
Chinese (zh)
Inventor
刘晓军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Lenovo Beijing Ltd
Original Assignee
Lenovo Beijing Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Lenovo Beijing Ltd filed Critical Lenovo Beijing Ltd
Priority to CN201911398711.8A priority Critical patent/CN111158913A/en
Publication of CN111158913A publication Critical patent/CN111158913A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5022Mechanisms to release resources
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • G06F9/4406Loading of operating system

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

The embodiment of the application discloses a management method, which comprises the following steps: when a first system of the electronic equipment meets a first condition, applying for a first memory for a first application; when the first system meets a second condition, releasing the first memory; the electronic equipment is provided with a second system, the first system is a system capable of guiding the second system to start, the second system is an operating system of the electronic equipment, and the first system and the second system are different. The embodiment of the application also discloses a management device, electronic equipment and a storage medium.

Description

Management method, management device, electronic equipment and storage medium
Technical Field
The present application relates to, but not limited to, the field of computer technologies, and in particular, to a management method, a management apparatus, an electronic device, and a storage medium.
Background
Memory Leak (Memory Leak) refers to a serious consequence that a program running speed is slowed down or a system is crashed and the like because a program of a dynamically allocated heap Memory in the program is not released or can not be released due to some reason, so that waste of a system Memory is caused. In the related art, too many memory leaks may cause a large amount of fragments in the system, thereby causing the system to fail to boot.
Content of application
The technical scheme of the application is realized as follows:
a method of management, comprising:
when a first system of the electronic equipment meets a first condition, applying for a first memory for a first application;
when a second condition is met, the first system releases the first memory;
wherein the electronic device has a second system, the first system is a system capable of booting the second system, wherein the second system is an operating system of the electronic device, and the first system and the second system are different.
Optionally, when the first system of the electronic device satisfies the first condition, applying for the first memory for the first application includes:
when the first system meets the first condition, calling a first memory allocation function based on a first starting service list of the first system, and applying for a second memory for the first application from the memory to be allocated of the first system; the physical addresses of the second memory are continuous, and the memory size of the second memory is larger than that of the first memory;
applying different sub memories for different sub applications of the first application from the second memory; the first memory includes the different sub-memories.
Optionally, the method further includes:
obtaining a second boot service list of the first system, wherein the second boot service list comprises a first function pointer pointing to a second memory allocation function and a second function pointer pointing to a second memory release function;
obtaining an update operation for the second boot service list;
updating the second starting service list to obtain the first starting service list based on the updating operation; the first boot service list comprises a third function pointer pointing to a first memory allocation function and a fourth function pointer pointing to a first memory release function; the first memory allocation function is used for applying for the second memory, and the second memory release function is used for releasing the second memory.
Optionally, the method further includes: when the first system meets the first condition, calling a first memory allocation function based on a first starting service list of the first system, and applying for a second memory for the first application from the memory to be allocated of the first system, wherein the method comprises the following steps:
when the first condition is met, the first system obtains the third function pointer from the first starting service list;
and calling the first memory allocation function based on the third function pointer, and applying for the second memory for the first application from the memory to be allocated of the first system.
Optionally, the applying for different sub-memories from the second memory for different sub-applications of the first application includes:
and calling the first memory allocation function based on the third function pointer, and applying for different sub-memories from the second memory for different sub-applications of the first application.
Optionally, when a second condition is satisfied, the first system releases the first memory, including:
when the second condition is met, the first system obtains the fourth function pointer from the first start-up service list;
and calling the first memory release function based on the fourth function pointer to release the second memory.
Optionally, the first condition includes the first application starting;
and/or the second condition comprises that the first application closes or calls a memory release function.
A management device, comprising:
the first processing unit is used for applying for a first memory for a first application when a first system of the electronic equipment meets a first condition;
the second processing unit is used for releasing the first memory when the first system meets a second condition;
wherein the electronic device has a second system, the first system is a system capable of booting the second system, wherein the second system is an operating system of the electronic device, and the first system and the second system are different.
An electronic device, the electronic device comprising: a processor, a memory, and a communication bus;
the communication bus is used for realizing communication connection between the processor and the memory;
the processor is adapted to execute the program of the management method stored in the memory to implement the steps of the management method as described above.
A storage medium storing one or more programs executable by one or more processors to implement the steps of the above-described management method.
According to the management method, the management device, the electronic device and the storage medium provided by the embodiment of the application, when a first system of the electronic device meets a first condition, a first memory is applied for a first application; when the first system meets a second condition, releasing the first memory; the electronic equipment is provided with a second system, the first system is a system capable of guiding the second system to start, the second system is an operating system of the electronic equipment, and the first system and the second system are different; therefore, after the first system for guiding the starting of the operating system of the electronic equipment applies for the first memory for the first application, the first memory is released in time at one time when the second condition is met, so that the problem that a large amount of fragments are generated due to the fact that the memory is not released in time and the memory leaks in the related art is solved, the stability of the operating system is maintained, and the normal starting of the operating system is ensured.
Drawings
Fig. 1 is a schematic flow chart of a management method according to an embodiment of the present application;
fig. 2 is a schematic flow chart of another management method provided in the embodiment of the present application;
fig. 3 is a schematic flow chart of another management method provided by an embodiment of the present application;
fig. 4 is a schematic flowchart of updating a start service list according to an embodiment of the present application;
FIG. 5 is a schematic illustration of an interface for management provided by an embodiment of the present application;
fig. 6 is a schematic diagram of an association relationship between a new bootservicesttable and an original bootservicesttable provided in an embodiment of the present application;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application.
An embodiment of the present application provides a management method, which is applied to an electronic device, and as shown in fig. 1, the management method includes the following steps:
step 101, when a first system of the electronic device meets a first condition, applying for a first memory for a first application.
And 102, releasing the first memory by the first system when a second condition is met.
The electronic equipment is provided with a second system, the first system is a system capable of guiding the second system to start, the second system is an operating system of the electronic equipment, and the first system and the second system are different.
In an implementation manner, when the first system of the electronic device meets a first condition, applying for a first memory for a first application of the first system; when the second system of the electronic device meets the second condition, the first memory applied by the first application is released, that is, the electronic device implements the above management on the memory of the first system based on the current function of the first system, thereby not only avoiding memory leakage but also ensuring normal start of the second system.
In this embodiment, in another implementation manner, the electronic device may further perform firmware upgrade on the firmware system, so as to ensure that the upgraded firmware system has the above-mentioned functions, so as to implement the above-mentioned management on the memory of the first system, avoid memory leakage, and ensure that the second system is normally started. That is, the electronic device may also perform firmware upgrade on the original firmware system, so as to improve the original firmware system into the first system having the above functions. Here, the electronic device may upgrade the firmware system by replacing or updating the boot service list.
In some embodiments, the first condition includes a condition for applying for memory for the first application, and further, the first condition includes a first application launch. Here, the first application launch may occur when the electronic device is initially launched or when the electronic device is restarted. Of course, the first application start may also occur during the running process after the electronic device is successfully started, by obtaining a trigger event for starting the first application, and starting the first application based on the trigger event. For example, the trigger event may be a touch operation for an icon of the first application.
In the embodiment of the application, when the electronic device determines that the first application is started through the first system, the first system applies for the first memory to the first application, and then data associated with the first application is stored in the first memory.
In this embodiment, the first System is a Firmware System, and the Firmware System includes a fixed electronic device such as a Basic Input Output System (BIOS) of a Personal Computer (PC), a Unified Extensible Firmware Interface System (UEFI), an Extensible Firmware Interface System (EFI), and a Bootloader System for starting a mobile electronic device such as a mobile phone.
Illustratively, when the firmware system is UEFI, most codes in the UEFI are written in C language, and UEFI applications and drivers can even be written in C + +. The UEFI shields bottom hardware details for an Operating System (OS) and an OS loader through firmware-Operating System interfaces (BS, RT), so that UEFI upper layer applications can be reused conveniently. Compared with the traditional BIOS, UEFI is greatly improved, and the time from starting to entering the operating system is greatly shortened.
In some embodiments, the second condition comprises the first application closing or calling a memory release function.
In the embodiment of the application, when the electronic device determines that the first application is closed or the memory release function is called through the first system, the first memory is released in time; therefore, the problem that a large amount of fragments are generated due to the fact that the memory is not released in time and the memory leaks is solved.
It should be noted that, in the embodiment of the present application, when the electronic device applies for the memory through the first system, the adopted policy is referred to as a first policy; when the electronic equipment applies for the memory through the second system, the adopted strategy is called as a second strategy; that is to say, in the embodiment of the present application, for an electronic device having a first system and a second system, the memory is managed by using different policies under two memory management systems.
In addition, the first system of the electronic device, namely the firmware system, in the embodiment of the application has the first application, so that the complexity of the firmware system is improved, and further, in the process of guiding the start of the second system by using the first system, the memory of the electronic device is managed by using a two-layer memory management system, so that the normal start of the second system is ensured; however, the electronic device in the related art can boot up only one system to another system even if there are two systems, and manage the memory through the same management policy.
According to the management method provided by the embodiment of the application, when a first system of the electronic equipment meets a first condition, a first memory is applied for a first application; when the first system meets a second condition, releasing the first memory; the electronic equipment is provided with a second system, the first system is a system capable of guiding the second system to start, the second system is an operating system of the electronic equipment, and the first system and the second system are different; therefore, after the first system for guiding the starting of the operating system of the electronic equipment applies for the first memory for the first application, the first memory is released in time at one time when the second condition is met, so that the problem that a large amount of fragments are generated due to the fact that the memory is not released in time and the memory leaks in the related art is solved, the stability of the operating system is maintained, and the normal starting of the operating system is ensured.
An embodiment of the present application provides a management method, applied to an electronic device, and as shown in fig. 2, the method includes the following steps:
step 201, when the first system meets the first condition, a first memory allocation function is called based on the first start service list of the first system, and a second memory is applied for the first application from the memory to be allocated of the first system.
The physical addresses of the second memory are continuous, and the memory size of the second memory is larger than that of the first memory.
In this embodiment, when the electronic device determines that a first condition is met through the first system, for example, when the first application is started, the electronic device calls a first memory allocation function based on a first start service list of the first system, and applies for a second memory with continuous physical addresses from a to-be-allocated memory of the first system to the first application. The starting service list is used for managing system resources of the first system, the starting service list comprises a first starting service list, and a function pointer corresponding to the first memory allocation function is stored in the first starting service list. When the electronic device calls the first memory allocation function based on the first start service list of the first system, the electronic device may find a function pointer corresponding to the first memory allocation function based on the first start service list, and then call the function pointer to point to the first memory allocation function, and implement that the function is to apply for a second memory from a memory to be allocated of the first system to the first application.
Step 202, different sub memories are applied for different sub applications of the first application from the second memory.
The first memory includes different sub memories.
In the embodiment of the application, the electronic device firstly applies a second memory to the first application from the memory to be allocated of the first system, and secondly applies different sub-memories to different sub-applications of the first application from the second memory; that is to say, for the first application, when the first application has a demand for applying for the memory, the electronic device allocates a large block of memory with continuous physical addresses, i.e. a second memory, for the first application from the to-be-allocated memory of the first system through the first system, and then allocates required small blocks of memory for different sub-applications from the large block of memory when different sub-applications of the first application have different memory demands.
For example, when the electronic device determines that the first sub-application of the first application has a memory requirement of 2M through the first system, first, a large block of memory with continuous physical addresses, such as a memory of 64M, is allocated to the first application from a to-be-allocated memory of the first system; secondly, 2M is distributed to the first sub-application from a 64M memory; then, when the electronic device determines that the second sub-application of the first application has a memory requirement of 1M through the first system, 1M is allocated to the second sub-application from the remaining 62M memory; then, different sub memories are allocated to different sub applications of the first application in a similar manner. Here, the physical addresses of the different sub-memories allocated to the different sub-applications of the first application may be consecutive, thus ensuring reasonable utilization of the memory and avoiding memory waste.
And step 203, releasing the first memory by the first system when the second condition is met.
The electronic equipment is provided with a second system, the first system is a system capable of guiding the second system to start, the second system is an operating system of the electronic equipment, and the first system and the second system are different.
In the embodiment of the application, when the electronic device determines that the second condition is met through the first system, for example, when the first application is closed, the electronic device calls the second memory release function based on the first start-up service list of the first system, and releases the second memory to further release the first memory. When the electronic device calls the second memory release function based on the first start service list of the first system, the electronic device can find a function pointer corresponding to the second memory release function based on the first start service list, and then call the function pointer to point to the second memory release function, and realize the function of the function, namely release the second memory from the to-be-allocated memory of the first system, so that the occupation of the memory of the first system is timely removed, and a allocable memory space is provided for other application memories or the first application memory application memories again.
It should be noted that, for the descriptions of the same steps and the same contents in this embodiment as those in other embodiments, reference may be made to the descriptions in other embodiments, which are not described herein again.
An embodiment of the present application provides a management method, applied to an electronic device, and as shown in fig. 3, the method includes the following steps:
step 301, obtain a second start-up service list of the first system.
Wherein the second boot service list includes a first function pointer to a second memory allocation function and a second function pointer to a second memory release function.
Here, the second boot service list may be understood as an original list of system resources for managing the first system. The second boot service list may include not only the above-described first function pointer pointing to the second memory allocation function and the second function pointer pointing to the second memory release function, but also a function pointer of an allocation page, a function pointer of a release page, and a function pointer of a management memory map.
Step 302, obtain an update operation for the second boot service list.
In the embodiment of the present application, the update operation for the second start-up service list is used to update the second start-up service list to obtain the first start-up service list.
Step 303, updating the second start service list to obtain the first start service list based on the updating operation.
The first starting service list comprises a third function pointer pointing to the first memory allocation function and a fourth function pointer pointing to the first memory release function; the first memory allocation function is used for applying for a second memory, and the second memory release function is used for releasing the second memory. Here, the first boot service list may include not only the above-described third function pointer pointing to the first memory allocation function and fourth function pointer pointing to the first memory release function, but also a function pointer of an allocation page in the second boot service list, a function pointer of a release page, and a function pointer of a management memory map.
In the embodiment of the application, the electronic device updates the second start-up service list to obtain the first start-up service list through the first system based on the updating operation, and the first start-up service list can be understood as a new list of system resources for managing the first system.
In some embodiments, taking the first system as UEFI as an example, the system table of UEFI is a global structure of UEFI kernel, and the system table pointer is passed to the user space as a parameter of the program image entry function. The system table is one of important data interfaces, and is a channel from the user space to the kernel space. The system table may be divided into six sections: the system comprises a header, firmware information, a standard input console, a standard output console, a standard error console, a start service table, a run-time service table and a system configuration table. UEFI accesses system tables in user space using global variables (gST). gST is a variable defined in user space and the system table to which it points is defined in the UEFI kernel. Referring to fig. 4, after the uefibootservices tablelib is referred to in the application program, gST can be used to access the system table, and gST and gBS are used to replace BootServices corresponding to the systemletable and the systemletable, so as to update the original BootServices. BootServices are the core data structure of UEFI, and can be classified into the following categories: UEFI event service, memory management service, Protocol usage class service, drive management service, Image management service, ExitBootServices, and other services. The start service is composed of UEFI header and entries, each entry in the table is a function pointer, and the function is used to provide a service.
It should be noted that, in the process of updating the original BootServices, two memory management function pointers in the dashed box 41 are replaced, and other function pointers in the original BootServices are retained, that is, no modification is made to them. For the type EfiBootServiceData, the allocatePool/allocateAgents are linked to the MemList of the new BootServiceTable after applying for a sufficiently large memory block by using the function pointed by the function pointer in the original BootServiceTable. Other memory types, do only forward. If the FreePool/FreePages is in the linked list of the MemHeader, deleting the node from the linked list MemList, and then deleting the memory, otherwise, only forwarding. GetMemoryMap does only forward.
Referring to fig. 5, the new bootservicesttable stores a pointer pointing to the original bootservicesttable, and is used for applying for a memory block from the UEFI system, and a list header of the memory block applied by the application program. Except for memory management, for all other BootServiceTable functions, the new BootServiceTable internal function pointers are only forwarded and are all function pointers in the original BootServiceTable. Here, 51, 52 and 53 are the chain table headers of the memories applied by the three sub-applications in the first application, and correspond to the start addresses of the different sub-memories.
Step 304, when the first system meets the first condition, a first memory allocation function is called based on the first start service list of the first system, and a second memory is applied for the first application from the memory to be allocated of the first system.
The physical addresses of the second memory are continuous, and the memory size of the second memory is larger than that of the first memory.
In this embodiment of the application, when the first system in step 304 meets the first condition, the first system calls the first memory allocation function based on the first boot service list of the first system, and applies for the second memory from the to-be-allocated memory of the first system to the first application, which may be implemented by the following steps:
step 304a, the first system obtains a third function pointer from the first start-up service list when the first condition is satisfied.
Step 304b, calling the first memory allocation function based on the third function pointer, and applying for a second memory for the first application from the memory to be allocated of the first system.
Here, the third function pointer points to the start address of the second memory. When the electronic equipment determines that a first condition is met through the first system, a third function pointer is obtained from the first starting service list, then a first memory allocation function is called based on the third function pointer, a second memory is applied to the first application from a position corresponding to the starting address of the second memory in the memory to be allocated of the first system, and a large block of memory with continuous physical addresses is obtained.
Step 305, apply for different sub-memories from the second memory for different sub-applications of the first application.
The first memory includes different sub memories.
In this embodiment of the application, the step 305 applies for different sub memories from the second memory to different sub applications of the first application, and may be implemented by the following steps:
and calling the first memory allocation function based on the third function pointer, and applying for different sub memories from the second memory to different sub applications of the first application.
And step 306, when the first system meets the second condition, obtaining a fourth function pointer from the first start service list.
Step 307, the first memory release function is called based on the fourth function pointer, and the second memory is released.
Here, the fourth function pointer points to the start address of the second memory. When the electronic equipment determines that a second condition is met through the first system, a fourth function pointer is obtained from the first starting service list, then the first memory release function is called based on the fourth function pointer, the second memory is released from a position corresponding to the starting address of the second memory, and the whole large-block memory with continuous physical addresses of the second memory is released at one time.
As can be seen from the above, the management method provided in the embodiment of the present application implements management of the memory of the first system by replacing the boot services table to start the service list, instead of the hook allocate pool/allocate functions. Aiming at the problem of memory leakage, all unreleased memories can be released uniformly when the application program exits through applying for the released unique interface function by the hook memory. Aiming at the fragmentation problem, in the hook memory application release function, when a memory is applied to a system, a large memory block can be applied at a time, so that the problem of causing the memory fragmentation of a UEFI system level is avoided; and the stability of the operating system is further maintained, and the normal starting of the operating system is ensured.
It should be noted that, for the descriptions of the same steps and the same contents in this embodiment as those in other embodiments, reference may be made to the descriptions in other embodiments, which are not described herein again.
An embodiment of the present application provides a management device, which can be applied to a management method provided in the embodiment corresponding to fig. 1 to 3, and as shown in fig. 6, the management device 6 includes:
the first processing unit 61 is configured to apply for a first memory to a first application when a first system of the electronic device meets a first condition;
the second processing unit 62 is used for releasing the first memory when the first system meets a second condition;
the electronic equipment is provided with a second system, the first system is a system capable of guiding the second system to start, the second system is an operating system of the electronic equipment, and the first system and the second system are different.
In other embodiments of the present application, the first processing unit 61 is configured to, when the first system meets the first condition, call a first memory allocation function based on a first boot service list of the first system, and apply for a second memory for the first application from a to-be-allocated memory of the first system; the physical addresses of the second memory are continuous, and the memory size of the second memory is larger than that of the first memory;
applying different sub memories for different sub applications of the first application from the second memory; the first memory includes different sub memories.
In other embodiments of the present application, the management apparatus 6 further includes:
an obtaining unit, configured to obtain a second boot service list of the first system, where the second boot service list includes a first function pointer pointing to a second memory allocation function and a second function pointer pointing to a second memory release function; obtaining an update operation for the second boot service list;
the updating unit is used for updating the second starting service list to obtain a first starting service list based on the updating operation; the first boot service list includes a third function pointer pointing to the first memory allocation function and a fourth function pointer pointing to the first memory release function; the first memory allocation function is used for applying for a second memory, and the second memory release function is used for releasing the second memory.
In other embodiments of the present application, the first processing unit 61 is configured to, when the first condition is met, the first system obtains a third function pointer from the first start-up service list;
and calling a first memory allocation function based on the third function pointer, and applying for a second memory for the first application from the memory to be allocated of the first system.
In other embodiments of the present application, the first processing unit 61 is configured to invoke the first memory allocation function based on the third function pointer, and apply for different sub memories from the second memory to different sub applications of the first application.
In other embodiments of the present application, the second processing unit 62 is configured to, when the second condition is met, the first system obtains a fourth function pointer from the first start-up service list;
and calling the first memory release function based on the fourth function pointer, and releasing the second memory.
In other embodiments of the present application, the first condition comprises a first application launch;
and/or the second condition comprises the first application closing or calling a memory release function.
It should be noted that, in this embodiment, specific implementation processes of steps executed by each unit may refer to implementation processes in the management method provided in the embodiments corresponding to fig. 1 to 3, and are not described herein again.
An embodiment of the present application provides an electronic device, which may be applied to a management method provided in the embodiment corresponding to fig. 1 to 3, and as shown in fig. 7, the electronic device 7 (the electronic device 7 in fig. 7 corresponds to the management apparatus 6 in fig. 6) includes: a processor 71, a memory 72, and a communication bus 73, wherein:
the communication bus 73 is used to realize a communication connection between the processor 71 and the memory 72.
Processor 71 is configured to execute the hypervisor stored in memory 72 to implement the steps of:
when a first system of the electronic equipment meets a first condition, applying for a first memory for a first application;
when the first system meets a second condition, releasing the first memory;
the electronic equipment is provided with a second system, the first system is a system capable of guiding the second system to start, the second system is an operating system of the electronic equipment, and the first system and the second system are different.
In other embodiments of the present application, processor 71 is configured to execute a hypervisor stored in memory 72 to perform the steps of:
when the first system meets a first condition, calling a first memory allocation function based on a first starting service list of the first system, and applying for a second memory for a first application from a memory to be allocated of the first system; the physical addresses of the second memory are continuous, and the memory size of the second memory is larger than that of the first memory;
applying different sub memories for different sub applications of the first application from the second memory; the first memory includes different sub memories.
In other embodiments of the present application, processor 71 is configured to execute a hypervisor stored in memory 72 to perform the steps of:
obtaining a second starting service list of the first system, wherein the second starting service list comprises a first function pointer pointing to a second memory allocation function and a second function pointer pointing to a second memory release function;
obtaining an update operation for the second boot service list;
updating the second starting service list to obtain a first starting service list based on the updating operation; the first boot service list includes a third function pointer pointing to the first memory allocation function and a fourth function pointer pointing to the first memory release function; the first memory allocation function is used for applying for a second memory, and the second memory release function is used for releasing the second memory.
In other embodiments of the present application, processor 71 is configured to execute a hypervisor stored in memory 72 to perform the steps of:
when the first system meets the first condition, obtaining a third function pointer from the first starting service list;
and calling a first memory allocation function based on the third function pointer, and applying for a second memory for the first application from the memory to be allocated of the first system.
In other embodiments of the present application, processor 71 is configured to execute a hypervisor stored in memory 72 to perform the steps of:
and calling the first memory allocation function based on the third function pointer, and applying for different sub memories from the second memory to different sub applications of the first application.
When the first system meets a second condition, obtaining a fourth function pointer from the first starting service list;
and calling the first memory release function based on the fourth function pointer, and releasing the second memory.
In other embodiments of the present application, the first condition comprises a first application launch;
and/or the second condition comprises the first application closing or calling a memory release function.
It should be noted that, for a specific implementation process of the steps executed by the processor in this embodiment, reference may be made to the implementation process in the management method provided in the embodiments corresponding to fig. 1 to 3, and details are not described here.
Based on the foregoing embodiments, embodiments of the application provide a computer-readable storage medium storing one or more programs, the one or more programs being executable by one or more processors to implement the steps of:
when a first system of the electronic equipment meets a first condition, applying for a first memory for a first application;
when the first system meets a second condition, releasing the first memory;
the electronic equipment is provided with a second system, the first system is a system capable of guiding the second system to start, the second system is an operating system of the electronic equipment, and the first system and the second system are different.
In other embodiments of the present application, the one or more programs are executable by the one or more processors and further implement the steps of:
when the first system meets a first condition, calling a first memory allocation function based on a first starting service list of the first system, and applying for a second memory for a first application from a memory to be allocated of the first system; the physical addresses of the second memory are continuous, and the memory size of the second memory is larger than that of the first memory;
applying different sub memories for different sub applications of the first application from the second memory; the first memory includes different sub memories.
In other embodiments of the present application, the one or more programs are executable by the one or more processors and further implement the steps of:
obtaining a second starting service list of the first system, wherein the second starting service list comprises a first function pointer pointing to a second memory allocation function and a second function pointer pointing to a second memory release function;
obtaining an update operation for the second boot service list;
updating the second starting service list to obtain a first starting service list based on the updating operation; the first boot service list includes a third function pointer pointing to the first memory allocation function and a fourth function pointer pointing to the first memory release function; the first memory allocation function is used for applying for a second memory, and the second memory release function is used for releasing the second memory.
In other embodiments of the present application, the one or more programs are executable by the one or more processors and further implement the steps of:
when the first system meets the first condition, obtaining a third function pointer from the first starting service list;
and calling a first memory allocation function based on the third function pointer, and applying for a second memory for the first application from the memory to be allocated of the first system.
In other embodiments of the present application, the one or more programs are executable by the one or more processors and further implement the steps of:
and calling the first memory allocation function based on the third function pointer, and applying for different sub memories from the second memory to different sub applications of the first application.
In other embodiments of the present application, the one or more programs are executable by the one or more processors and further implement the steps of:
when the first system meets a second condition, obtaining a fourth function pointer from the first starting service list;
and calling the first memory release function based on the fourth function pointer, and releasing the second memory.
In other embodiments of the present application, the first condition comprises a first application launch;
and/or the second condition comprises the first application closing or calling a memory release function.
It should be noted that, for a specific implementation process of the steps executed by the processor in this embodiment, reference may be made to the implementation process in the management method provided in the embodiments corresponding to fig. 1 to 3, and details are not described here.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of a hardware embodiment, a software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The above description is only a preferred embodiment of the present application, and is not intended to limit the scope of the present application.

Claims (10)

1. A method of management, comprising:
when a first system of the electronic equipment meets a first condition, applying for a first memory for a first application;
when a second condition is met, the first system releases the first memory;
wherein the electronic device has a second system, the first system is a system capable of booting the second system, wherein the second system is an operating system of the electronic device, and the first system and the second system are different.
2. The method of claim 1, wherein the first system of the electronic device applying for the first memory for the first application when the first condition is satisfied comprises:
when the first system meets the first condition, calling a first memory allocation function based on a first starting service list of the first system, and applying for a second memory for the first application from the memory to be allocated of the first system; the physical addresses of the second memory are continuous, and the memory size of the second memory is larger than that of the first memory;
applying different sub memories for different sub applications of the first application from the second memory; the first memory includes the different sub-memories.
3. The method of claim 2, further comprising:
obtaining a second boot service list of the first system, wherein the second boot service list comprises a first function pointer pointing to a second memory allocation function and a second function pointer pointing to a second memory release function;
obtaining an update operation for the second boot service list;
updating the second starting service list to obtain the first starting service list based on the updating operation; the first boot service list comprises a third function pointer pointing to a first memory allocation function and a fourth function pointer pointing to a first memory release function; the first memory allocation function is used for applying for the second memory, and the second memory release function is used for releasing the second memory.
4. The method of claim 3, further comprising: when the first system meets the first condition, calling a first memory allocation function based on a first starting service list of the first system, and applying for a second memory for the first application from the memory to be allocated of the first system, wherein the method comprises the following steps:
when the first condition is met, the first system obtains the third function pointer from the first starting service list;
and calling the first memory allocation function based on the third function pointer, and applying for the second memory for the first application from the memory to be allocated of the first system.
5. The method of claim 3, wherein said applying for different sub-memories from said second memory for different sub-applications of said first application comprises:
and calling the first memory allocation function based on the third function pointer, and applying for different sub-memories from the second memory for different sub-applications of the first application.
6. The method of any of claims 3 to 5, the first system releasing the first memory when a second condition is satisfied, comprising:
when the second condition is met, the first system obtains the fourth function pointer from the first start-up service list;
and calling the first memory release function based on the fourth function pointer to release the second memory.
7. The method of any of claims 1-6, the first condition comprising the first application launching;
and/or the second condition comprises that the first application closes or calls a memory release function.
8. A management device, comprising:
the first processing unit is used for applying for a first memory for a first application when a first system of the electronic equipment meets a first condition;
the second processing unit is used for releasing the first memory when the first system meets a second condition;
wherein the electronic device has a second system, the first system is a system capable of booting the second system, wherein the second system is an operating system of the electronic device, and the first system and the second system are different.
9. An electronic device, the electronic device comprising: a processor, a memory, and a communication bus;
the communication bus is used for realizing communication connection between the processor and the memory;
the processor is adapted to execute a program of a management method stored in the memory to implement the steps of the management method according to any of claims 1 to 7.
10. A storage medium storing one or more programs, the one or more programs being executable by one or more processors to implement the steps of the management method of any one of claims 1 to 7.
CN201911398711.8A 2019-12-30 2019-12-30 Management method, management device, electronic equipment and storage medium Pending CN111158913A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911398711.8A CN111158913A (en) 2019-12-30 2019-12-30 Management method, management device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911398711.8A CN111158913A (en) 2019-12-30 2019-12-30 Management method, management device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN111158913A true CN111158913A (en) 2020-05-15

Family

ID=70559268

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911398711.8A Pending CN111158913A (en) 2019-12-30 2019-12-30 Management method, management device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111158913A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112162780A (en) * 2020-09-24 2021-01-01 联想(北京)有限公司 Application operation control method and device and electronic equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106980525A (en) * 2017-04-25 2017-07-25 北京奇虎科技有限公司 Using startup method, device and mobile terminal
US20180349261A1 (en) * 2017-06-04 2018-12-06 Apple Inc. Method and apparatus for managing kernel memory of data processing systems
CN110502280A (en) * 2019-07-09 2019-11-26 宇龙计算机通信科技(深圳)有限公司 Starting method, apparatus, storage medium and the terminal of Android operation system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106980525A (en) * 2017-04-25 2017-07-25 北京奇虎科技有限公司 Using startup method, device and mobile terminal
US20180349261A1 (en) * 2017-06-04 2018-12-06 Apple Inc. Method and apparatus for managing kernel memory of data processing systems
CN110502280A (en) * 2019-07-09 2019-11-26 宇龙计算机通信科技(深圳)有限公司 Starting method, apparatus, storage medium and the terminal of Android operation system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
刘华富和魏歌, 北京邮电大学出版社 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112162780A (en) * 2020-09-24 2021-01-01 联想(北京)有限公司 Application operation control method and device and electronic equipment
CN112162780B (en) * 2020-09-24 2022-03-25 联想(北京)有限公司 Application operation control method and device and electronic equipment

Similar Documents

Publication Publication Date Title
US11531625B2 (en) Memory management method and apparatus
JP6138774B2 (en) Computer-implemented method and computer system
US7827395B2 (en) Update-startup apparatus and update-startup control method
KR101116615B1 (en) Resource management system and method for applications and threads in JAVA Virtual Machine
JP6370218B2 (en) MEMORY MANAGEMENT METHOD, COMPUTER SYSTEM, COMPUTER PROGRAM, AND STORAGE MEDIUM
US9063805B2 (en) Method and system for enabling access to functionality provided by resources outside of an operating system environment
US8316120B2 (en) Applicability detection using third party target state
CN108121594B (en) Process management method and device
JP5980916B2 (en) Computer-implemented method and computer system
US8073673B2 (en) Emulated memory management
JPH0644085A (en) Method and device for executing access and computer system
US20040015960A1 (en) Method for loading and executing an application in an embedded environment
WO2012100535A1 (en) Updating method and computer system for hypervisor components
CN115335806A (en) Shadow stack violation enforcement at module granularity
US11861364B2 (en) Circular shadow stack in audit mode
US20190310874A1 (en) Driver management method and host
US20210392091A1 (en) User-mode protocol stack-based network isolation method and device
CN111158913A (en) Management method, management device, electronic equipment and storage medium
CN112199109B (en) Firmware upgrading method, device, equipment and medium
CN109783145B (en) Method for creating multi-image-based multifunctional embedded system
CN113791873B (en) Virtual machine creating method, computing device and storage medium
WO2022104883A1 (en) Adding method and apparatus for coexistence of multiple types of scenarios, terminal and storage medium
KR100401560B1 (en) Kernel Stack Dynamic Allocation Method In Operating System
CN112395083B (en) Resource file release method and device and computer readable storage medium
US9110793B2 (en) Inner process

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination