CN101751335B - Method, device and cluster system for collecting rubbish of scheduling virtual machine - Google Patents

Method, device and cluster system for collecting rubbish of scheduling virtual machine Download PDF

Info

Publication number
CN101751335B
CN101751335B CN200810179723.7A CN200810179723A CN101751335B CN 101751335 B CN101751335 B CN 101751335B CN 200810179723 A CN200810179723 A CN 200810179723A CN 101751335 B CN101751335 B CN 101751335B
Authority
CN
China
Prior art keywords
internal memory
use value
virtual machine
memory use
refuse collection
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.)
Expired - Fee Related
Application number
CN200810179723.7A
Other languages
Chinese (zh)
Other versions
CN101751335A (en
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.)
IBM China Co Ltd
Original Assignee
International Business Machines Corp
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 International Business Machines Corp filed Critical International Business Machines Corp
Priority to CN200810179723.7A priority Critical patent/CN101751335B/en
Publication of CN101751335A publication Critical patent/CN101751335A/en
Application granted granted Critical
Publication of CN101751335B publication Critical patent/CN101751335B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Memory System (AREA)

Abstract

The invention discloses a method, a device and a system for collecting rubbish of multiple scheduling virtual machines in a scheduling cluster environment. The scheduling method comprises the following steps: firstly, receiving internal memory use reports from the multiple virtual machines; then scheduling activities for collecting rubbish in the multiple virtual machines in the form of issuing tokens based on the received internal memory use reports.With the method and device of the invention adopted, synchronous rubbish collection of multiple virtual machines can be avoided, thus improving real-time property of the cluster system while basically not reducing internal memory use ratio.

Description

The method of the refuse collection of scheduling virtual machine, device and group system
Technical field
Present invention relates in general to coordinate the method and apparatus of the refuse collection between a plurality of application in the cluster environment, relate more specifically to initiatively dispatch refuse collection time method and device in a plurality of application in the cluster environment.
Background technology
(Garbage Collection, GC) mechanism is such as the total characteristic of the language of new generation of Java, C#, Python, Eiffel, Roby etc. in refuse collection.Through this Garbage Collection Mechanism, can manage recovery automatically to internal memory, come releasing memory and need not the programmer through call function, thereby alleviated programmer's programming burden.
At present, in large-scale application, adopt the application server of aggregated structure widely, as based on application server of Java, C# etc. such as telecommunication service.For example, Java language has advantages such as being easy to learn and writing, be independent of operating system, and current major applications server is to support the business based on Java based on the framework of Java, such as the Websphere Application Server of IBM Corporation.
The most important requirement of exploitation to such as the real-time application of telecommunication service is exactly the excellent real-time handling property, thereby time restriction has been forced in behavior when part moved.This type of some part that limits application programs is normally implemented, and such as interrupt handling routine, code that its response is interrupted must be finished the work in given time range.The application server middleware operates on the virtual machine that is provided with GC mechanism.Though GC mechanism has been simplified exploitation, has also brought a certain amount of system overhead simultaneously.Virtual machine can suspend all calculation process when carrying out refuse collection, this phenomenon also is called as " world suspend (Stop The World, STW) ", and the frequency and the duration of this " world's time-out " are all uncertain.This phenomenon can cause user's request responding time is increased, and for the demanding application of real-time of telecommunication applications etc., is unacceptable sometimes.
The problem of this in order to solve " world's time-out "; David F.Bacon, Perry Cheng and V.T.Rajan have proposed the Metronome algorithm (" A Real-timeGarbage Collector with Low Overhead and Consistent Utilization " to the Java application; Conference Record of the Thirtieth ACM Symposium on Principles ofProgramming Languages (New Orleans; Louisiana; January 2003), pp.285-298).In the Metronome algorithm, GC handled to be subdivided in a plurality of discontinuous minor time slices carry out, thereby shortened time of each " world's time-out ".Yet this GC method has reduced the service ability of memory usage and server.
As stated, present telecommunication applications all adopts aggregated structure basically, comprising a plurality of virtual machines.In cluster environment, a kind of method that solves " world's time-out " problem is that the service request of carrying out the virtual machine of GC is switched to the virtual machine that GC does not take place in the cluster.
With by Java Virtual Machine (Java Virtual Machine; JVM) cluster environment that constitutes is an example; The inventor finds that the configuration of the virtual machine in this cluster environment is often approximate, thereby a plurality of virtual machines that can occur in the cluster are tending towards almost synchronously taking place the situation that GC handles.This situation can be by Fig. 1 illustration.
Fig. 1 illustration in always having the Java Virtual Machine group system example of 4 Java Virtual Machines, the internal memory operating position of every Java Virtual Machine is over time.Visible by Fig. 1,4 Java Virtual Machines in the group system are tending towards synchronously carrying out GC along with the propelling of time.When GC almost takes place in all Java Virtual Machines synchronously in the cluster, can cause handling common service request, we claim that this situation is " (no place to hide) has nowhere to run ".In case occur " having nowhere to run ", will have a strong impact on the real-time performance of whole group system.Can conceive, the phenomenon of this synchronous GC can appear at all based in the cluster environment that application constituted with GC mechanism, for example, supports large-scale Application of C # cluster environment.The inventor believes that along with the widespread use of language in cluster environment that a new generation has Garbage Collection Mechanism, the problem of above-mentioned synchronous refuse collection will become and become increasingly conspicuous.
Therefore, be desirable to provide a kind of method and apparatus that can dispatch the refuse collection between a plurality of virtual machines in the cluster environment.
Summary of the invention
One object of the present invention is to provide a kind of method, device and group system of refuse collection that can scheduling virtual machine, and it has solved the problem of above-mentioned synchronous GC effectively.
The GC that coordinates these virtual machines opportunity that the present invention GC takes place through each virtual machine in the ACTIVE CONTROL cluster environment constantly, thereby avoid the above-mentioned synchronous GC problem that under passive GC situation, occurs.
In this article, the GC that triggers automatically because memory consumption reaches a maximal value in the virtual machine is called " passive GC " or " GC automatically ", and will be called " initiatively GC " through the GC that method and apparatus of the present invention initiatively is incorporated in the virtual machine.
In first aspect of the present invention, a kind of method that is used for controlling the scheduling of the refuse collection in a plurality of virtual machines of cluster environment is provided, comprising: receive from the internal memory operation report in said a plurality of virtual machines; And, dispatch the refuse collection in said a plurality of virtual machine based on the said internal memory operation report that receives.
In second aspect of the present invention; A kind of refuse collection scheduler that is used for a plurality of virtual machines under the cluster environment is provided; This refuse collection scheduler receives the internal memory operation report from said a plurality of virtual machines, and dispatches the refuse collection in said a plurality of virtual machine according to this internal memory operation report.
In the third aspect of the invention, a kind of group system is provided, comprising: a plurality of virtual machines, it has the annunciator that is used to send refuse collection report and internal memory operation report separately; The scheduling determiner, whether it has perhaps passed through scheduled time slot based on the refuse collection report from said a plurality of annunciators, determines whether to carry out the refuse collection scheduling; With the refuse collection scheduler; When said scheduling determiner confirms to carry out the refuse collection scheduling; This refuse collection scheduler receives the internal memory operation report from said a plurality of annunciators, and dispatches the refuse collection in the said a plurality of virtual machines in this group system based on this internal memory operation report.
The present invention coordinates so that avoid occurring the synchronous refuse collection of a plurality of virtual machines through initiatively dispatching the refuse collection in a plurality of virtual machines in the cluster environment.
Utilize method and apparatus of the present invention, avoided occurring synchronous refuse collection between a plurality of virtual machines, thereby improved the real-time performance of group system, can not reduce memory usage basically simultaneously.
Description of drawings
With reference to the detailed description of accompanying drawing, will understand above better and other example purposes, aspect and advantage according to following to exemplary embodiment of the invention.
Fig. 1 is that illustration goes out the curve map that the instance of synchronous refuse collection takes place between a plurality of Java Virtual Machines;
Fig. 2 shows the process flow diagram according to the refuse collection dispatch control method of the embodiment of the invention;
Fig. 3 shows the process flow diagram according to the processing of the target internal memory use value of each Java Virtual Machine of calculating of the embodiment of the invention;
Fig. 4 A and Fig. 4 B show the process flow diagram of handling in the Java Virtual Machine according to the embodiment of the invention;
Fig. 5 is illustrated in the Java Virtual Machine cluster topology instance shown in Figure 1, has used the method for the present invention internal memory use afterwards and the chart of refuse collection scheduling situation;
The internal memory use value that Fig. 6 shows 4 Java Virtual Machines among Fig. 5 with the form of curve map over time;
Fig. 7 shows the block diagram according to the group system with refuse collection scheduling feature of the embodiment of the invention; With
Fig. 8 shows the block diagram according to the refuse collection scheduler of the embodiment of the invention.
Embodiment
Should be appreciated that accompanying drawing of the present invention simplifies with describing, help to be expressly understood step of the present invention or parts, from purpose clearly, removed other steps or parts in the typical software analysis technology simultaneously with illustration.Those skilled in the art will recognize that, for embodiment of the present invention, other steps or parts be hope and/or be essential.Yet, because these steps or parts are known in the field, and owing to they do not help understand the present invention better, so do not provide the description about them among this paper.It is also understood that the included accompanying drawing of this paper has only provided the diagrammatic representation for current embodiment of the present invention, fall into step or parts in the scope of the present invention and can comprise and be different from step shown in these accompanying drawings or parts.With quoted figures, wherein give similar Reference numeral below to similar step or parts.
As stated, refuse collection synchronously possibly be to be applied to the problem that the language with Garbage Collection Mechanism in the cluster environment will face jointly.Start from clearly illustration the object of the invention, hereinafter will be applied as example with Java particularly and specify embodiments of the invention.Fig. 2 shows the process flow diagram according to refuse collection dispatch control method of the present invention of the group system of (n is a positive integer) the individual Java Virtual Machine that is applied to have n.At first; At step 202 place; N from cluster environment Java Virtual Machine receives the refuse collection report; Comprise refuse collection type (that is initiatively refuse collection or passive refuse collection), the refuse collection generation moment, refuse collection execution duration, the internal memory use value when triggering refuse collection and the relevant informations such as internal memory use value after the refuse collection in this refuse collection report.Then; At step 204 place; For example be based on the refuse collection report that step 202 place receives; Judged whether to occur the individual Java Virtual Machine of predetermined quantity m (m is the positive integer that is less than or equal to n) according to predetermined criterion the trend of synchronous refuse collection has taken place, thereby determined whether and to dispatch the refuse collection of Java Virtual Machine in this group system.This predetermined quantity m confirms according to the general requirement of system performance.For example, total total n=7 platform virtual machine in the group system, if wherein 3 almost carry out refuse collection simultaneously and will cause satisfying application requirements, then can be set to 3 by this predetermined quantity m.Certainly, this predetermined quantity m also can be made as the Java Virtual Machine sum n that equals in the group system.
Above-mentioned predetermined criterion for example can be to calculate the time interval of between each Java Virtual Machine refuse collection taking place successively in the cluster environment; And when the time interval value of the m in these time intervals is less than or equal to a predetermined time interval value, judge the trend that synchronous refuse collection occurs.Wherein said predetermined time interval value can be according to the cluster environment framework, be provided with professional factors such as requirement are provided, and also can take the practical experience value.The above-mentioned method that the refuse collection time interval between each Java Virtual Machine and a predetermined time interval value are compared only is exemplary, it will be appreciated by those skilled in the art that any other judgment criterion that is fit to all is feasible.In addition, in the above-described embodiments, be to start refuse collection scheduling controlling of the present invention in step 204, but dispatching method of the present invention also can regularly be carried out through detecting synchronous refuse collection trend.For example; According to system's actual conditions; For example through investigating the average period that synchronous trend appears in a plurality of Java Virtual Machines in this group system; Set a scheduled time slot, in step 204, whether passed through this scheduled time slot apart from refuse collection scheduling last time, thereby determine whether to carry out the refuse collection scheduling through monitoring.
If confirm not carry out the refuse collection scheduling at step 204 place, then turn back to step 202, continue to receive the refuse collection report.And if confirm to want operation dispatching at step 204 place, then start the refuse collection dispatch control method of the present invention shown in the frame of broken lines among Fig. 2, implement initiatively refuse collection intervention.Particularly, at step 206 place, the n from cluster environment Java Virtual Machine receives the internal memory operation report, and this internal memory operation report comprises the current internal memory use value of Java Virtual Machine.Next, play step 322,, carry out scheduling particularly the refuse collection of each Java Virtual Machine in the cluster environment based on this internal memory operation report that receives from step 208.In the embodiment shown in Figure 2, at step 208 place, calculate the corresponding target internal memory of each Java Virtual Machine use value, and desired value is assigned to corresponding Java Virtual Machine.Hereinafter will describe target internal memory use value how to calculate each Java Virtual Machine in detail with reference to Fig. 3.
Then, at step 210 place,, judge that whether its current internal memory use value is more than or equal to target internal memory use value to each Java Virtual Machine.If the current internal memory use value that has no a Java Virtual Machine is more than or equal to its corresponding target internal memory use value; Then receive next Java Virtual Machine internal memory operation report (step 212) constantly, continue the internal memory use value at execution in step 210 places then and judge.The reception internal memory operation report at repeated execution of steps 212 places and the judgement at step 210 place, up to the internal memory use value that Java Virtual Machine is arranged more than or equal to target internal memory use value.
When the internal memory use value that detects Java Virtual Machine at step 210 place during more than or equal to target internal memory use value, at step 214 place, put it in the formation, provide token to wait for.At step 216 place, whether inspection has available token then.If there is not available tokens, then at step 218 place, this situation is recorded in the daily record and reports, wait for that then token returns (step 220).And if judgement has available tokens at step 216 place, then at step 222 place, from formation, read the Java Virtual Machine of waiting to provide token, and it is provided token.To explain how Java Virtual Machine carries out the operation of refuse collection receiving this order bridge queen with reference to Fig. 4 B in the back literary composition.
Here; Need to prove; To the token number of group system can be the quantity n that considers the Java Virtual Machine in this group system, the predetermined quantity m and the user that set when being used to judge synchronous refuse collection trend set performance demands, it can be one or more less than the sum of Java Virtual Machine.For example, in telecommunication service, the user requires high to the real-time performance of system, and the Java Virtual Machine that does not then allow to carry out simultaneously refuse collection is too many.On the other hand; If the token number that is provided with very little; Then for larger cluster environment; Can cause waiting in the formation that the Java Virtual Machine of providing token is too much, can cause the Java Virtual Machine of these waits before the token granting, passive refuse collection just to take place when serious, make dispatching effect of the present invention reduce greatly.
To target internal memory use value how to calculate each Java Virtual Machine be described with reference to Fig. 3 below.At first, at step 302 place, the internal memory use value that comprises in the internal memory operation report from each Java Virtual Machine that receives according to the place of the step 206 in Fig. 2 is calculated the corresponding memory consumption rate of each Java Virtual Machine.Then at step 304 place, according to the current internal memory use value of ascending each Java Virtual Machine of series arrangement.
Then; At step 306 place; The target internal memory use value of the Java Virtual Machine that the maximum memory use value Ha of the automatic triggering refuse collection that comprises in the refuse collection report that receives according to step 202 place at Fig. 2 is set to make number one, this Java Virtual Machine that makes number one is that Java Virtual Machine of current internal memory use value minimum in the said n Java Virtual Machine.Need to prove that in this embodiment, the maximum memory use value Ha when passive refuse collection takes place is set to the target internal memory use value of the minimum Java Virtual Machine of current internal memory use value.Yet the initiatively target internal memory use value of refuse collection takes place as Java Virtual Machine in any other fit values that also can be provided with less than this maximum memory use value Ha.From the angle of maximization memory usage, select near or to be slightly less than the target internal memory use value of maximum memory use value of passive refuse collection more favourable.
Then, at step 308 place, follow following formula and calculate the corresponding target internal memory of the Java Virtual Machine that comes next bit use value hJ k:
(hJ k-h k)/Rh k=(hJ K-1-h K-1)/Rh K-1-F (hJ k)-Tg, n>K>=2 formulas 1
Wherein, n is the Java Virtual Machine sum in the cluster environment,
HJ kThe target internal memory use value of the Java Virtual Machine that comes the k position of indicating to calculate,
HJ K-1The target internal memory use value of the Java Virtual Machine that comes the k-1 position that expression has been set or calculated,
h kAnd h K-1The current internal memory use value of representing the Java Virtual Machine of k position and k-1 position respectively,
Rh kAnd Rh K-1Be illustrated respectively in the memory consumption rate of the Java Virtual Machine of k position that step 302 place calculates and k-1 position,
Tg is the minimum time interval between the adjacent refuse collection, this parameter can be based on the user to the requirement of system performance and definite and
F (hJ k) represent to reach hJ when the internal memory use value kThe time, carry out refuse collection institute's time spent, the refuse collection that this parameter is comprised in for example can reporting according to the refuse collection that the place of the step 202 in Fig. 2 receives is carried out duration and is confirmed.
Then, at step 310 place, judged whether to calculate the target internal memory use value of all Java Virtual Machines.If confirm to calculate, then turn back in the scheduling flow shown in Fig. 2 to all Java Virtual Machines.Otherwise, turn back to step 308 place, continue to calculate target internal memory use value, up to the target internal memory use value of having calculated all Java Virtual Machines to other Java Virtual Machines.
The target internal memory use value of utilizing the algorithm computation shown in Fig. 3 to obtain makes and can dispatch the refuse collection of each Java Virtual Machine in time basically equably, and can guarantee the utilization rate maximization of memory source.Here need to prove that the algorithm of aforementioned calculation target internal memory use value only is an exemplary, the present invention is not limited to this.Those skilled in the art are according to the teacher of this instructions, and can understand other modification that are fit to fully all is feasible with changing.For example, can select to make the target internal memory use value computational algorithm that the refuse collection of each Java Virtual Machine anisotropically takes place in time.In addition, also can be according to (hJ k-h k)/Rh k<(hJ K-1-h K-1)/Rh K-1-F (hJ k)-Tg selects the target internal memory use value of k position Java Virtual Machine, and even now can cause the waste to a certain degree of memory source.Even; Under the situation of not taking into account system memory source utilization rate and system's real-time response performance; Arbitrary or several Java Virtual Machines in can the picked at random cluster environment be set at the arbitrary value that is less than or equal to maximum memory use value Ha with their target internal memory use value.
Explain in the Java Virtual Machine according to the embodiment of the invention with reference to Fig. 4 A and Fig. 4 B below and handle.In the present invention, Java Virtual Machine need be monitored its internal memory and used, and regularly sends the internal memory operation report.Thereby when synchronous refuse collection not taking place do not carry out refuse collection and initiatively dispatch, the processing in the Java Virtual Machine is shown in Fig. 4 A.Along with internal memory is constantly consumed, and trigger refuse collection, i.e. refuse collection (step 402) passively.After the refuse collection,, send the refuse collection report at step 404 place, with the type of reporting this refuse collection, constantly, carry out duration, the internal memory use value that triggers refuse collection and the internal memory use value after the refuse collection.
And under the situation that the scheduling of the refuse collection in having carried out Fig. 2 and Fig. 3 is handled, shown in Fig. 4 B, Java Virtual Machine at first receives token at step 412 place, then carries out initiatively refuse collection (step 414).Similar with the step 404 among Fig. 4 A, Java Virtual Machine sends the refuse collection report at step 416 place.Then, this Java Virtual Machine that initiatively refuse collection takes place returns token to (step 418).Thereby, accomplished once initiatively garbage collection process.
Fig. 5 shows method of the present invention internal memory use and the refuse collection scheduling situation afterwards of having used with Java Virtual Machine cluster topology instance shown in Figure 1.In Java Virtual Machine group system shown in Figure 5, suppose always to have 4 Java Virtual Machine JVM1, JVM2, JVM3 and JVM4.As shown in Figure 1, when detecting 4 Java Virtual Machines in this cluster environment at step 204 place shown in Figure 2 and the trend of synchronous refuse collection occurred, start refuse collection scheduling of the present invention and handle.In this example, set that to begin to carry out the moment that the refuse collection scheduling handles be 0.
At first, shown in step 206, receive internal memory operation report separately from 4 Java Virtual Machines.The internal memory use value of supposing JVM1, JVM2, JVM3 and JVM4 current (that is, 0 locates constantly) is respectively 100,100,110 and 120, and their memory consumption rate is Rh=50M/s (million/second).In this example, suppose the maximum memory use value Ha=950M of automatic triggering refuse collection, this maximal value Ha is distributed to JVM1 as its target internal memory use value hJ1.According to user's request, the time interval of adjacent refuse collection is set to Tg=3s, and in this example, setting token number is 1.In addition, from the purpose that clearly demonstrates, suppose that it is F (h)=1s that each Java Virtual Machine carries out the required time average of refuse collection under corresponding target internal memory use value.Next, according to above-mentioned formula 1, the target internal memory use value hJ2, hJ3 and the hJ4 that calculate JVM2, JVM3 and JVM4 successively are respectively 750M, 560M and 370M, shown in first row in the chart of Fig. 5 (0 constantly).
Shown in Fig. 5 second row, when implementing the 5th second, the internal memory use value of JVM4 has reached its desired value hJ4=370M.Thus, provide token to this JVM4, trigger refuse collection among the JVM4 thereby be shown in like Fig. 4 B, JVM4 returns token and sends refuse collection report then.After F (h)=1s is carried out in refuse collection, located at the 6th second, see that the current internal memory use value of carrying out refuse collection JVM4 afterwards is 50M.From this constantly, JVM4 gets into the automatic garbage collection treatment scheme shown in Fig. 4 A.As time goes on, located at the 9th second, the 13rd second respectively, find that the internal memory use value of JVM3 and JVM2 has reached corresponding desired value hJ3=560M and hJ2=750M.Thus, in JVM3 and JVM2, carry out initiatively refuse collection respectively, make and located at the 10th second and the 14th second respectively that the internal memory use value among JVM3 and the JVM2 is 50M, and begins to get into the automatic garbage collection treatment scheme.At last, located at the 17th second, JVM1 has reached its target internal memory use value hJ1=950M, thereby carries out refuse collection.The data of the 18th second that delegation are visible from Fig. 5, through above-mentioned refuse collection scheduling, make the current internal memory use value difference of JVM1, JVM2, JVM3 and JVM4 open, thereby slackened the possibility that synchronous refuse collection occurs effectively.The internal memory use value time history plot of JVM1, JVM2, JVM3 and JVM4 more clearly show that among Fig. 6, dispatches processing through refuse collection of the present invention, thereby has avoided the generation of synchronous refuse collection.
Fig. 7 shows the block diagram according to the group system with refuse collection scheduling feature 700 of the embodiment of the invention.As shown in the figure, in this group system 700, have n Java Virtual Machine JVM1 to JVMn.All has the annunciator that is used to send refuse collection report and internal memory operation report in every Java Virtual Machine.This group system 700 also comprises scheduling determiner 740 and refuse collection (GC) scheduler 720.This scheduling determiner 740 receives the refuse collection report from the annunciator of each among the JVM1 to JVMn, and according to determining whether to carry out the refuse collection scheduling based on this refuse collection report shown in the step 204 among Fig. 2.When scheduling determiner 740 confirms to carry out the refuse collection scheduling, send dispatch command to refuse collection scheduler 720.Refuse collection scheduler 720 receives the internal memory operation report from a said n annunciator behind the dispatch command that receives self scheduling determiner 740, and dispatches the refuse collection between the JVM1 to JVMn based on this internal memory operation report.
Fig. 8 shows the block diagram of the configuration of refuse collection scheduler 720.This refuse collection scheduler 720 comprises target internal memory use value controller 810 and token controller 820.This target internal memory use value controller 810 is used for calculating and distributes corresponding target internal memory use value to each of JVM1 to JVMn.The target internal memory use value that token controller 820 based target internal memory use value controllers 810 calculate is carried out control; Providing token greater than the Java Virtual Machine of the corresponding target internal memory use value that obtains by target internal memory use value controller, thereby allow it to carry out refuse collection to current internal memory use value.
Particularly, target internal memory use value controller 810 comprises: memory consumption rate counter 812 is used for according to the said internal memory operation report that receives the memory consumption rate of each among the calculating JVM1 to JVMn; Sorting unit 814 is used for the current internal memory use value according to ascending series arrangement JVM1 to JVMn; With target internal memory use value counter 816; The maximum memory use value that is used for triggering automatically refuse collection is set at the target internal memory use value of the Java Virtual Machine that makes number one; This Java Virtual Machine that makes number one is that minimum Java Virtual Machine of current internal memory use value in the said n Java Virtual Machine, and this target internal memory use value counter 816 is also followed above-mentioned formula 1 and calculated the corresponding target internal memory of other Java Virtual Machines use value.And token controller 820 comprises: token number setting device 822 is used to consider that Java Virtual Machine quantity n and user to performance demands, set the token number in this cluster environment; With token dispensing apparatus 824; Be used for current internal memory use value is put into a formation greater than the Java Virtual Machine of the corresponding target internal memory use value of being distributed by said target internal memory use value controller; And several Java Virtual Machines of token that being less than or equal to of in formation, waiting for successively set by said token number setting device 822 provide tokens, carry out refuse collection to allow it.
Should be noted that the refuse collection scheduler shown in Fig. 8 only is exemplary.Those skilled in the art are through reading the description to Fig. 2 to Fig. 6, can envision the refuse collection scheduler that comprises the module of the function of step shown in these figure of realization.
Provided above description from illustration and illustrative purposes to various aspects of the present invention.This is not to be intended to exhaustive or to limit the invention to disclosed precise forms, and obviously can much revise and change.For example, the various appropriate combination of step among above-mentioned a plurality of embodiment and module also are feasible.
Be applied as example with Java hereinbefore refuse collection dispatching method of the present invention and device have been described; Yet those skilled in the art can conceive fully; Method and apparatus of the present invention also can be applicable to have in the application of Garbage Collection Mechanism based on other, for example in the application based on C#.In addition; The method and apparatus of the refuse collection of the scheduling Java Virtual Machine of the embodiment of the invention can be applied to any application server based on Java; Be particularly useful for the demanding application system of real-time performance, and be not limited to particular system disclosed in this specification.In addition, it should be appreciated by those skilled in the art that alleged among this paper " token " can be signal, instruction, operation or other suitable forms.
Therefore, should be appreciated that the present invention is not limited to above disclosed specific embodiment, and be intended to cover modification and the modification that limits following claim.

Claims (13)

1. group system comprises:
A plurality of virtual machines, it has the annunciator that is used to send refuse collection report and internal memory operation report separately;
The scheduling determiner, whether it has perhaps passed through scheduled time slot based on the refuse collection report from said a plurality of annunciators, determines whether to carry out the refuse collection scheduling; And
The refuse collection scheduler; When said scheduling determiner confirms to carry out the refuse collection scheduling; This refuse collection scheduler receives the internal memory operation report from said a plurality of annunciators; And the refuse collection of dispatching the said a plurality of virtual machines in this group system based on this internal memory operation report, wherein, said refuse collection scheduler comprises:
Target internal memory use value controller is used for calculating and distributes corresponding target internal memory use value to each of said a plurality of virtual machines; With
Token controller is used to carry out control providing token to current internal memory use value greater than the virtual machine of the corresponding target internal memory use value that is obtained by target internal memory use value controller, thereby allows it to carry out refuse collection.
2. group system according to claim 1, wherein, said target internal memory use value controller comprises:
Memory consumption rate counter is used for calculating the memory consumption rate Rh of said a plurality of virtual machines according to the said internal memory operation report that receives;
Sorting unit is used for the current internal memory use value according to the ascending said a plurality of virtual machines of series arrangement; With
Target internal memory use value counter; The maximum memory use value that is used for triggering automatically refuse collection is set at the target internal memory use value of the virtual machine that makes number one; This virtual machine that makes number one is that minimum virtual machine of current internal memory use value in said a plurality of virtual machine, and this target internal memory use value counter is also followed following formula and calculated the corresponding target internal memory of other virtual machines use value:
(hJ k-h k)/Rh k=(hJ k-1-h k-1)/Rh k-1-F(hJ k)-Tg,
Wherein, hJ kThe target internal memory use value of the virtual machine that comes the k position of indicating to calculate,
HJ K-1Expression comes the target internal memory use value of the virtual machine of k-1 position,
h kAnd h K-1The current internal memory use value of representing the virtual machine of k position and k-1 position respectively,
Rh kAnd Rh K-1The memory consumption rate of the k position of representing respectively to calculate and the virtual machine of k-1 position by memory consumption rate counter,
Tg be between the adjacent refuse collection minimum time interval and
F (hJ k) represent to reach hJ when the internal memory use value kThe time, carry out refuse collection institute's time spent.
3. group system according to claim 1, wherein, said token controller comprises:
The token number setting device is used to consider that virtual machine quantity and user to performance demands, set the token number in this cluster environment; With
The token dispensing apparatus; Be used for current internal memory use value is put into a formation greater than the virtual machine of the corresponding target internal memory use value of being distributed by said target internal memory use value controller; And several virtual machines of token that being less than or equal to of in formation, waiting for successively set by said token number setting device provide tokens, carry out refuse collection to allow it.
4. according to each described group system in the claim 1 to 3, wherein, said virtual machine is Java Virtual Machine or C# virtual machine.
5. refuse collection scheduler that is used for a plurality of virtual machines under the cluster environment; This refuse collection scheduler receives the internal memory operation report from said a plurality of virtual machines; And dispatch the refuse collection between said a plurality of virtual machine based on this internal memory operation report, comprising:
Target internal memory use value controller is used for calculating and distributes corresponding target internal memory use value to each of said a plurality of virtual machines; With
Token controller is used to carry out control providing token to current internal memory use value greater than the virtual machine of the corresponding target internal memory use value that is obtained by target internal memory use value controller, thereby allows it to carry out refuse collection.
6. refuse collection scheduler according to claim 5, wherein, said target internal memory use value controller comprises:
Memory consumption rate counter is used for calculating the memory consumption rate Rh of said a plurality of virtual machines according to the said internal memory operation report that receives;
Sorting unit is used for the current internal memory use value according to the ascending said a plurality of virtual machines of series arrangement; With
Target internal memory use value counter; The maximum memory use value that is used for triggering automatically refuse collection is set at the target internal memory use value of the virtual machine that makes number one; This virtual machine that makes number one is that minimum virtual machine of current internal memory use value in said a plurality of virtual machine, and this target internal memory use value counter is also followed following formula and calculated the corresponding target internal memory of other virtual machines use value:
(hJ k-h k)/Rh k=(hJ k-1-h k-1)/Rh k-1-F(hJ k)-Tg,
Wherein, hJ kThe target internal memory use value of the virtual machine that comes the k position of indicating to calculate,
HJ K-1Expression comes the target internal memory use value of the virtual machine of k-1 position,
h kAnd h K-1The current internal memory use value of representing the virtual machine of k position and k-1 position respectively,
Rh kAnd Rh K-1The memory consumption rate of the k position of representing respectively to calculate and the virtual machine of k-1 position by memory consumption rate counter,
Tg be between the adjacent refuse collection minimum time interval and
F (hJ k) represent to reach hJ when the internal memory use value kThe time, carry out refuse collection institute's time spent.
7. refuse collection scheduler according to claim 5, wherein, said token controller comprises:
The token number setting device is used to consider that virtual machine quantity and user to performance demands, set the token number in this cluster environment; With
The token dispensing apparatus; Be used for current internal memory use value is put into a formation greater than the virtual machine of the corresponding target internal memory use value of being distributed by said target internal memory use value controller; And several virtual machines of token that being less than or equal to of in formation, waiting for successively set by said token number setting device provide tokens, carry out refuse collection to allow it.
8. according to each described refuse collection scheduler in the claim 5 to 7, wherein, said virtual machine is Java Virtual Machine or C# virtual machine.
9. method that is used for controlling the scheduling of the refuse collection in a plurality of virtual machines of cluster environment comprises:
Reception is from the internal memory operation report of said a plurality of virtual machines; And
Based on the said internal memory operation report that receives, dispatch the refuse collection in said a plurality of virtual machine, wherein said scheduling step comprises:
Calculate and in said a plurality of virtual machines each is distributed corresponding target internal memory use value; With
Provide token to current internal memory use value greater than the virtual machine of its corresponding target internal memory use value, carry out refuse collection to allow it.
10. method according to claim 9, wherein, said calculating also distributes the step of target internal memory use value to comprise:
According to the said internal memory operation report that receives, calculate the memory consumption rate Rh of said a plurality of virtual machines;
Current internal memory use value according to the ascending said a plurality of virtual machines of series arrangement;
Automatically the maximum memory use value that triggers refuse collection is set at the target internal memory use value of the virtual machine that makes number one, and this virtual machine that makes number one is that minimum virtual machine of current internal memory use value in said a plurality of virtual machine; And
Follow following formula and calculate the corresponding target internal memory of other virtual machines use value:
(hJ k-h k)/Rh k=(hJ k-1-h k-1)/Rh k-1-F(hJ k)-Tg,
Wherein, hJ kThe target internal memory use value of the virtual machine that comes the k position of indicating to calculate,
HJ K-1Expression comes the target internal memory use value of the virtual machine of k-1 position,
h kAnd h K-1The current internal memory use value of representing the virtual machine of k position and k-1 position respectively,
Rh kAnd Rh K-1The memory consumption rate of the virtual machine of the k position that calculates of expression and k-1 position respectively,
Tg be between the adjacent refuse collection minimum time interval and
F (hJ k) represent to reach hJ when the internal memory use value kThe time, carry out refuse collection institute's time spent.
11. method according to claim 9, wherein, said token issue step comprises:
Consider that virtual machine quantity and user to performance demands, set the token number in this cluster environment; With
Current internal memory use value is put into a formation greater than the virtual machine of the corresponding target internal memory use value of being distributed, and several virtual machines of in formation, waiting for successively of said token that are less than or equal to provide tokens, carry out refuse collection to allow it.
12. method according to claim 9 also comprises the steps: perhaps whether passed through scheduled time slot based on the refuse collection report from said a plurality of virtual machines, determine whether to carry out the refuse collection scheduling.
13. according to each described method in the claim 9 to 12, wherein, said virtual machine is Java Virtual Machine or C# virtual machine.
CN200810179723.7A 2008-11-28 2008-11-28 Method, device and cluster system for collecting rubbish of scheduling virtual machine Expired - Fee Related CN101751335B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN200810179723.7A CN101751335B (en) 2008-11-28 2008-11-28 Method, device and cluster system for collecting rubbish of scheduling virtual machine

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN200810179723.7A CN101751335B (en) 2008-11-28 2008-11-28 Method, device and cluster system for collecting rubbish of scheduling virtual machine

Publications (2)

Publication Number Publication Date
CN101751335A CN101751335A (en) 2010-06-23
CN101751335B true CN101751335B (en) 2012-01-18

Family

ID=42478341

Family Applications (1)

Application Number Title Priority Date Filing Date
CN200810179723.7A Expired - Fee Related CN101751335B (en) 2008-11-28 2008-11-28 Method, device and cluster system for collecting rubbish of scheduling virtual machine

Country Status (1)

Country Link
CN (1) CN101751335B (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101986285B (en) * 2010-11-03 2012-09-19 华为技术有限公司 Virtual machine storage space management method, system and physical host
US8850156B2 (en) 2010-11-03 2014-09-30 Huawei Technologies Co., Ltd. Method and system for managing virtual machine storage space and physical host
CN102023896A (en) * 2010-12-20 2011-04-20 复旦大学 Dispatcher of Java virtual machine-based concurrent garbage collector
CN102075434B (en) * 2011-01-28 2012-07-04 华中科技大学 Communication method in virtual cluster
GB2502076A (en) 2012-05-15 2013-11-20 Ibm Managing memory in a computer system
CN103324516B (en) * 2013-07-04 2017-02-08 曙光信息产业(北京)有限公司 Virtualization-driven hardware management method and device
CN108255582B (en) * 2018-01-16 2021-02-02 携程旅游信息技术(上海)有限公司 Method, system, equipment and storage medium for garbage recovery of java virtual machine
CN108566415A (en) * 2018-03-12 2018-09-21 广东睿江云计算股份有限公司 A kind of Distributed concurrency control method based on web
CN111949377B (en) * 2020-08-25 2021-08-31 深圳市广通软件有限公司 JVM parameter optimization method, device, server and storage medium for WEB middleware

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1790270A (en) * 2005-12-14 2006-06-21 浙江大学 Java virtual machine implementation method supporting multi-process
CN1952898A (en) * 2005-03-14 2007-04-25 Qnx软件操作系统公司 Adaptive partitioning process scheduler
US7380039B2 (en) * 2003-12-30 2008-05-27 3Tera, Inc. Apparatus, method and system for aggregrating computing resources

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7380039B2 (en) * 2003-12-30 2008-05-27 3Tera, Inc. Apparatus, method and system for aggregrating computing resources
CN1952898A (en) * 2005-03-14 2007-04-25 Qnx软件操作系统公司 Adaptive partitioning process scheduler
CN1790270A (en) * 2005-12-14 2006-06-21 浙江大学 Java virtual machine implementation method supporting multi-process

Also Published As

Publication number Publication date
CN101751335A (en) 2010-06-23

Similar Documents

Publication Publication Date Title
CN101751335B (en) Method, device and cluster system for collecting rubbish of scheduling virtual machine
CN102576331B (en) System and method for synchronizing transient resource usage between virtual machines in a hypervisor environment
CN102902582B (en) Managing process in suspended state and executing state
CN102902583B (en) Managing process under suspended state and executing state
CN111338791A (en) Method, device and equipment for scheduling cluster queue resources and storage medium
CN105378668B (en) The interruption of operating system management in multicomputer system guides
CN103744808B (en) A kind of method and apparatus for being used to control I/O to ask
CN102339253B (en) Be used to indicate the system and method for the execution of application code
CN103299279A (en) Resource scheduling method and device
CN110222263A (en) Application maintenance control method, device, server, terminal and storage medium
CN110347407A (en) A kind of method, apparatus, computer equipment and medium obtaining EMS memory occupation amount
CN103346902A (en) Method and system for data collection and scheduling
WO2012006920A1 (en) System and method for self-adaptive garbage object collection
CN103645961A (en) Anomaly detection method and system for calculating intensive parallel tasks
CN107368351B (en) Automatic upgrading and capacity expanding method and device for virtual machine configuration
CN105528315B (en) A kind of hard disk IO manufacture timeout control methods and device
CN111459815B (en) Real-time computing engine testing method and system
CN109598070A (en) A kind of Time Series Forecasting Methods and platform
CN105357026A (en) Resource information collection method and computing node
CN116089477B (en) Distributed training method and system
CN107590060A (en) A kind of analysis method and device of terminal interim card
CN105929851B (en) It is a kind of that holder method and apparatus are controlled using rocking bar equipment
EP3607452A1 (en) Apparatus and method of behavior forecasting in a computer infrastructure
CN103176836A (en) Calculation apparatus, calculation method and recording medium of calculation program
CN102203730A (en) Method and device for choosing open application programming interface (openapi)

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
ASS Succession or assignment of patent right

Owner name: IBM (CHINA) CO., LTD.

Free format text: FORMER OWNER: INTERNATIONAL BUSINESS MACHINES CORPORATION

Effective date: 20121029

C41 Transfer of patent application or patent right or utility model
COR Change of bibliographic data

Free format text: CORRECT: ADDRESS; TO: 201203 PUDONG NEW AREA, SHANGHAI

TR01 Transfer of patent right

Effective date of registration: 20121029

Address after: 201203 Shanghai city Pudong New Area Keyuan Road No. 399 Zhang Jiang Zhang Jiang high tech Park Innovation Park 10 Building 7 layer

Patentee after: International Business Machines (China) Co., Ltd.

Address before: American New York

Patentee before: International Business Machines Corp.

CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20120118

Termination date: 20171128