CN105094946A - Method, device and virtual machine used to release occupied logic space - Google Patents

Method, device and virtual machine used to release occupied logic space Download PDF

Info

Publication number
CN105094946A
CN105094946A CN201510385845.1A CN201510385845A CN105094946A CN 105094946 A CN105094946 A CN 105094946A CN 201510385845 A CN201510385845 A CN 201510385845A CN 105094946 A CN105094946 A CN 105094946A
Authority
CN
China
Prior art keywords
space
virtual machine
application program
take
release
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
CN201510385845.1A
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 Xiaomi Technology Co Ltd
Xiaomi Inc
Original Assignee
Xiaomi Inc
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 Xiaomi Inc filed Critical Xiaomi Inc
Priority to CN201510385845.1A priority Critical patent/CN105094946A/en
Publication of CN105094946A publication Critical patent/CN105094946A/en
Pending legal-status Critical Current

Links

Abstract

The invention discloses a method, a device and a virtual machine used to release occupied logic space, which belong to the technical field of computers. The method is applied in a terminal which operates an application program by the virtual machine, and comprises that whether the application program receives a starting instruction is detected; if the application program receives the starting instruction, a maximum virtual machine heap space capacity to be occupied when the application program is operated is acquired; and according to the maximum virtual machine heap space capacity to be occupied, a space releasing instruction is sent to the virtual machine in order to instruct the virtual machine to release partial space in the logic space which has been occupied by the virtual machine. The method, the device and the virtual machine used to release the occupied logic space provided by the disclosure acquire the maximum virtual machine heap space capacity to be occupied during the operation of the application program by detecting that the application program receives the starting instruction, and send the space releasing instruction to the virtual machine according to the maximum virtual machine heap space capacity to be occupied during the operation of the application program, so that the virtual machine can release the partial space in the logic space which has been occupied by the virtual machine, and applicable memory space of the application program can be expanded.

Description

Discharge the method, device and the virtual machine that have taken logical space
Technical field
The disclosure relates to field of computer technology, and particularly a kind of release has taken the method for logical space, device and virtual machine.
Background technology
Android (Android) is a kind of based on the freedom of Linux and the operating system of open source code.The terminal of carrying Android operation system is run application by Android virtual machine.
In the terminal of carrying Android operation system, system can distribute the normal operation of logical space for terminal of fixed size.For the Android operation system of 32, the logical space capacity of system assignment is 4G, wherein there is the space of 2G for the operation of operating system and application program, the initialization of operating system and virtual machine needs to take the part in this space respectively, the memory headroom can applied for when remaining space is application program operation.When an application program needs the memory headroom of application to be greater than the memory headroom that can apply for, just internal memory overflow error may be caused.
Summary of the invention
Present disclose provides a kind of release and take the method for logical space, device and virtual machine method and device.Described technical scheme is as follows:
According to first aspect of the present disclosure, provide a kind of release to take the method for logical space, in the terminal that run application by virtual machine, described method comprises:
Detect described application program and whether receive enabled instruction;
If described application program receives described enabled instruction, then obtain the virtual machine heap space capacity that can take at most when described application program is run;
The virtual machine heap space capacity that can take at most when running according to described application program sends space to described virtual machine and releases order, and releases order and be used to indicate described virtual machine and discharge segment space in the logical space that described virtual machine taken in described space.
Optionally, the virtual machine heap space capacity that can take at most when the described application program of described acquisition is run, comprising:
Obtain the configuration file of described application program;
The virtual machine heap space capacity that can take at most when described application program is run is read from the configuration file of described application program.
Optionally, the described virtual machine heap space capacity according to taking at most during described application program operation sends space to described virtual machine and releases order, and comprising:
Send the space including the virtual machine heap space capacity that can take at most when described application program is run to release order to described virtual machine.
Optionally, the described virtual machine heap space capacity according to taking at most during described application program operation sends space to described virtual machine and releases order, and comprising:
The logical space that the virtual machine heap space capacity that can take at most when running according to described application program and described virtual machine have taken calculates the spatial content of described segment space to be released;
Send to described virtual machine the space comprising described spatial content to release order.
According to second aspect of the present disclosure, provide a kind of release to take the method for logical space, in the terminal that run application by virtual machine, described method comprises:
Release order in the space that described virtual machine receives the transmission of described terminal, releasing order in described space is after described terminal detects that application program receives enabled instruction, obtain the virtual machine heap space capacity that can take at most when described application program is run, and the instruction that the virtual machine heap space capacity that can take at most when running according to described application program sends;
The segment space that described virtual machine releases order in the logical space that taken of the described virtual machine of release according to described space.
Optionally, described space comprises the virtual machine heap space capacity that can take at most when described application program is run in releasing order, the segment space that described virtual machine releases order in logical space that the described virtual machine of release taken according to described space, comprising:
The virtual machine heap space capacity that described virtual machine can take at most when running according to described application program and the logical space that described virtual machine has taken calculate the spatial content of described segment space to be released;
Described virtual machine discharges described segment space according to calculating the described spatial content obtained.
Optionally, described space comprises the spatial content of described segment space to be released in releasing order, the segment space that described virtual machine releases order in the logical space that taken of the described virtual machine of release according to described space, comprising:
Described virtual machine discharges described segment space according to described spatial content.
According to the third aspect of the present disclosure, provide a kind of release to take the device of logical space, in the terminal that run application by virtual machine, described device comprises:
Whether command detection module, receive enabled instruction for detecting described application program;
Acquisition module, if receive described enabled instruction for described application program, then obtains the virtual machine heap space capacity that can take at most when described application program is run;
Instruction sending module, the virtual machine heap space capacity that can take at most during for running according to described application program sends space to described virtual machine and releases order, and releases order and be used to indicate described virtual machine and discharge segment space in the logical space that described virtual machine taken in described space.
Optionally, described acquisition module, comprising:
Obtain submodule, for obtaining the configuration file of described application program;
Reading submodule, for reading the virtual machine heap space capacity that can take at most when described application program is run in the configuration file from described application program.
Optionally, described instruction sending module, comprising:
First sends submodule, releases order for sending the space including the virtual machine heap space capacity that can take at most when described application program is run to described virtual machine.
Optionally, described instruction sending module, comprising:
First calculating sub module, the logical space that the virtual machine heap space capacity that can take at most during for running according to described application program and described virtual machine have taken calculates the spatial content of described segment space to be released;
Second sends submodule, releases order for sending to described virtual machine the space comprising described spatial content.
According to the 41 aspect of the present disclosure, provide a kind of virtual machine, in the terminal that run application by described virtual machine, described virtual machine comprises:
Command reception module, release order in the space sent for receiving described terminal, releasing order in described space is after described terminal detects that application program receives enabled instruction, obtain the virtual machine heap space capacity that can take at most when described application program is run, and the instruction that the virtual machine heap space capacity that can take at most when running according to described application program sends;
Space release module, for the segment space in the logical space that the described virtual machine of release that releases order according to described space has taken.
Optionally, described space comprises the virtual machine heap space capacity that can take at most when described application program is run in releasing order, described space release module, comprising:
Second calculating sub module, the logical space that the virtual machine heap space capacity that can take at most during for running according to described application program and described virtual machine have taken calculates the spatial content of described segment space to be released;
First release submodule, for discharging described segment space according to calculating the described spatial content obtained.
Optionally, described space comprises the spatial content of described segment space to be released in releasing order, and described space release module, comprising:
Second release submodule, for discharging described segment space according to described spatial content.
According to the 5th aspect of the present disclosure, provide a kind of release to take the device of logical space, in the terminal that run application by virtual machine, described device comprises:
Processor;
For the storer of storage of processor executable instruction;
Wherein, described processor is configured to:
Detect described application program and whether receive enabled instruction;
If described application program receives described enabled instruction, then obtain the virtual machine heap space capacity that can take at most when described application program is run;
The virtual machine heap space capacity that can take at most when running according to described application program sends space to described virtual machine and releases order, and releases order and be used to indicate described virtual machine and discharge segment space in the logical space that described virtual machine taken in described space.
The technical scheme that embodiment of the present disclosure provides can comprise following beneficial effect:
By when detecting that application program receives enabled instruction, obtain the virtual machine heap space capacity that can take at most when this application program is run, the virtual machine heap space capacity that can take at most when running according to this application program sends space to this virtual machine and releases order, segment space in virtual machine is discharged logical space that this virtual machine taken, it can be memory headroom to the program application of being employed, thus reaches the effect of the memory headroom that extension application can be applied for.
Should be understood that, it is only exemplary that above general description and details hereinafter describe, and can not limit the disclosure.
Accompanying drawing explanation
Accompanying drawing to be herein merged in instructions and to form the part of this instructions, shows embodiment according to the invention, and is used from instructions one and explains principle of the present invention.
Fig. 1 is the process flow diagram that a kind of release according to an exemplary embodiment has taken the method for logical space;
Fig. 2 is the process flow diagram that a kind of release according to an exemplary embodiment has taken the method for logical space;
Fig. 3 is the process flow diagram that a kind of release according to an exemplary embodiment has taken the method for logical space;
Fig. 4 is the process flow diagram that a kind of release according to another exemplary embodiment has taken the method for logical space;
Fig. 5 is the block diagram that a kind of release according to an exemplary embodiment has taken the device of logical space;
Fig. 6 is a kind of block diagram putting the device taking logical space according to another exemplary embodiment;
Fig. 7 is the block diagram of a kind of virtual machine according to an exemplary embodiment;
Fig. 8 is the block diagram of a kind of virtual machine according to another exemplary embodiment;
Fig. 9 is the block diagram of a kind of device according to an exemplary embodiment.
Embodiment
Here will perform explanation to exemplary embodiment in detail, its sample table shows in the accompanying drawings.When description below relates to accompanying drawing, unless otherwise indicated, the same numbers in different accompanying drawing represents same or analogous key element.Embodiment described in following exemplary embodiment does not represent all embodiments consistent with the present invention.On the contrary, they only with as in appended claims describe in detail, the example of apparatus and method that aspects more of the present invention are consistent.
In Android operation system, a part of logical space is taken as virtual machine heap space (javaheap) during virtual machine initialization, it is a fixed value, in order to normally run various application program, it is larger that the capacity in this space is arranged usually, such as be set to 512M, and when a lot of application program is run on a virtual machine at present, the virtual machine heap space that can take at most is far away from 512M.Such as, for the browser in certain Android operation system, the logical space of 1.2G is taken during this operating system initialization, 512M space is taken as virtual machine heap space during virtual machine initialization, can viewed device application be that the capacity of memory headroom only has 800M, the virtual machine heap space capacity that can take at most during browser execution is 128M, and in the logical space that this virtual machine has taken, also remaining 384M cannot be used.Scheme shown in each embodiment of the disclosure, the segment space used by being employed program in the logical space that taken by virtual machine exactly discharges, can be memory headroom to the program application of being employed, thus the memory headroom that extension application can be applied for.
Fig. 1 is the process flow diagram that a kind of release according to an exemplary embodiment has taken the method for logical space.The method that this release has taken logical space is in the terminal that run application by virtual machine, and such as, this terminal can be smart mobile phone, panel computer and E-book reader etc.As shown in Figure 1, the method that this release has taken logical space can comprise the following steps.
In a step 102, detect this application program and whether receive enabled instruction.
At step 104, if this application program receives this enabled instruction, then obtain the virtual machine heap space capacity that can take at most when this application program is run.
In step 106, the virtual machine heap space capacity that can take at most when running according to this application program sends space to this virtual machine and releases order, and releases order and be used to indicate this virtual machine and discharge segment space in the logical space that this virtual machine taken in this space.
Optionally, the virtual machine heap space capacity that can take at most when this application program of this acquisition is run, comprising:
Obtain the configuration file of this application program;
The virtual machine heap space capacity that can take at most when this application program is run is read from the configuration file of this application program.
Optionally, the virtual machine heap space capacity that can take at most when this runs according to this application program sends space to this virtual machine and releases order, and comprising:
Send the space including the virtual machine heap space capacity that can take at most when this application program is run to release order to this virtual machine.
Optionally, the virtual machine heap space capacity that can take at most when this runs according to this application program sends space to this virtual machine and releases order, and comprising:
The logical space that the virtual machine heap space capacity that can take at most when running according to this application program and this virtual machine have taken calculates the spatial content of this segment space to be released;
Send to this virtual machine the space comprising this spatial content to release order.
In sum, release shown in disclosure embodiment has taken the method for logical space, by when detecting that application program receives enabled instruction, obtain the virtual machine heap space capacity that can take at most when this application program is run, the virtual machine heap space capacity that can take at most when running according to this application program sends space to this virtual machine and releases order, segment space in virtual machine is discharged logical space that this virtual machine taken, it can be memory headroom to the program application of being employed, thus reaches the effect of the memory headroom that extension application can be applied for.
Fig. 2 is the process flow diagram that a kind of release according to an exemplary embodiment has taken the method for logical space.The method that this release has taken logical space is in the terminal that run application by virtual machine, and such as, this terminal can be smart mobile phone, panel computer and E-book reader etc.As shown in Figure 2, the method that this release has taken logical space can comprise the following steps.
In step 202., release order in the space that virtual machine receives the transmission of this terminal, releasing order in this space is after this terminal detects that application program receives enabled instruction, obtain the virtual machine heap space capacity that can take at most when this application program is run, and the instruction that the virtual machine heap space capacity that can take at most when running according to this application program sends.
In step 204, the segment space that releases order in the logical space that taken of this virtual machine of release according to this space of virtual machine.
Optionally, this space comprises the virtual machine heap space capacity that can take at most when this application program is run in releasing order, the segment space that this virtual machine releases order in logical space that this virtual machine of release taken according to this space, comprising:
The virtual machine heap space capacity that this virtual machine can take at most when running according to this application program and the logical space that this virtual machine has taken calculate the spatial content of this segment space to be released;
This virtual machine discharges this segment space according to calculating this spatial content obtained.
Optionally, this space comprises the spatial content of this segment space to be released in releasing order, the segment space that this virtual machine releases order in the logical space that taken of this virtual machine of release according to this space, comprising:
This virtual machine discharges this segment space according to this spatial content.
In sum, release shown in disclosure embodiment has taken the method for logical space, virtual machine receiving terminal is when detecting that application program receives enabled instruction, obtain the virtual machine heap space capacity that can take at most when this application program is run, release order in the space that the virtual machine heap space capacity that can take at most when running according to this application program sends, to release order the segment space in the logical space that taken of this virtual machine of release according to this space, it can be memory headroom to the program application of being employed, thus reach the effect of the memory headroom that extension application can be applied for.
In the scheme shown in the disclosure, send to virtual machine after the capacity of segment space of virtual machine release can have been calculated by terminal, also can be calculated voluntarily by virtual machine and discharge, disclosure the following examples will be illustrated for these two kinds of situations respectively.
Fig. 3 is the process flow diagram that a kind of release according to an exemplary embodiment has taken the method for logical space.The method that this release has taken logical space is in the terminal that run application by virtual machine, and such as, this terminal can be smart mobile phone, panel computer and E-book reader etc.As shown in Figure 3, the method that this release has taken logical space can comprise the following steps.
In step 301, terminal detects application program and whether receives enabled instruction.
When user sends the operation starting certain application program in the terminal, the system layer of terminal can send enabled instruction to application program, to start this application program.
In step 302, if this application program receives this enabled instruction, then terminal obtains the configuration file of this application program; The virtual machine heap space capacity that can take at most when this application program is run is read from the configuration file of this application program.
The virtual machine heap space capacity that application program operationally can take at most is when this application development, just be developed personnel to set, when application program is installed, meeting registration profile in an operating system, wherein just comprises the virtual machine heap space capacity that it can take at most.When terminal detects that application program receives enabled instruction, first obtain the configuration file of this application program, and therefrom read out its virtual machine heap space capacity that can take at most.
In step 303, terminal sends to this virtual machine and includes the space of virtual machine heap space capacity that can take at most when this application program is run and release order.
The virtual machine heap space capacity that terminal can take at most when this application program got can be run directly is added in releasing order in space and sends to virtual machine.
In step 304, the logical space that the virtual machine heap space capacity that can take at most when virtual machine runs according to this application program and this virtual machine have taken calculates the spatial content of this segment space to be released.
In step 305, virtual machine discharges this segment space according to calculating this spatial content obtained.
Virtual machine can in the logical space taken, the segment space that the virtual machine heap space capacity that can take at most when retaining the operation of this application program is corresponding, and is all discharged in the space of remainder; Or the capacity of the segment space that virtual machine retains can be a bit larger tham the virtual machine heap space capacity that can take at most when this application program is run.
Such as, the logical space capacity that virtual machine has taken as virtual machine heap space is 512M, the virtual machine heap space capacity that application program can take at most is 128M, then virtual machine can retain the 128M in this 512M capacity, and discharged by remaining 384M, or virtual machine is in order to ensure the normal operation of application program, also can retain the 130M in this 512M capacity, and remaining 382M is discharged.
With this terminal for smart mobile phone, this application program is browser is example, the virtual machine heap space taken after virtual machine initialization is 512M, the virtual machine heap space capacity that browser can take at most is 128M, terminal sends to virtual machine the space comprising the virtual machine heap space capacity that browser can take at most and releases order, virtual machine releases order after the capacity that calculates logical space to be released is 384M according to this space, by the 384M release in the 512M virtual machine heap space that takies, being used as can the memory headroom (nativeheap) of viewed device application.After logical space release, browser can open more webpage simultaneously, and such as, browser can open 6 webpages originally simultaneously, after the release of the space of disclosure embodiment, can open maximum 10 webpages simultaneously.
Within step 306, when application program opens new object, whether the quantity that terminal detects the object that this application program has been opened is greater than default amount threshold.
In step 307, if the quantity of object that application program has been opened is greater than default amount threshold, then the terminal data cached deletion of object that this application program is opened the earliest.
Optionally, in scheme shown in disclosure embodiment, the number of objects opened in order to avoid application program too much causes internal memory overflow error, can also by the restricted number of openable for application program object under some preset values, when the quantity of the object opened is greater than this preset value, the object opened at first is closed, and it is data cached.
Such as, take application program as browser be example, the object that this browser is opened is webpage, this browser can be pre-set and can open at most 10 webpages, when the 11st webpage opened by browser, open at first of this browser webpage is closed, and deletes the data cached of its correspondence, to save logical space.
In sum, release shown in disclosure embodiment has taken the method for logical space, by when detecting that application program receives enabled instruction, obtain the virtual machine heap space capacity that can take at most when this application program is run, the virtual machine heap space capacity that can take at most when running according to this application program sends space to this virtual machine and releases order, segment space in virtual machine is discharged logical space that this virtual machine taken, it can be memory headroom to the program application of being employed, thus reaches the effect of the memory headroom that extension application can be applied for.
Fig. 4 is the process flow diagram that a kind of release according to another exemplary embodiment has taken the method for logical space.The method that this release has taken logical space is in the terminal that run application by virtual machine, and such as, this terminal can be smart mobile phone, panel computer and E-book reader etc.As shown in Figure 4, the method that this release has taken logical space can comprise the following steps.
In step 401, terminal detects this application program and whether receives enabled instruction.
In step 402, if this application program receives this enabled instruction, then terminal obtains the configuration file of this application program; The virtual machine heap space capacity that can take at most when this application program is run is read from the configuration file of this application program.
In step 403, the logical space that the virtual machine heap space capacity that can take at most when terminal is run according to this application program and this virtual machine have taken calculates the spatial content of this segment space to be released.
In step 404, terminal sends to this virtual machine the space comprising this spatial content and releases order.
In step 405, the spatial content that virtual machine comprises in releasing order according to this space discharges this segment space.
With this terminal for smart mobile phone, this application program is browser is example, the virtual machine heap space taken after virtual machine initialization is 512M, the virtual machine heap space capacity that browser can take at most is 128M, the capacity that terminal calculates logical space to be released is after 384M, send to virtual machine the space comprising the capacity of logical space to be released to release order, virtual machine releases order according to this space, by the 384M release in the 512M virtual machine heap space that takies, being used as can the memory headroom (nativeheap) of viewed device application.After logical space release, browser can open more webpage simultaneously, and such as, browser can open 6 webpages originally simultaneously, after the release of the space of disclosure embodiment, can open maximum 10 webpages simultaneously.
In a step 406, when application program opens new object, whether the quantity that terminal detects the object that this application program has been opened is greater than default amount threshold.
In step 407, if the quantity of object that application program has been opened is greater than default amount threshold, then the terminal data cached deletion of object that this application program is opened the earliest.
Optionally, in scheme shown in disclosure embodiment, the number of objects opened in order to avoid application program too much causes internal memory overflow error, can also by the restricted number of openable for application program object under some preset values, when the quantity of the object opened is greater than this preset value, the object opened at first is closed, and it is data cached.
Such as, take application program as browser be example, the object that this browser is opened is webpage, this browser can be pre-set and can open at most 10 webpages, when the 11st webpage opened by browser, open at first of this browser webpage is closed, and deletes the data cached of its correspondence, to save logical space.
In sum, release shown in disclosure embodiment has taken the method for logical space, by when detecting that application program receives enabled instruction, obtain the virtual machine heap space capacity that can take at most when this application program is run, the virtual machine heap space capacity that can take at most when running according to this application program sends space to this virtual machine and releases order, segment space in virtual machine is discharged logical space that this virtual machine taken, it can be memory headroom to the program application of being employed, thus reaches the effect of the memory headroom that extension application can be applied for.
Following is disclosure device embodiment, may be used for performing disclosure embodiment of the method.For the details do not disclosed in disclosure device embodiment, please refer to disclosure embodiment of the method.
Fig. 5 is the block diagram that a kind of release according to an exemplary embodiment has taken the device of logical space, the device that this release has taken logical space may be used in the terminal run application by virtual machine, perform the Overall Steps of method as shown in Figure 1, or, perform the step performed by terminal in method shown in Fig. 3 or Fig. 4, this terminal can be smart mobile phone, panel computer and E-book reader etc.As shown in Figure 5, the device that this release has taken logical space includes but not limited to: command detection module 501, acquisition module 502 and instruction sending module 503;
Described command detection module 501 is set to whether receive enabled instruction for detecting described application program;
If described acquisition module 502 is set to receive described enabled instruction for described application program, then obtain the virtual machine heap space capacity that can take at most when described application program is run;
The virtual machine heap space capacity that described instruction sending module 503 can take at most when being set to for running according to described application program sends space to described virtual machine and releases order, and releases order and be used to indicate described virtual machine and discharge segment space in the logical space that described virtual machine taken in described space.
In sum, release shown in disclosure embodiment has taken the device of logical space, by when detecting that application program receives enabled instruction, obtain the virtual machine heap space capacity that can take at most when this application program is run, the virtual machine heap space capacity that can take at most when running according to this application program sends space to this virtual machine and releases order, segment space in virtual machine is discharged logical space that this virtual machine taken, it can be memory headroom to the program application of being employed, thus reaches the effect of the memory headroom that extension application can be applied for.
Fig. 6 is the block diagram that a kind of release according to another exemplary embodiment has taken the device of logical space, the device that this release has taken logical space may be used in the terminal run application by virtual machine, perform the Overall Steps of method as shown in Figure 1, or, perform the step performed by terminal in method shown in Fig. 3 or Fig. 4, this terminal can be smart mobile phone, panel computer and E-book reader etc.As shown in Figure 6, the device that this release has taken logical space includes but not limited to: command detection module 501, acquisition module 502 and instruction sending module 503;
Described command detection module 501 is set to whether receive enabled instruction for detecting described application program;
If described acquisition module 502 is set to receive described enabled instruction for described application program, then obtain the virtual machine heap space capacity that can take at most when described application program is run;
The virtual machine heap space capacity that described instruction sending module 503 can take at most when being set to for running according to described application program sends space to described virtual machine and releases order, and releases order and be used to indicate described virtual machine and discharge segment space in the logical space that described virtual machine taken in described space.
Optionally, described acquisition module 502, comprising: obtain submodule 502a and reading submodule 502b;
Described acquisition submodule 502a is set to the configuration file for obtaining described application program;
Described reading submodule 502b is set to for reading the virtual machine heap space capacity that can take at most when described application program is run in the configuration file from described application program.
Optionally, described instruction sending module 503, comprising: first sends submodule 503a;
Described first sends submodule 503a is set to release order for sending the space including the virtual machine heap space capacity that can take at most when described application program is run to described virtual machine.
Optionally, described instruction sending module, comprising: the first calculating sub module 503b and second sends submodule 503c;
The virtual machine heap space capacity that described first calculating sub module 503b can take at most when being set to for running according to described application program and the logical space that described virtual machine has taken calculate the spatial content of described segment space to be released;
Described second sends submodule 503c is set to release order for sending to described virtual machine the space comprising described spatial content.
In sum, release shown in disclosure embodiment has taken the device of logical space, by when detecting that application program receives enabled instruction, obtain the virtual machine heap space capacity that can take at most when this application program is run, the virtual machine heap space capacity that can take at most when running according to this application program sends space to this virtual machine and releases order, segment space in virtual machine is discharged logical space that this virtual machine taken, it can be memory headroom to the program application of being employed, thus reaches the effect of the memory headroom that extension application can be applied for.
Fig. 7 is the block diagram of a kind of virtual machine according to an exemplary embodiment, this virtual machine may be used in the terminal run application by virtual machine, perform the Overall Steps of method as shown in Figure 2, or, perform the part steps performed by virtual machine in method shown in Fig. 3 or Fig. 4, this terminal can be smart mobile phone, panel computer and E-book reader etc.As shown in Figure 7, this virtual machine includes but not limited to: command reception module 701 and space release module 702;
Release order in the space that described command reception module 701 is set to send for receiving described terminal, releasing order in described space is after described terminal detects that application program receives enabled instruction, obtain the virtual machine heap space capacity that can take at most when described application program is run, and the instruction that the virtual machine heap space capacity that can take at most when running according to described application program sends;
Described space release module 702 is set to the segment space in the logical space taken for the described virtual machine of release that releases order according to described space.
In sum, virtual machine shown in disclosure embodiment, by receiving terminal when detecting that application program receives enabled instruction, obtain the virtual machine heap space capacity that can take at most when this application program is run, release order in the space that the virtual machine heap space capacity that can take at most when running according to this application program sends, to release order the segment space in the logical space that taken of this virtual machine of release according to this space, it can be memory headroom to the program application of being employed, thus reaches the effect of the memory headroom that extension application can be applied for.
Fig. 8 is the block diagram of a kind of virtual machine according to another exemplary embodiment, this virtual machine may be used in the terminal run application by virtual machine, perform the Overall Steps of method as shown in Figure 2, or, perform the part steps performed by virtual machine in method shown in Fig. 3 or Fig. 4, this terminal can be smart mobile phone, panel computer and E-book reader etc.As shown in Figure 8, this virtual machine includes but not limited to: command reception module 701 and space release module 702;
Release order in the space that described command reception module 701 is set to send for receiving described terminal, releasing order in described space is after described terminal detects that application program receives enabled instruction, obtain the virtual machine heap space capacity that can take at most when described application program is run, and the instruction that the virtual machine heap space capacity that can take at most when running according to described application program sends;
Described space release module 702 is set to the segment space in the logical space taken for the described virtual machine of release that releases order according to described space.
Optionally, described space comprises the virtual machine heap space capacity that can take at most when described application program is run in releasing order, described space release module 702, comprising: the second calculating sub module 702a and first release submodule 702b;
The virtual machine heap space capacity that described second calculating sub module 702a can take at most when being set to for running according to described application program and the logical space that described virtual machine has taken calculate the spatial content of described segment space to be released;
Described first release submodule 702b is set to for discharging described segment space according to calculating the described spatial content obtained.
Optionally, described space comprises the spatial content of described segment space to be released in releasing order, and described space release module 702, comprising: the second release submodule 702c;
Described second release submodule 702c is set to for discharging described segment space according to described spatial content.
In sum, virtual machine shown in disclosure embodiment, by receiving terminal when detecting that application program receives enabled instruction, obtain the virtual machine heap space capacity that can take at most when this application program is run, release order in the space that the virtual machine heap space capacity that can take at most when running according to this application program sends, to release order the segment space in the logical space that taken of this virtual machine of release according to this space, it can be memory headroom to the program application of being employed, thus reaches the effect of the memory headroom that extension application can be applied for.
Fig. 9 is the block diagram of a kind of device 900 according to an exemplary embodiment.Such as, device 900 can be mobile phone, computing machine, digital broadcast terminal, messaging devices, routing device, game console, tablet device, Medical Devices, body-building equipment, personal digital assistant, intelligent control device, intelligent appliance equipment, intelligent wearable device etc.
With reference to Fig. 9, device 900 can comprise following one or more assembly: processing components 902, storer 904, power supply module 906, multimedia groupware 908, audio-frequency assembly 910, sensor module 914 and communications component 916.
The integrated operation of the usual control device 900 of processing components 902, such as with display, call, data communication, camera operation, record operates the operation etc. be associated.Processing components 902 can comprise one or more processor 918 to perform instruction, to complete all or part of step of above-mentioned method.In addition, processing components 902 can comprise one or more module, and what be convenient between processing components 902 and other assemblies is mutual.Such as, processing components 902 can comprise multi-media module, mutual with what facilitate between multimedia groupware 908 and processing components 902.
Storer 904 is configured to store various types of data to be supported in the operation of device 900.The example of these data comprises for any application program of operation on device 900 or the instruction of method.Storer 904 can be realized by the volatibility of any type or non-volatile memory device or their combination, as static RAM (SRAM), Electrically Erasable Read Only Memory (EEPROM), Erasable Programmable Read Only Memory EPROM (EPROM), programmable read only memory (PROM), ROM (read-only memory) (ROM), magnetic store, flash memory, disk or CD.Also store one or more module in storer 904, this one or more module is configured to be performed by this one or more processor 918, to complete all or part of step in the arbitrary shown method of above-mentioned Fig. 1 to 4.
The various assemblies that power supply module 906 is device 900 provide electric power.Power supply module 906 can comprise power-supply management system, one or more power supply, and other and the assembly generating, manage and distribute electric power for device 900 and be associated.
Multimedia groupware 908 is included in the screen providing an output interface between described device 900 and user.In certain embodiments, screen can comprise liquid crystal display (LCD) and touch panel (TP).If screen comprises touch panel, screen may be implemented as touch-screen, to receive the input signal from user.Touch panel comprises one or more touch sensor with the gesture on sensing touch, slip and touch panel.Described touch sensor can the border of not only sensing touch or sliding action, but also detects the duration relevant to described touch or slide and pressure.
Audio-frequency assembly 910 is configured to export and/or input audio signal.Such as, audio-frequency assembly 910 comprises a microphone (MIC), and when device 900 is in operator scheme, during as call model, logging mode and speech recognition mode, microphone is configured to receive external audio signal.The sound signal received can be stored in storer 904 further or be sent via communications component 916.In certain embodiments, audio-frequency assembly 910 also comprises a loudspeaker, for output audio signal.
Sensor module 914 comprises one or more sensor, for providing the state estimation of various aspects for device 900.Such as, sensor module 914 can detect the opening/closing state of device 900, the relative positioning of assembly, the position change of all right pick-up unit 900 of sensor module 914 or device 900 1 assemblies and the temperature variation of device 900.In certain embodiments, this sensor module 914 can also comprise Magnetic Sensor, pressure transducer or temperature sensor.
Communications component 916 is configured to the communication being convenient to wired or wireless mode between device 900 and other equipment.Device 900 can access the wireless network based on communication standard, as WiFi, 2G or 3G, or their combination.In one exemplary embodiment, communications component 916 receives from the broadcast singal of external broadcasting management system or broadcast related information via broadcast channel.In one exemplary embodiment, described communications component 916 also comprises near-field communication (NFC) module, to promote junction service.Such as, can based on radio-frequency (RF) identification (RFID) technology in NFC module, Infrared Data Association (IrDA) technology, ultra broadband (UWB) technology, bluetooth (BT) technology and other technologies realize.
In the exemplary embodiment, device 900 can be realized, for performing said method by one or more application specific integrated circuit (ASIC), digital signal processor (DSP), digital signal processing appts (DSPD), programmable logic device (PLD) (PLD), field programmable gate array (FPGA), controller, microcontroller, microprocessor or other electronic components.
In the exemplary embodiment, additionally provide a kind of non-transitory computer-readable recording medium comprising instruction, such as, comprise the storer 904 of instruction, above-mentioned instruction can perform said method by the processor 918 of device 900.Such as, described non-transitory computer-readable recording medium can be ROM, random access memory (RAM), CD-ROM, tape, floppy disk and optical data storage devices etc.
About the device in above-described embodiment, wherein the concrete mode of modules executable operations performs detailed description in about the embodiment of the method, will not elaborate explanation herein.
Should be understood that, the present invention is not limited to precision architecture described above and illustrated in the accompanying drawings, and can perform various amendment and change not departing from its scope.Scope of the present invention is only limited by appended claim.

Claims (15)

1. release has taken the method for logical space, it is characterized in that, in the terminal that run application by virtual machine, described method comprises:
Detect described application program and whether receive enabled instruction;
If described application program receives described enabled instruction, then obtain the virtual machine heap space capacity that can take at most when described application program is run;
The virtual machine heap space capacity that can take at most when running according to described application program sends space to described virtual machine and releases order, and releases order and be used to indicate described virtual machine and discharge segment space in the logical space that described virtual machine taken in described space.
2. method according to claim 1, is characterized in that, the virtual machine heap space capacity that can take at most when the described application program of described acquisition is run, comprising:
Obtain the configuration file of described application program;
The virtual machine heap space capacity that can take at most when described application program is run is read from the configuration file of described application program.
3. method according to claim 1, is characterized in that, the described virtual machine heap space capacity according to taking at most during described application program operation sends space to described virtual machine and releases order, and comprising:
Send the space including the virtual machine heap space capacity that can take at most when described application program is run to release order to described virtual machine.
4. method according to claim 1, is characterized in that, the described virtual machine heap space capacity according to taking at most during described application program operation sends space to described virtual machine and releases order, and comprising:
The logical space that the virtual machine heap space capacity that can take at most when running according to described application program and described virtual machine have taken calculates the spatial content of described segment space to be released;
Send to described virtual machine the space comprising described spatial content to release order.
5. release has taken the method for logical space, it is characterized in that, in the terminal that run application by virtual machine, described method comprises:
Release order in the space that described virtual machine receives the transmission of described terminal, releasing order in described space is after described terminal detects that application program receives enabled instruction, obtain the virtual machine heap space capacity that can take at most when described application program is run, and the instruction that the virtual machine heap space capacity that can take at most when running according to described application program sends;
The segment space that described virtual machine releases order in the logical space that taken of the described virtual machine of release according to described space.
6. method according to claim 5, it is characterized in that, described space comprises the virtual machine heap space capacity that can take at most when described application program is run in releasing order, the segment space that described virtual machine releases order in the logical space that taken of the described virtual machine of release according to described space, comprising:
The virtual machine heap space capacity that described virtual machine can take at most when running according to described application program and the logical space that described virtual machine has taken calculate the spatial content of described segment space to be released;
Described virtual machine discharges described segment space according to calculating the described spatial content obtained.
7. method according to claim 5, it is characterized in that, described space comprises the spatial content of described segment space to be released in releasing order, the segment space that described virtual machine releases order in the logical space that taken of the described virtual machine of release according to described space, comprising:
Described virtual machine discharges described segment space according to described spatial content.
8. release has taken the device of logical space, it is characterized in that, in the terminal that run application by virtual machine, described device comprises:
Whether command detection module, receive enabled instruction for detecting described application program;
Acquisition module, if receive described enabled instruction for described application program, then obtains the virtual machine heap space capacity that can take at most when described application program is run;
Instruction sending module, the virtual machine heap space capacity that can take at most during for running according to described application program sends space to described virtual machine and releases order, and releases order and be used to indicate described virtual machine and discharge segment space in the logical space that described virtual machine taken in described space.
9. device according to claim 8, is characterized in that, described acquisition module, comprising:
Obtain submodule, for obtaining the configuration file of described application program;
Reading submodule, for reading the virtual machine heap space capacity that can take at most when described application program is run in the configuration file from described application program.
10. device according to claim 8, is characterized in that, described instruction sending module, comprising:
First sends submodule, releases order for sending the space including the virtual machine heap space capacity that can take at most when described application program is run to described virtual machine.
11. devices according to claim 8, is characterized in that, described instruction sending module, comprising:
First calculating sub module, the logical space that the virtual machine heap space capacity that can take at most during for running according to described application program and described virtual machine have taken calculates the spatial content of described segment space to be released;
Second sends submodule, releases order for sending to described virtual machine the space comprising described spatial content.
12. 1 kinds of virtual machines, is characterized in that, in the terminal that run application by described virtual machine, described virtual machine comprises:
Command reception module, release order in the space sent for receiving described terminal, releasing order in described space is after described terminal detects that application program receives enabled instruction, obtain the virtual machine heap space capacity that can take at most when described application program is run, and the instruction that the virtual machine heap space capacity that can take at most when running according to described application program sends;
Space release module, for the segment space in the logical space that the described virtual machine of release that releases order according to described space has taken.
13. virtual machines according to claim 12, is characterized in that, described space comprises the virtual machine heap space capacity that can take at most when described application program is run in releasing order, described space release module, comprising:
Second calculating sub module, the logical space that the virtual machine heap space capacity that can take at most during for running according to described application program and described virtual machine have taken calculates the spatial content of described segment space to be released;
First release submodule, for discharging described segment space according to calculating the described spatial content obtained.
14. virtual machines according to claim 12, is characterized in that, described space comprises the spatial content of described segment space to be released in releasing order, and described space release module, comprising:
Second release submodule, for discharging described segment space according to described spatial content.
15. 1 kinds of releases have taken the device of logical space, it is characterized in that, in the terminal that run application by virtual machine, described device comprises:
Processor;
For the storer of storage of processor executable instruction;
Wherein, described processor is configured to:
Detect described application program and whether receive enabled instruction;
If described application program receives described enabled instruction, then obtain the virtual machine heap space capacity that can take at most when described application program is run;
The virtual machine heap space capacity that can take at most when running according to described application program sends space to described virtual machine and releases order, and releases order and be used to indicate described virtual machine and discharge segment space in the logical space that described virtual machine taken in described space.
CN201510385845.1A 2015-06-30 2015-06-30 Method, device and virtual machine used to release occupied logic space Pending CN105094946A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510385845.1A CN105094946A (en) 2015-06-30 2015-06-30 Method, device and virtual machine used to release occupied logic space

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510385845.1A CN105094946A (en) 2015-06-30 2015-06-30 Method, device and virtual machine used to release occupied logic space

Publications (1)

Publication Number Publication Date
CN105094946A true CN105094946A (en) 2015-11-25

Family

ID=54575455

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510385845.1A Pending CN105094946A (en) 2015-06-30 2015-06-30 Method, device and virtual machine used to release occupied logic space

Country Status (1)

Country Link
CN (1) CN105094946A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105302579A (en) * 2015-11-27 2016-02-03 北京奇虎科技有限公司 System memory occupying method and system memory occupying device
CN111614985A (en) * 2020-05-09 2020-09-01 杭州国芯科技股份有限公司 Memory scheduling method for digital audio and video decoding equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101221536A (en) * 2008-01-25 2008-07-16 中兴通讯股份有限公司 Internal memory managing method and device of embedded system
US20100031270A1 (en) * 2006-08-01 2010-02-04 Gansha Wu Heap manager for a multitasking virtual machine
CN103279353A (en) * 2013-05-31 2013-09-04 新浪网技术(中国)有限公司 Method, device and system for determining application optimization strategies
CN103838633A (en) * 2012-11-20 2014-06-04 国际商业机器公司 Out-of-memory avoidance in dynamic virtual machine memory adjustment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100031270A1 (en) * 2006-08-01 2010-02-04 Gansha Wu Heap manager for a multitasking virtual machine
CN101221536A (en) * 2008-01-25 2008-07-16 中兴通讯股份有限公司 Internal memory managing method and device of embedded system
CN103838633A (en) * 2012-11-20 2014-06-04 国际商业机器公司 Out-of-memory avoidance in dynamic virtual machine memory adjustment
CN103279353A (en) * 2013-05-31 2013-09-04 新浪网技术(中国)有限公司 Method, device and system for determining application optimization strategies

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
LIWEI405499的专栏: "" 关于System/build.prop原始Dalvik虚拟机设定与调整"", 《HTTP://BLOG.CSDN.NET/LIWEI405499/ARTICLE/DETAILS/43408989》 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105302579A (en) * 2015-11-27 2016-02-03 北京奇虎科技有限公司 System memory occupying method and system memory occupying device
CN105302579B (en) * 2015-11-27 2019-05-21 北京奇虎科技有限公司 A kind of occupancy method and apparatus of Installed System Memory
CN111614985A (en) * 2020-05-09 2020-09-01 杭州国芯科技股份有限公司 Memory scheduling method for digital audio and video decoding equipment
CN111614985B (en) * 2020-05-09 2021-10-01 杭州国芯科技股份有限公司 Memory scheduling method for digital audio and video decoding equipment

Similar Documents

Publication Publication Date Title
CN108415739B (en) Hook method and device for dynamic link library function and storage medium
CN104991789B (en) Application program open method and device
CN104375828A (en) Method and device for optimizing memory
CN104536783B (en) Headspace method to set up and device
CN104156236A (en) Storage space saving method and device
CN104503740A (en) Memory management method and device
CN107291626A (en) Date storage method and device
CN104536935B (en) Calculate display methods, calculate edit methods and device
CN104298547A (en) Terminal setting method and device
CN104869569A (en) Network permission control method and apparatus of application program
CN104020990B (en) Date selects control display methods and device
CN104951335A (en) Processing method and device for application program installation packages
CN105487886A (en) Method and device for loading plugin
CN104407924A (en) Method and device for optimizing internal memory
CN104503690A (en) Arrangement method and device for application icons
CN104376075A (en) Data storage method and device
CN104615546A (en) File data management method and device
CN104951184A (en) Application program downloading method and device
CN105183571A (en) Function calling method and device
CN107391180A (en) Point screen method, apparatus and computer-readable recording medium
CN106547705A (en) USB (universal serial bus) operating mode control method and device
CN105094946A (en) Method, device and virtual machine used to release occupied logic space
CN107239236A (en) Method for writing data and device
CN105094608A (en) Task display method and device
CN104503881B (en) The method of handheld device consumption detection, device and handheld device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20151125