CN114416359A - Virtual memory processing method and device, electronic equipment and storage medium - Google Patents

Virtual memory processing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN114416359A
CN114416359A CN202210016069.8A CN202210016069A CN114416359A CN 114416359 A CN114416359 A CN 114416359A CN 202210016069 A CN202210016069 A CN 202210016069A CN 114416359 A CN114416359 A CN 114416359A
Authority
CN
China
Prior art keywords
virtual memory
target virtual
memory space
sub
target
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
CN202210016069.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.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co 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 Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202210016069.8A priority Critical patent/CN114416359A/en
Publication of CN114416359A publication Critical patent/CN114416359A/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/5016Allocation 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 the resource being the memory
    • 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

Landscapes

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

Abstract

The disclosure provides a processing method and device of a virtual memory, an electronic device and a storage medium, and relates to the technical field of computers, in particular to the technical field of cloud computing. The specific implementation scheme comprises the following steps: responding to a starting event of a target application program, and occupying a target virtual memory space; initializing the operating environment component of the target application program, and releasing the target virtual memory space to the target application program after the initialization is completed. The disclosed scheme achieves the purpose of reserving memory space for the application program.

Description

Virtual memory processing method and device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method and an apparatus for processing a virtual memory, an electronic device, a storage medium, and a computer program product.
Background
The ARM architecture processor is a very popular processor architecture, and the design of the reduced instruction set is more efficient and consumes less energy than the x86 complex instruction set commonly found in the desktop computer processor. Therefore, at present, most of server devices or mobile devices such as smart phones adopt processors with ARM architecture.
Disclosure of Invention
The disclosure provides a processing method and device of a virtual memory, an electronic device, a storage medium and a computer program product.
According to an aspect of the present disclosure, a method for processing a virtual memory is provided, including:
responding to a starting event of a target application program, and occupying a target virtual memory space;
initializing the operating environment component of the target application program, and releasing the target virtual memory space to the target application program after the initialization is completed.
According to an aspect of the present disclosure, there is provided a processing apparatus of a virtual memory, including:
the memory occupation module is used for responding to a starting event of a target application program and occupying a target virtual memory space;
and the initialization and memory release module is used for initializing the operating environment component of the target application program and releasing the target virtual memory space to the target application program after the initialization is finished.
According to another aspect of the present disclosure, there is provided an electronic device including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of processing virtual memory of any embodiment of the present disclosure.
According to another aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform the method of processing a virtual memory of any embodiment of the present disclosure.
According to another aspect of the present disclosure, there is provided a computer program product comprising a computer program which, when executed by a processor, implements the method of processing virtual memory of any embodiment of the present disclosure.
According to the technology disclosed by the invention, the purpose of reserving the memory space for the application program is realized.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present disclosure, nor do they limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
The drawings are included to provide a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
fig. 1 is a schematic flowchart illustrating a processing method of a virtual memory according to an embodiment of the present disclosure;
fig. 2 is a schematic flowchart illustrating a processing method of a virtual memory according to an embodiment of the present disclosure;
fig. 3 is a schematic structural diagram of another processing apparatus for virtual memory according to an embodiment of the present disclosure;
fig. 4 is a block diagram of an electronic device for implementing a processing method of a virtual memory according to an embodiment of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, in which various details of the embodiments of the disclosure are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
The scheme is applied to a server based on an ARM (advanced RISC machines) architecture chip, and an operating system running on the ARM architecture chip is a Linux system. In order to make up for the limited deficiency of the application program on the Linux system of the ARM architecture chip, a Wine (Wine Is Not an Emulator) technology and a Qemu (Quick Emulator) technology are adopted to configure the operating environment component of the windows program in the Linux system of the ARM architecture chip, so that the application program of the x86 architecture developed for the windows system can be applied to the Linux system of the ARM architecture.
It should be noted that Wine is a simulated execution environment on an x86 processor, and by using Wine, windows executable programs can be directly executed in other operating systems (usually Unix-like operating systems such as Linux). Therefore, rich application resources in the windows environment can be directly obtained on different operating systems by using the Wine, many windows applications can directly run in the Wine without any modification (recompilation is not needed), and high running efficiency is kept. However, the Wine technology is based on an x86 instruction set, only supports a processor architecture of x86, and does not support ARM, so that a Qemu technology is introduced, and x86 instructions are converted into an ARM instruction set through the Qemu technology to actually run, so that the purpose of running windows programs on a Linux system of the ARM architecture is achieved.
However, the windows application program has two programs of 32 bits and 64 bits, and the addressing spaces of the 32-bit program and the 64-bit program are different, specifically, the addressing space of the 32-bit program is 32 powers of 2 and is 4GB, and the addressing space of the 64-bit system is 64 powers of 2. In order to ensure the conversion from the X86 instruction to the ARM instruction by the Qemu technology, the Linux system with the ARM architecture needs to be compatible with the 32-bit and 64-bit program operation. Based on this, the present disclosure proposes to correspond the memory usage spaces of the 32-bit program and the 64-bit program to the 0-4GB space of the virtual memory, thereby proposing a processing method of the virtual memory, and the specific process refers to the following embodiments.
Fig. 1 is a flowchart illustrating a processing method for a virtual memory according to an embodiment of the present disclosure, where the embodiment is applicable to a case where 32-bit and 64-bit windows programs are compatibly run in an ARM architecture-based Linux system. The method can be executed by a virtual memory processing device which is realized in a software and/or hardware mode and is integrated on a server device based on an ARM architecture chip.
Specifically, referring to fig. 1, the processing method of the virtual memory is as follows:
s101, responding to a starting event of the target application program, and occupying a target virtual memory space.
S102, initializing a running environment component of the target application program, and releasing the target virtual memory space to the target application program after initialization is completed.
In the disclosed embodiment, the target application program is a 32-bit windows program or a 64-bit windows program. Correspondingly, the target virtual memory space is the addressing space of the 32-bit windows program, i.e. the 0-4GB space in the virtual memory.
In the Linux system based on the ARM architecture, the instruction for starting the windows program is as follows: exe, where "xxx" represents an identification of an application, such as the name of the application. Therefore, it is determined that a start event of the target application program has occurred whenever an instruction to execute "Wine xxx. To accommodate the execution of 32-bit windows and 64-bit windows, the disclosed solution proposes to save the target virtual memory space (i.e., 0-4GB of virtual memory) as much as possible for windows applications. Therefore, in implementation, as long as a start event of the target application program is detected, the target virtual memory space is preempted, and optionally, the memory mapping function mmap is called to occupy the target virtual memory space.
Further, after the target virtual memory space is occupied, in order to ensure that the target application program can run, a running environment component for ensuring that the target application program can be stably executed in the Linux system of the ARM architecture needs to be initialized, and the qemu module in the running environment component is mainly controlled to run so as to ensure that the instruction of x86 can be converted into an ARM instruction. It should be noted that, when the runtime environment component is initialized, if additional memory resources are needed, more than 4G of memory in the virtual memory is allocated for initialization. And after the initialization is finished, releasing the successfully occupied target virtual memory space to the target application program, and optionally, releasing the occupied target virtual memory space by calling a memory mapping removing function munmap.
In the embodiment of the disclosure, the memory usage space of the windows program is controlled below the 4GB virtual memory, which not only achieves the purpose of reserving the memory space for the windows program, but also ensures that the Linux system of the ARM architecture can be well compatible with the execution of 32-bit and 64-bit windows programs.
Fig. 2 is a schematic flow chart of another processing method for a virtual memory according to an embodiment of the present disclosure, where the embodiment of the present disclosure refines a process of occupying a target virtual memory space on the basis of the above embodiment, and referring to fig. 2, the processing method for a virtual memory specifically includes:
s201, responding to a starting event of a target application program, and occupying a target virtual memory space according to different memory space granularities.
In the disclosed embodiment, the target application program is a 32-bit windows program or a 64-bit windows program. Correspondingly, the target virtual memory space is the addressing space of the 32-bit windows program, i.e. the 0-4GB space in the virtual memory space.
In the embodiment of the disclosure, when the target virtual memory space is occupied according to different memory space granularities, the target virtual memory space can be occupied according to a large granularity, and then occupied according to a small granularity according to the situation of failed occupation, so as to achieve the purpose of occupying the target virtual memory space to the maximum extent.
In an optional implementation manner, the occupying the target virtual memory space according to different memory space granularities includes the following processes:
firstly, dividing a target virtual memory space into M first sub-target virtual memory spaces equally according to a first memory space granularity; the first memory granularity is 2GB as an example, so that the target virtual memory space can be divided into two first sub-target virtual memory spaces, which are a first virtual memory space of 0-2GB and a first virtual memory space of 2-4GB, respectively; the M first sub-target virtual memory spaces are occupied in sequence, and the first type of occupation result is recorded, for example, in an array form, or may be recorded in another manner (for example, in a table), which is not limited specifically herein. It should be noted that, the division is performed according to the granularity of 2GB, because the space of 2-4GB in the target virtual memory space is idle under normal circumstances; therefore, the method is divided according to the granularity of 2GB, and directly occupies the space of 2-4GB when the space is determined to be free, so that the time for occupying the target virtual memory space can be saved.
Further, under the condition that at least one first sub-target virtual memory space fails to be occupied, for example, when the first sub-target virtual memory space of 2-4GB is successfully occupied and the first sub-virtual memory space of 0-2GB fails to be occupied, dividing any first sub-target virtual memory space (for example, 0-2GB memory space) which fails to be occupied equally into N second sub-target virtual memory spaces according to a second memory space granularity, where the second memory space granularity is optionally 64 KB. And then sequentially occupying the N second sub-target virtual memory spaces, and recording a second type of occupied result, for example, recording in an array form. It should be noted that, if any one of the second sub-target virtual memory spaces is completely free, the mark is successful to occupy; otherwise, the mark is occupation failure.
Under the condition that all the M first sub-target virtual memory spaces fail to occupy, for example, all the 2-4GB first sub-target virtual memory spaces and the 0-2GB first sub-virtual memory spaces fail to occupy, it indicates that the target virtual memory spaces are not suitable for being divided by using the first memory space granularity, at this time, in order to occupy the target virtual memory spaces as fast as possible, the target virtual memory spaces can be equally divided into Q second sub-target virtual memory spaces according to the second memory space granularity, for example, the target virtual memory spaces are divided into a plurality of second sub-target virtual memory spaces with the size of 64 KB; then, sequentially occupying Q second sub-target virtual memory spaces, recording a fourth type of occupied result, illustratively, sequentially occupying the Q second sub-target virtual memory spaces by calling a memory mapping function mmap, and recording the occupied result in an array mode; if the second sub-target virtual memory space is completely idle, namely all the addresses in the second sub-target virtual memory space are in an idle state, marking that the occupation is successful; otherwise, the mark is occupation failure.
Further, under the condition that at least one second sub-target virtual memory space fails to occupy, dividing any second sub-target virtual memory space which fails to occupy into P third sub-target virtual memory spaces according to the third memory space granularity; the granularity of the third memory space may be optionally 4KB, or may be other values. And sequentially occupying P third sub-target virtual memory spaces, and recording a third type occupation result, for example, in an array form.
It should be noted that, the first memory space granularity is 2GB, the second memory space granularity is 64KB, and the third memory space granularity is 4KB, so as to ensure efficiency of occupying the target virtual memory. The values of the three memory space granularities can also be any value, as long as the first memory space granularity is larger than the second memory space granularity, and the second memory space granularity is larger than the third memory space granularity.
S202, initializing the running environment component of the target application program, and releasing the target virtual memory space to the target application program after the initialization is completed.
Optionally, after completing the operating environment component of the target application program, the first class occupation result, the second class occupation result, the third class occupation result, and the fourth class occupation result may be traversed, and the first sub-target virtual memory space, the third sub-target virtual memory space, and the second sub-target virtual memory space that are successfully occupied are released in sequence, for example, the memory mapping removal function munmap is called to release the space, so that the allocation of the 0 to 4GB virtual memory space is used by the target application program, and the target application program can be normally executed regardless of a 32-bit windows program or a 64-bit windows program.
In the embodiment of the disclosure, the target virtual memory space is occupied by different granularities, so that the occupation of the target virtual memory space to the maximum extent is ensured; and the occupying efficiency of the target virtual memory space can be ensured by taking appropriate values for the first memory space granularity, the second memory space granularity and the third memory space granularity. In addition, in the Linux system with the ARM architecture, the memory usage space of the 32-bit and 64-bit windows program is controlled below the 4GB virtual memory, so that the purpose of reserving the memory space for the windows program is achieved, and the Linux system with the ARM architecture can be well compatible with the execution of the 32-bit and 64-bit windows program.
Fig. 3 is a schematic structural diagram of a processing apparatus for a virtual memory according to an embodiment of the present disclosure, where the embodiment is suitable for a case where 32-bit and 64-bit windows programs are compatibly run in an ARM architecture-based Linux system. As shown in fig. 3, the apparatus specifically includes:
a memory occupying module 301, configured to respond to a start event of a target application program, and occupy a target virtual memory space;
the initialization and memory release module 302 is configured to initialize the runtime environment component of the target application program, and release the target virtual memory space to the target application program after the initialization is completed.
On the basis of the foregoing embodiment, optionally, the memory usage module includes:
and the memory occupation unit is used for occupying the target virtual memory space according to different memory space granularities.
On the basis of the foregoing embodiment, optionally, the memory occupying unit includes:
the first dividing unit is used for equally dividing the target virtual memory space into M first sub-target virtual memory spaces according to the first memory space granularity;
the first occupation subunit is used for sequentially occupying the M first sub-target virtual memory spaces and recording a first type occupation result;
the second dividing subunit is used for dividing any first sub-target virtual memory space which fails to be occupied into N second sub-target virtual memory spaces according to the second memory space granularity under the condition that at least one first sub-target virtual memory space fails to be occupied;
the second occupation subunit is used for sequentially occupying the N second sub-target virtual memory spaces and recording a second type occupation result;
a third dividing subunit, configured to, when at least one second sub-target virtual memory space fails to occupy, divide any second sub-target virtual memory space that fails to occupy equally into P third sub-target virtual memory spaces according to a third memory space granularity;
and the third occupation subunit is used for sequentially occupying the P third sub-target virtual memory spaces and recording a third occupation result.
On the basis of the foregoing embodiment, optionally, the memory occupying unit further includes:
the fourth dividing subunit is configured to, when all the M first sub-target virtual memory spaces fail to be occupied, equally divide the target virtual memory space into Q second sub-target virtual memory spaces according to the second memory space granularity;
and the fourth occupation subunit is used for sequentially occupying the Q second sub-target virtual memory spaces and recording a fourth occupation result.
On the basis of the foregoing embodiment, optionally, the initialization and memory release module includes:
and the memory release subunit is used for sequentially releasing the occupied first sub-target virtual memory space, the occupied third sub-target virtual memory space and the occupied second sub-target virtual memory space according to the first type occupation result, the second type occupation result, the third type occupation result and the fourth type occupation result.
On the basis of the above embodiment, optionally, the target application program is a 32-bit windows program or a 64-bit windows program;
accordingly, the target virtual memory space is the address space of a 32-bit windows program.
The processing device of the virtual memory provided by the embodiment of the disclosure can execute the processing method of the virtual memory provided by any embodiment of the disclosure, and has the corresponding functional modules and beneficial effects of the execution method. Reference may be made to the description of any method embodiment of the disclosure for a matter not explicitly described in this embodiment.
In the technical scheme of the disclosure, the acquisition, storage, application and the like of the personal information of the related user all accord with the regulations of related laws and regulations, and do not violate the good customs of the public order.
The present disclosure also provides an electronic device, a readable storage medium, and a computer program product according to embodiments of the present disclosure.
FIG. 4 shows a schematic block diagram of an example electronic device 400 that may be used to implement embodiments of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 4, the apparatus 400 includes a computing unit 401 that can perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM)402 or a computer program loaded from a storage unit 408 into a Random Access Memory (RAM) 403. In the RAM403, various programs and data required for the operation of the device 400 can also be stored. The computing unit 401, ROM 402, and RAM403 are connected to each other via a bus 404. An input/output (I/O) interface 405 is also connected to bus 404.
A number of components in device 400 are connected to I/O interface 405, including: an input unit 406 such as a keyboard, a mouse, or the like; an output unit 407 such as various types of displays, speakers, and the like; a storage unit 408 such as a magnetic disk, optical disk, or the like; and a communication unit 409 such as a network card, modem, wireless communication transceiver, etc. The communication unit 409 allows the device 400 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
Computing unit 401 may be a variety of general and/or special purpose processing components with processing and computing capabilities. Some examples of the computing unit 401 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various dedicated Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and so forth. The computing unit 401 executes the respective methods and processes described above, such as the processing method of the virtual memory. For example, in some embodiments, the processing of virtual memory may be implemented as a computer software program tangibly embodied in a machine-readable medium, such as storage unit 408. In some embodiments, part or all of the computer program may be loaded and/or installed onto the device 400 via the ROM 402 and/or the communication unit 409. When loaded into RAM403 and executed by computing unit 401, may perform one or more of the steps of the processing method of virtual memory described above. Alternatively, in other embodiments, the computing unit 401 may be configured to perform the processing method of the virtual memory by any other suitable means (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), system on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions/operations specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server may be a cloud server, a server of a distributed system, or a server with a combined blockchain.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present disclosure may be executed in parallel, sequentially, or in different orders, as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved, and the present disclosure is not limited herein.
The above detailed description should not be construed as limiting the scope of the disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present disclosure should be included in the scope of protection of the present disclosure.

Claims (15)

1. A processing method of virtual memory comprises the following steps:
responding to a starting event of a target application program, and occupying a target virtual memory space;
initializing a running environment component of a target application program, and releasing the target virtual memory space to the target application program after the initialization is completed.
2. The method of claim 1, wherein said occupying a target virtual memory space comprises:
and occupying the target virtual memory space according to different memory space granularities.
3. The method of claim 2, wherein said occupying the target virtual memory space at different memory space granularities comprises:
dividing the target virtual memory space into M first sub-target virtual memory spaces equally according to the granularity of the first memory space;
sequentially occupying the M first sub-target virtual memory spaces, and recording first type occupation results;
under the condition that at least one first sub-target virtual memory space fails to occupy, dividing any first sub-target virtual memory space which fails to occupy into N second sub-target virtual memory spaces according to the second memory space granularity;
occupying the N second sub-target virtual memory spaces in sequence, and recording a second type occupation result;
under the condition that at least one second sub-target virtual memory space fails to occupy, dividing any second sub-target virtual memory space which fails to occupy into P third sub-target virtual memory spaces according to the third memory space granularity;
and occupying the P third sub-target virtual memory spaces in sequence, and recording a third type occupation result.
4. The method of claim 3, further comprising:
under the condition that the M first sub-target virtual memory spaces are all occupied unsuccessfully, dividing the target virtual memory space into Q second sub-target virtual memory spaces according to a second memory space granularity;
and occupying the Q second sub-target virtual memory spaces in sequence, and recording a fourth type occupation result.
5. The method of claim 4, wherein said releasing the target virtual memory space comprises:
and releasing the occupied first sub-target virtual memory space, the occupied third sub-target virtual memory space and the occupied second sub-target virtual memory space in sequence according to the first type occupation result, the second type occupation result, the third type occupation result and the fourth type occupation result.
6. The method of claim 1, wherein the target application is a 32-bit windows program or a 64-bit windows program;
correspondingly, the target virtual memory space is an addressing space of a 32-bit windows program.
7. A processing apparatus for virtual memory, comprising:
the memory occupation module is used for responding to a starting event of a target application program and occupying a target virtual memory space;
and the initialization and memory release module is used for initializing the operating environment component of the target application program and releasing the target virtual memory space to the target application program after the initialization is finished.
8. The apparatus of claim 7, wherein the memory footprint module comprises:
and the memory occupation unit is used for occupying the target virtual memory space according to different memory space granularities.
9. The apparatus of claim 8, wherein the memory footprint unit comprises:
the first dividing unit is used for equally dividing the target virtual memory space into M first sub-target virtual memory spaces according to the first memory space granularity;
the first occupation subunit is used for sequentially occupying the M first sub-target virtual memory spaces and recording a first type occupation result;
the second dividing subunit is used for dividing any first sub-target virtual memory space which fails to be occupied into N second sub-target virtual memory spaces according to the second memory space granularity under the condition that at least one first sub-target virtual memory space fails to be occupied;
the second occupation subunit is used for sequentially occupying the N second sub-target virtual memory spaces and recording a second type occupation result;
a third dividing subunit, configured to, when at least one second sub-target virtual memory space fails to occupy, divide any second sub-target virtual memory space that fails to occupy equally into P third sub-target virtual memory spaces according to a third memory space granularity;
and the third occupation subunit is used for sequentially occupying the P third sub-target virtual memory spaces and recording a third type occupation result.
10. The apparatus of claim 9, the memory footprint unit further comprising:
a fourth dividing subunit, configured to, when all the M first sub-target virtual memory spaces fail to be occupied, divide the target virtual memory space into Q second sub-target virtual memory spaces equally according to a second memory space granularity;
and the fourth occupation subunit is used for sequentially occupying the Q second sub-target virtual memory spaces and recording a fourth type occupation result.
11. The apparatus of claim 10, wherein the initialization and memory release module comprises:
and the memory release subunit is used for sequentially releasing the occupied first sub-target virtual memory space, the occupied third sub-target virtual memory space and the occupied second sub-target virtual memory space according to the first type occupation result, the second type occupation result, the third type occupation result and the fourth type occupation result.
12. The apparatus of claim 7, wherein the target application is a 32-bit windows program or a 64-bit windows program;
correspondingly, the target virtual memory space is an addressing space of a 32-bit windows program.
13. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-6.
14. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-6.
15. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1-6.
CN202210016069.8A 2022-01-07 2022-01-07 Virtual memory processing method and device, electronic equipment and storage medium Pending CN114416359A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210016069.8A CN114416359A (en) 2022-01-07 2022-01-07 Virtual memory processing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210016069.8A CN114416359A (en) 2022-01-07 2022-01-07 Virtual memory processing method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114416359A true CN114416359A (en) 2022-04-29

Family

ID=81271877

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210016069.8A Pending CN114416359A (en) 2022-01-07 2022-01-07 Virtual memory processing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114416359A (en)

Similar Documents

Publication Publication Date Title
US10372639B2 (en) System and method to avoid SMBus address conflicts via a baseboard management controller
CN105830026A (en) Apparatus and method for scheduling graphics processing unit workloads from virtual machines
JP2015534184A (en) Flexible acceleration of code execution
US9032414B1 (en) Systems and methods for managing system resources allocated for backup validation
US9558028B2 (en) Systems and methods for migration of virtual machines across virtual storage resources
US20190391835A1 (en) Systems and methods for migration of computing resources based on input/output device proximity
CN114936173B (en) Read-write method, device, equipment and storage medium of eMMC device
CN115988218A (en) Virtualized video coding and decoding system, electronic equipment and storage medium
CN115988217A (en) Virtualized video coding and decoding system, electronic equipment and storage medium
CN113282351A (en) Switch starting method and device, electronic equipment and storage medium
CN111124288A (en) VPD storage management method, device, equipment and readable storage medium
CN114691300A (en) Hot migration method of virtual machine instance
CN111078353A (en) Operation method of storage equipment and physical server
CN114765051A (en) Memory test method and device, readable storage medium and electronic equipment
CN110209354B (en) Method, apparatus, device and medium for processing data
US9158554B2 (en) System and method for expediting virtual I/O server (VIOS) boot time in a virtual computing environment
CN109558210B (en) Method and system for virtual machine to apply GPU (graphics processing Unit) equipment of host
US9870246B2 (en) Systems and methods for defining virtual machine dependency mapping
US11822499B1 (en) Dynamic slot mapping
US20230325198A1 (en) Coordinated boot synchronization and startup of information handling system subsystems
CN114416359A (en) Virtual memory processing method and device, electronic equipment and storage medium
US10439934B2 (en) Systems and methods for addressing multiple physical and virtual functions in network controller-sideband interface
CN113986476A (en) Sensor equipment virtualization method and device, electronic equipment and storage medium
CN113703913A (en) Equipment testing method and device
US20210026648A1 (en) Method for converting device tree data into acpi data for edge device operating in a network

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