WO2013008450A1 - 仮想計算機システム、メモリ管理方法、メモリ管理プログラム、記録媒体および集積回路 - Google Patents

仮想計算機システム、メモリ管理方法、メモリ管理プログラム、記録媒体および集積回路 Download PDF

Info

Publication number
WO2013008450A1
WO2013008450A1 PCT/JP2012/004436 JP2012004436W WO2013008450A1 WO 2013008450 A1 WO2013008450 A1 WO 2013008450A1 JP 2012004436 W JP2012004436 W JP 2012004436W WO 2013008450 A1 WO2013008450 A1 WO 2013008450A1
Authority
WO
WIPO (PCT)
Prior art keywords
virtual machine
memory
memory area
access
virtual
Prior art date
Application number
PCT/JP2012/004436
Other languages
English (en)
French (fr)
Inventor
哲士 山本
Original Assignee
パナソニック株式会社
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 パナソニック株式会社 filed Critical パナソニック株式会社
Priority to CN201280002859.5A priority Critical patent/CN103098028B/zh
Priority to JP2013502937A priority patent/JP5864534B2/ja
Priority to US13/814,589 priority patent/US9176781B2/en
Publication of WO2013008450A1 publication Critical patent/WO2013008450A1/ja

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory

Definitions

  • the present invention relates to a virtual machine system, and more particularly to a technique for reducing the use amount of a memory area in a system that generates and operates an operating system (OS) as an execution environment of an application program as needed.
  • OS operating system
  • an object of the present invention is to provide a virtual computer system that prevents a physical memory area from being unnecessarily secured by copy-on-write processing.
  • a virtual computer system is a virtual computer system that generates one or more second virtual machines by duplicating a first virtual machine, For each of one or more memory areas that can be accessed by the first virtual machine, any one of the first virtual machine and the one or more second virtual machines after generation of the one or more second virtual machines Until the virtual machine has write access until the virtual machine has a write access to the management means that can manage read access from each virtual machine and each memory area that is managed by the management means. Does not need to retain the memory contents before the write access for future access by a virtual machine other than the virtual machine that performed the write access.
  • a determination unit that determines whether or not the memory cell is a fixed memory region, a first detection device that detects the write access to the specific memory region, and after the write access is detected by the first detection device
  • a second detection unit that detects that a virtual machine other than the virtual machine that has performed the write access attempts to access the specific type memory area; and the second detection unit attempts to access the specific type memory area.
  • a memory allocating unit for newly acquiring a memory area as an access target and allocating the virtual machine.
  • FIG. 3 is a diagram schematically illustrating a state when a virtual machine is replicated by the virtual computer system 1. It is a figure which shows a process when any virtual machine has write access to the physical memory area to which classification value "1" was attached, and is a figure which shows a 1st memory process typically. It is a figure which shows a process when a virtual machine carries out write access to the memory area to which classification value "5" was attached, and is a figure which shows a new memory allocation process typically.
  • 1 is a functional configuration diagram of a virtual machine system 1 according to Embodiment 1.
  • FIG. 3 is a diagram illustrating a data configuration and an example of contents of an OS memory management table 14.
  • FIG. 1 is a functional configuration diagram of a virtual machine system 1 according to Embodiment 1.
  • FIG. 3 is a diagram illustrating a data configuration and an example of contents of an OS memory management table 14.
  • FIG. 6 is a diagram showing a data configuration and example contents of a virtual machine memory management table 311.
  • FIG. It is a figure which shows the data structure and content example of the access control table 310.
  • 3 is a functional configuration diagram of a memory allocation processing unit 35.
  • FIG. FIG. 11 is a diagram showing an access control table 310 after the first memory process is completed when a virtual machine A10 first receives a write access after virtual machine replication.
  • 4 is a flowchart showing memory classification processing by a memory classification unit 21 of the virtual machine system 1.
  • 4 is a flowchart showing memory allocation processing by a memory allocation processing unit 35 of the virtual machine system 1.
  • 4 is a flowchart showing first memory processing by a first memory processing unit 63 of the virtual machine system 1.
  • 4 is a flowchart showing new memory allocation processing by a new memory allocation processing unit 64 of the virtual machine system 1.
  • 4 is a flowchart showing second memory processing by a second memory processing unit 66 of the virtual computer system 1. It is a figure which shows a process when a virtual machine carries out write access to the memory area to which classification value "2" was attached, and is a figure which shows a 2nd memory process typically.
  • 7 is a flowchart showing third memory processing by a third memory processing unit 67 of the virtual machine system 1.
  • FIG. 9 is a functional configuration diagram of a virtual machine system 1C according to a third embodiment.
  • FIG. 4 is a diagram illustrating an example of an empty memory list 15.
  • FIG. It is a figure which shows an example after the OS memory process setting part 71 updates the access control table 310C, when virtual machine A10 starts. It is a flowchart which shows the access control setting process by OS memory process setting part 71 of 1C of virtual machine systems. It is a flowchart which shows the memory allocation release process of 1C of virtual machine systems. It is a figure for demonstrating the process at the time of virtual machine duplication. It is a figure for demonstrating a copy on write process.
  • a new virtual machine is created by duplicating the running virtual machine as an execution environment for executing an untrusted program (application program).
  • an OS basic program, middleware, and the like are placed in the same physical memory area and shared by both virtual machines.
  • one virtual machine changes the memory contents of the physical memory area shared by both virtual machines while the virtual machine is running, it acquires a new physical memory area for the first time. Processing to allocate a physical memory area (copy-on-write processing) is performed. In this way, the memory usage can be reduced.
  • FIG. 27 and FIG. 28 are diagrams for explaining the copy-on-write process.
  • the logical address of the memory area allocated to the virtual machine A is mapped one-to-one to the physical address of the physical memory (FIG. 27 (1)).
  • the logical address of the virtual machine A is duplicated and a virtual machine B is generated. In this way, there are a plurality of virtual machines that refer to the same physical address (FIG. 27 (2)).
  • the present inventor needs the contents of the physical memory area before the virtual machine duplication for the virtual machine B in the copy-on-write process.
  • a physical memory area is unnecessarily secured.
  • the physical memory area corresponding to the memory area has no meaning. There is no value.
  • the copy-on-write process described above if one virtual machine has write access, the physical memory area is used for the physical memory area even though the contents of the physical memory area do not need to be referenced by the other virtual machine. The content will continue to be retained.
  • the present inventor discriminates the contents of the physical memory area before duplicating the virtual machine, and if the contents of the physical memory area do not need to be referenced by the other virtual machine, a new In addition, the present inventors have found that the amount of memory used can be reduced more than the virtual machine duplication processing assumed based on the prior art by not acquiring the physical memory area.
  • FIG. 1 is a diagram schematically showing a state when a virtual machine is replicated by the virtual machine system 1 according to the first embodiment.
  • the virtual machine system 1 attaches a classification value according to the usage state of the memory area of the virtual machine A when replicating the virtual machine (FIG. 1 (2)).
  • the virtual machine system 1 assigns a classification value “1” to the physical memory area corresponding to the memory area.
  • FIG. 2 is a diagram illustrating processing when any virtual machine has write access to the physical memory area to which the classification value “1” is assigned.
  • FIG. 2 when a physical machine area with a classification value “1” is first accessed for writing from the virtual machine A (FIG. 2 (1)), a new physical memory area is assigned. Without being acquired (FIG. 2 (2)), the virtual machine A writes it directly into the physical memory area to be accessed (FIG. 2 (3)). At this time, the virtual machine system 1 is set to access the virtual memory area for the virtual machine B (FIG. 2 (3)).
  • the virtual machine system 1 acquires a new physical memory area for the first time ( 3 (2)), the accessed virtual machine B writes (or reads) the acquired physical memory area (FIG. 3 (3)). That is, it is only necessary to prepare an unused memory area by acquiring a new physical memory area and initializing it when the virtual machine B accesses the physical memory area.
  • the virtual machine system 1 since the virtual machine system 1 does not acquire a new physical memory area when the first write access is made from any of the virtual machines after the virtual machine is replicated, the memory usage is larger than the copy-on-write process. Can be reduced. ⁇ Configuration> Next, the configuration of the virtual machine system 1 will be described with reference to FIGS.
  • FIG. 4 is a functional configuration diagram of the virtual machine system 1 according to the first embodiment.
  • the virtual machine system 1 duplicates the virtual machine A10 to generate a virtual machine B50, and controls the allocation of memory areas to both virtual machines and the execution of each virtual machine.
  • the virtual machine system 1 includes a virtual machine A10, a virtual machine replication device 20, a virtual machine memory management device 30, and a physical memory 40.
  • the virtual machine A10 and the virtual machine B50 perform, for example, AV processing, network processing, and the like as one virtual computer on which the OS, application program, and the like operate.
  • the virtual machine duplicating device 20 receives a request for starting a new virtual machine from a user or the like during execution of the virtual machine A, and creates a new virtual machine B50 by duplicating the virtual machine A10. Note that a plurality of virtual machines may be generated simultaneously.
  • the virtual machine memory management device 30 receives an access request to the physical memory 40 from the virtual machine A10 and the virtual machine B50, and performs access control to the corresponding memory area.
  • the physical memory 40 stores information by specifying a memory area by an address.
  • the virtual machine A10 includes an application 11 and a virtual OS 12.
  • the application 11 is a program for performing, for example, AV processing, network processing, and the like in the virtual machine A10.
  • the virtual OS 12 has the same function as a general OS, and receives a request from the application 11 in the virtual machine A10, and manages the memory usage status, memory area allocation, program execution management, etc. in the virtual machine A10. Is what you do.
  • the virtual OS 12 includes an OS memory management unit 13 and an OS memory management table 14.
  • the OS memory management unit 13 manages the usage state of the memory area allocated to the virtual machine A10.
  • the usage state of the memory area includes information on whether it is used by an application, a driver, or the like, and the presence / absence of a reference source of information stored in the memory area.
  • the OS memory management table 14 is a table used when the OS memory management unit 13 performs memory management in the virtual machine A10.
  • FIG. 5 is a diagram showing a data configuration and example contents of the OS memory management table 14.
  • the OS memory management table 14 is information configured by associating a logical memory area 14a, a usage count 14b, and reference source information 14c.
  • the logical memory area 14a is an item for storing a logical address of a memory area allocated to the virtual machine A10. Each logical memory area is managed in units of pages such as 4 KB, for example.
  • the usage count 14b is an item for storing the number of applications, drivers, and the like that use the memory area in the virtual machine A10. For example, when the usage count is “0”, this indicates that the memory area is unused.
  • the reference source information is an item for storing information (for example, a path or the like) indicating a location where the contents of the memory area also exist in an auxiliary storage device (for example, a hard disk).
  • a value “0” indicating that there is no reference source is stored.
  • the OS memory management unit 13 refers to the OS memory management table 14 and uses an unused memory area (a logical memory whose use count is “0”). The area is searched for, and the unused memory area is allocated to the application 11. Then, the OS memory management unit 13 adds “1” to the usage count corresponding to the memory area so that the allocated memory area can be identified.
  • the virtual machine replication device 20 includes a memory classification unit 21 and a memory replication unit 22.
  • the memory classification unit 21 includes a classification value table 201 and performs a memory classification process.
  • the memory area used by the virtual machine A10 is classified into information on the usage state of the memory area held in the OS memory management table 14 and the classification value table 201. This is a process for assigning a classification value to be described later to the memory area.
  • FIG. 6 is a diagram showing a data configuration and example contents of the classification value table 201.
  • the classification value table 201 is information configured by associating the classification value 201a with the usage state 201b.
  • the classification value 201a is an item for storing a classification value that is a value for identifying the contents of the memory allocation processing performed by the virtual machine memory management device 30.
  • the memory allocation process 201c is a process for handling a memory area to be accessed when any virtual machine accesses after copying the virtual machine. Details will be described later.
  • the usage state 201b is an item for storing information indicating the usage state of the memory area used by the virtual machine A10.
  • the memory classification unit 21 refers to the OS memory management table 14 to determine the usage state of the memory area, and determines a classification value corresponding to the usage state of the corresponding classification value table 201.
  • “dedicated to one virtual machine” means that it should be allocated to only one virtual machine or an allocated memory area. “Unused” means that an application, a driver, or the like is not used in the virtual machine A10 and is not used. For example, the case where the usage count of the OS memory management table 14 is “0” corresponds to “unused”. “With reference source” means that the same content as the content stored and used by the virtual machine A10 in the memory area is a place other than the memory area (for example, a hard disk or a memory area managed separately by the OS). It means the state that is also held. Therefore, when the memory area is handled as shared by the virtual machine A10 and the virtual machine B50, even when one virtual machine has write access to the memory area, it is written for another virtual machine.
  • the classification value corresponding to “only for one virtual machine” is “0”, the classification value corresponding to “unused” is “1”, and the classification value corresponds to “with reference source”.
  • the classification value corresponding to “2” and “no reference source” is “4”.
  • the classification values “3” and “5” are not values given by the memory classification unit 21 but intermediate values given in the process of memory allocation processing described later.
  • the memory classification unit 21 acquires a classification value corresponding to the use state of the memory area, and writes it in the classification value of the virtual machine memory management table 311.
  • FIG. 7 is a diagram showing a data configuration and example contents of the virtual machine memory management table 311.
  • the virtual machine memory management table 311 is information configured by associating a physical memory area 311a, a usage count 311b, and a classification value 311c.
  • the physical memory area 311 a is an item for storing a physical address indicating the memory area of the physical memory 40.
  • the usage count 311b is an item for storing the number of virtual machines using the physical memory area. When the usage count is “0”, it means that the physical memory area is not used by any virtual machine.
  • the classification value 311c is an item for storing a classification value that is a value for identifying the contents of the memory allocation processing performed by the virtual machine memory management device 30.
  • the memory classification unit 21 writes values to the classification values in this table for all the memory areas allocated to the virtual machine A10.
  • the virtual machine memory management table 311 in which the classification value is written is referred to later when the memory allocation processing unit 35 performs the memory allocation processing.
  • the memory classification unit 21 sets an access authority in the access control table 310 described later according to the classification value. This is because the virtual machine memory management device 30 detects that the virtual machine has accessed and the access type of the access.
  • FIG. 8 is a diagram showing a data configuration and example contents of the access control table 310.
  • the access control table 310 is for converting (mapping) a logical memory area and a physical memory area, and is for setting a virtual machine assigned to each physical memory area and its access authority.
  • the access control table 310 is configured by associating a logical memory area 310a, a physical memory area 310b, a virtual machine 310c that is information on a virtual machine to which the physical memory area is allocated, and an access authority 310d of the virtual machine. Information. Looking at each virtual machine, the logical memory area and the physical memory area are associated one-to-one.
  • the content example of FIG. 8 shows a state after virtual machine replication. “P1”, “P3”, and “P4” in the physical memory area 310b are memory areas shared by the virtual machine A10 and the virtual machine B50. “P2” and “P10” in the physical memory area 310b are allocated to only one virtual machine.
  • the memory classification unit 21 sets the access authority 310d in order to detect that the virtual machine has accessed. For example, when “R / W prohibition” is set in the access authority 310d, the access control unit 31 to be described later refers to the access control table 310 when the virtual machine has read access or write access. Is generated. The access control unit 31 can detect that the virtual machine has accessed and the access type.
  • the memory duplicating unit 22 receives a request from the memory classifying unit 21, requests a memory allocation releasing unit 34, which will be described later, to allocate a physical memory area, and acquires the physical memory area.
  • the memory duplication unit 22 copies the data in the designated memory area to the acquired physical memory area, and the access control table 310 so that the designated virtual machine accesses the newly acquired physical memory area. Set to. That is, the newly acquired physical memory area is associated with the virtual machine using this table. Further, the memory duplication unit 22 sets “0” to the classification value corresponding to the newly acquired physical memory area in the virtual machine memory management table 311 and adds “1” to the use count.
  • the virtual machine memory management device 30 includes an access control unit 31, an access control table 310, an access detection unit 32, a memory allocation processing unit 35, a virtual machine memory management table 311, and a memory allocation release unit 34.
  • the access control unit 31 monitors access to the physical memory area from the virtual machine A10 or the virtual machine B50 after copying the virtual machine.
  • the access control unit 31 is configured to notify the access detection unit 32 when there is an access to be monitored when the monitoring setting of the write access, the read access, or both accesses is made. Yes.
  • the access control unit 31 passes the access type of write access or read access, information on the accessed virtual machine, and information on the physical memory area to be accessed to the access detection unit 32.
  • the access detection unit 32 When the access detection unit 32 receives the access type, virtual machine information, and physical memory area information from the access control unit 31, the access detection unit 32 makes a memory allocation processing request to the memory allocation processing unit 35 described later.
  • the memory allocation release unit 34 receives a physical memory area allocation request or a specified physical memory area release request from the memory classification unit 21, the memory duplication unit 22, and a memory allocation processing unit 35 described later, and receives a virtual machine A 10 and a virtual machine A physical memory area allocation process or release process is performed for each B50.
  • the memory allocation releasing unit 34 refers to the virtual machine memory management table 311 (see FIG. 7) and uses a physical memory area that is not used (that is, a physical memory area whose usage count is “0”). And the use count corresponding to the corresponding physical memory area is incremented by “1” to set that the physical memory area is in use. Further, the memory allocation releasing unit 34 allocates the physical memory area to the request source of the allocation request.
  • the memory allocation release unit 34 decrements the use count of the corresponding virtual machine memory management table 311 by “1” for the physical memory area specified at the time of the request.
  • the memory allocation processing unit 35 When the memory allocation processing unit 35 receives a memory allocation processing request from the access detection unit 32, the memory allocation processing unit 35 allocates memory to the virtual machine as necessary based on the classification value given by the memory classification unit 21. Specifically, the memory allocation processing unit 35 refers to the virtual machine memory management table 311 to determine a classification value corresponding to the physical memory area accessed by the virtual machine, and performs memory allocation processing according to the classification value. I do. The memory allocation processing unit 35 requests the memory allocation release unit 34 to allocate a new physical memory area as necessary. Further, the memory allocation processing unit 35 sets the access control table 310 as necessary. Furthermore, the memory allocation processing unit 35 changes the classification value of the virtual machine memory management table 311 as necessary.
  • FIG. 9 is a functional configuration diagram of the memory allocation processing unit 35.
  • the memory allocation processing unit 35 includes a determination unit 61, a copy-on-write processing unit 62, a first memory processing unit 63, a new memory allocation processing unit 64, and a memory initialization processing unit 65.
  • the second memory processing unit 66 and the third memory processing unit 67 are provided.
  • the discriminating unit 61 discriminates processing for the physical memory area based on the classification value assigned to the physical memory area.
  • the determination unit 61 receives from the access detection unit 32 the access type of write access or read access for virtual machine access, information on the accessed virtual machine, and information on the physical memory area to be accessed.
  • the determination unit 61 refers to the virtual machine memory management table 311 and acquires a classification value corresponding to the received physical memory area.
  • the determination unit 61 goes to the first memory processing unit 63, when the classification value is “2”, the second memory processing unit 66, and when the classification value is “3”, the determination unit 61
  • the memory processing unit 67 is requested to perform the processing to the copy-on-write processing unit 62, and when the classification value is “5”, the new memory allocation processing unit 64 is requested.
  • the copy-on-write processing unit 62 performs copy-on-write processing.
  • the copy-on-write process is the process described above (see FIG. 28) and corresponds to the classification value “4”.
  • the access authority of the memory area with the classification value “4” is set to “W prohibited” by the memory classification unit 21. Therefore, only when the write access from the virtual machine is detected, the determination unit 61 makes a processing request to the copy-on-write processing unit 62.
  • the copy-on-write processing unit 62 is called from the determination unit 61, requests the memory allocation release unit 34 to allocate a new physical memory area, and accesses the acquired physical memory area to the physical memory area to be accessed. Copy the contents.
  • the copy-on-write processing unit 62 sets the newly acquired physical memory area in the access control table 310 so as to be allocated to the accessed virtual machine, and cancels access monitoring. Further, the copy-on-write processing unit 62 sets the use count corresponding to the newly acquired physical memory area to “1” and the classification value to “0” in the virtual machine memory management table 311. The copy-on-write processing unit 62 also releases access monitoring for the original physical memory area, subtracts “1” from the use count corresponding to the original physical memory area, and sets the classification value to the virtual machine memory management table 311. Set to “0”.
  • the first memory processing unit 63 performs the first memory processing.
  • the first memory process is a process (see FIG. 2) indicated by the item ⁇ outline> described above, and is a process corresponding to the classification value “1”.
  • the first memory processing unit 63 is called from the determination unit 61 and sets the access control table 310 so as to cancel the access monitoring for the accessed virtual machine. Further, the first memory processing unit 63 sets the use count corresponding to the physical memory area to be accessed to “1” and the classification value to “0” in the virtual machine memory management table 311. At the same time, the first memory processing unit 63 sets the access control table 310 to access the new memory allocation area 41 for other virtual machines set to refer to the physical memory area.
  • FIG. 10 is a diagram showing the access control table 310 after the first memory process is completed when the virtual machine A10 first receives a write access after duplicating the virtual machine.
  • FIG. 8 shows the access control table 310 after the virtual machine replication and before the first memory processing is started.
  • the physical memory area “P4” is assigned as it is to the virtual machine A10, and access monitoring is cancelled.
  • the virtual machine B50 is assigned with “Pk” which is a new memory allocation area 41, and “R / W prohibition” is set for access monitoring.
  • the physical memory area “Pk” is set to the classification value “5” in the virtual machine memory management table 311.
  • the new memory allocation area 41 indicates a specific memory area, and the access control unit 31 detects the access to the memory area from the virtual machine and notifies the access detection unit 32 of the access.
  • the classification value of the virtual machine memory management table 311 corresponding to the new memory allocation area 41 is set to “5”. Note that it is not always necessary to associate a physical memory area that actually exists with the new memory allocation area 41, and a virtual memory area is defined (that is, an identifier or the like is set in the physical memory area 310b of the access control table 310). The identifier is only associated with the classification value “5” in the virtual machine memory management table 311). That is, it is only necessary that the new memory allocation process corresponding to the classification value “5” can be executed when the virtual machine accesses.
  • the new memory allocation processing unit 64 performs a new memory allocation process.
  • the new memory allocation process is the process (see FIG. 3) indicated by the item ⁇ overview> described above, and is a process corresponding to the classification value “5”.
  • the new memory allocation processing unit 64 is called from the determination unit 61, requests the memory allocation release unit 34 to allocate a new physical memory area, and applies a memory initialization processing unit to be described later to the acquired physical memory area. 65 is called to write the initial value.
  • the new memory allocation processing unit 64 sets the newly acquired physical memory area in the access control table 310 so as to allocate it to the accessed virtual machine. Also, the new memory allocation processing unit 64 cancels access monitoring for the newly acquired physical memory area. Further, the new memory allocation processing unit 64 sets the use count corresponding to the newly acquired physical memory area to “1” and the classification value to “0” in the virtual machine memory management table 311.
  • the memory initialization processing unit 65 is called from the new memory allocation processing unit 64 and is initialized with a predetermined data string (for example, all zeros such as “00... 0”) for the designated physical memory area. Process.
  • the second memory processing unit 66 performs second memory processing.
  • the second memory process is a process corresponding to the classification value “2”.
  • the classification value “2” is a classification in which the use state of the memory area when replicating the virtual machine is “with reference source”. This is because applications etc. used the memory area before duplicating the virtual machine, and after duplicating the virtual machine, the first read access from one virtual machine was followed by reading from other virtual machines. There may be access. If an exception is generated every time there is a read access, it is not preferable from the viewpoint of the performance of the virtual machine system. Therefore, the physical memory area that was first accessed for read from one virtual machine does not cause an exception due to the read access. Target of write processing.
  • the second memory processing unit 66 sets the classification value corresponding to the physical memory area to be accessed to “4” in the virtual machine memory management table 311. In addition, the second memory processing unit 66 sets the access control table 310 so as to cancel the read access monitoring for the accessed virtual machine.
  • the second memory processing unit 66 sets the classification value corresponding to the physical memory area to be accessed to “3” in the virtual machine memory management table 311. Further, the second memory processing unit 66 sets the access control table 310 so as to cancel the read / write access monitoring for the accessed virtual machine.
  • the third memory processing unit 67 performs third memory processing.
  • the third memory process is a process corresponding to the classification value “3”.
  • the memory allocation release unit 34 is requested to allocate a new physical memory area, and the acquired physical memory area is accessed. Copy the contents of the physical memory area.
  • the third memory processing unit 67 sets the newly acquired physical memory area in the access control table 310 so as to be allocated to the accessed virtual machine, and cancels the access monitoring. Further, the third memory processing unit 67 sets the usage count corresponding to the newly acquired physical memory area to “1” and the classification value to “0” in the virtual machine memory management table 311.
  • FIG. 11 is a flowchart showing memory classification processing by the memory classification unit 21 of the virtual machine system 1.
  • the memory classification process is a process for assigning a classification value for each memory area in accordance with the usage state of the memory area of the replication source virtual machine.
  • the memory classification unit 21 performs this process for each memory area allocated to the virtual machine A10 when replicating the virtual machine.
  • the memory classification unit 21 determines whether copy processing is necessary for the corresponding memory area (step S11).
  • the copy process will be described.
  • the memory area allocated to the virtual machine A10 needs to be allocated to only one virtual machine
  • the virtual machine A10 and the virtual machine B50 do not share the physical memory area corresponding to the memory area after the virtual machine replication. It is necessary to. Therefore, in order to prepare a physical memory area for each of the virtual machine A10 and the virtual machine B50, a new physical memory area is acquired, and the contents of the memory area allocated to the virtual machine A10 are acquired in the physical memory area. Copy. Whether it needs to be assigned to only one virtual machine is determined in advance for each memory area.
  • step S11 When copy processing is necessary (step S11 / Yes), the memory classification unit 21 sets the classification value to “0” (step S12), and sets “0” as the classification value in the virtual machine memory management table 311 ( In step S19), the memory copying unit 22 is requested to copy the physical memory area (step S21).
  • the memory classification unit 21 refers to the OS memory management table 14 (see FIG. 5) (Step S13). Then, the memory classification unit 21 determines whether or not the use count of the memory area is “0” (step S14).
  • the memory classification unit 21 sets the classification value to “1” (Step S15).
  • the memory classification unit 21 determines whether the reference source information of the memory area exists (Step S16).
  • the memory classification unit 21 sets the classification value to “2” (step S18).
  • the memory classification unit 21 sets the classification value to “4” (Step S17).
  • step S19 the memory classification unit 21 writes a value in the classification value 311c of the virtual machine memory management table 311 (see FIG. 7).
  • the memory classification unit 21 checks the classification value for the corresponding memory area (step S20). If the classification value is “4”, the memory classification unit 21 sets the corresponding memory area in the access control table 310 so as to monitor the write access (step S22). When the classification value is “1” or “2”, the memory classification unit 21 sets the corresponding memory area in the access control table 310 to monitor the read access and the write access (step S23). . Thus, the memory classification process ends.
  • FIG. 12 is a flowchart showing memory allocation processing by the memory allocation processing unit 35 of the virtual machine system 1.
  • the memory allocation process starts when there is an access to the physical memory 40 from any virtual machine after the virtual machine is replicated. Specifically, the process starts when the memory allocation processing unit 35 receives a memory allocation processing request from the access detection unit 32.
  • the determination unit 61 refers to the virtual machine memory management table 311 (see FIG. 7) and reads the classification value corresponding to the physical memory area to be accessed (step S21). Next, the determination unit 61 determines the classification value (step S22). When the classification value is “1” (step S22 / classification value 1), the first memory processing unit 63 performs the first memory processing. This is performed (step S23). When the classification value is “2” (step S22 / classification value 2), the second memory processing unit 66 performs the second memory process (step S24). When the classification value is “3” (step S22 / classification value 3), the third memory processing unit 67 performs the third memory processing (step S25).
  • FIG. 13 is a flowchart showing the first memory processing by the first memory processing unit 63 of the virtual machine system 1.
  • the first memory process is started when a request for the first memory process is received from the determination unit 61 together with information on the accessed virtual machine and information on the physical memory area to be accessed.
  • the first memory processing unit 63 sets the access control table 310 (see FIG. 8) so as to cancel the access monitoring for the accessed virtual machine (step S231). This is because the memory area to be accessed becomes a memory area dedicated to the accessed virtual machine and there is no need to detect access.
  • the first memory processing unit 63 sets the use count corresponding to the physical memory area to be accessed to “1” and the classification value to “0” in the virtual machine memory management table 311 (step S232). .
  • the first memory processing unit 63 sets the access control table 310 to access the new memory allocation area 41 for other virtual machines set to refer to the physical memory area ( Step S233). Thus, the first memory process ends.
  • FIG. 2 is a diagram illustrating processing when any virtual machine has write access to the physical memory area to which the classification value “1” is assigned, and is a diagram schematically illustrating the first memory processing.
  • FIG. 14 is a flowchart showing new memory allocation processing by the new memory allocation processing unit 64 of the virtual machine system 1.
  • the new memory allocation process is started when a request for a new memory allocation process is received from the determination unit 61 together with information on the accessed virtual machine.
  • the new memory allocation processing unit 64 requests the memory allocation releasing unit 34 to acquire a new physical memory area (step S271).
  • the new memory allocation processing unit 64 calls the memory initialization processing unit 65 to initialize the acquired physical memory area (step S272).
  • the new memory allocation processing unit 64 sets the newly acquired physical memory area in the access control table 310 so as to allocate it to the accessed virtual machine (step S273). That is, the address of the newly acquired physical memory area is set where the new memory allocation area 41 of the physical memory area 310b of the access control table 310 has been set.
  • the new memory allocation processing unit 64 sets the usage count corresponding to the newly acquired physical memory area to “1” and the classification value to “0” in the virtual machine memory management table 311 (step S274). This completes the new memory allocation process.
  • FIG. 3 is a diagram showing processing when a virtual machine has write access to a memory area to which a classification value “5” is assigned, and schematically shows new memory allocation processing.
  • FIG. 15 is a flowchart showing the second memory processing by the second memory processing unit 66 of the virtual machine system 1.
  • the second memory process is performed from the determination unit 61 together with the access type of the write access or the read access for the access of the virtual machine, the information of the accessed virtual machine and the information of the physical memory area to be accessed. It starts when a request is received.
  • the second memory processing unit 66 determines the access type from the virtual machine (step S241).
  • step S241 read access
  • the second memory processing unit 66 sets the classification value corresponding to the physical memory area to be accessed to “4” in the virtual machine memory management table 311 (Ste S242).
  • the second memory processing unit 66 sets the access control table 310 so as to cancel the read access monitoring for the accessed virtual machine (step S243).
  • step S241 write access
  • the second memory processing unit 66 sets the classification value corresponding to the physical memory area to be accessed to “3” in the virtual machine memory management table 311. (Step S244).
  • the second memory processing unit 66 cancels the read / write access monitoring for the accessing virtual machine, and reads / writes access monitoring for the other virtual machines. Is set in the access control table 310 (step S245).
  • the second memory process ends.
  • FIG. 16 is a diagram illustrating processing when the virtual machine has write access to the memory area to which the classification value “2” is assigned, and schematically illustrates the second memory processing.
  • FIG. 17 is a flowchart showing the third memory processing by the third memory processing unit 67 of the virtual machine system 1.
  • the third memory process is started when a request for the third memory process is received from the determination unit 61 together with information on the accessed virtual machine and information on the physical memory area to be accessed.
  • the third memory processing unit 67 requests the memory allocation release unit 34 to acquire a new physical memory area when the virtual machine has read access or write access (step S251). Next, the third memory processing unit 67 copies the contents of the physical memory area to be accessed to the acquired physical memory area (step S252). Next, the third memory processing unit 67 sets the newly acquired physical memory area in the access control table 310 so as to be allocated to the accessed virtual machine (step S253). Next, the third memory processing unit 67 sets the usage count corresponding to the newly acquired physical memory area to “1” and the classification value to “0” in the virtual machine memory management table 311 (step S254). ).
  • the third memory processing unit 67 decrements the usage count corresponding to the copy source physical memory area by “1” in the virtual machine memory management table 311 (step S255). If the usage count is “1” as a result of decrementing the usage count by “1”, the third memory processing unit 67 sets the classification value to “0” (step S257). Thus, the third memory process ends.
  • FIG. 18 is a diagram illustrating a process when the virtual machine has write access to the memory area to which the classification value “3” is attached, and schematically illustrates the third memory process.
  • the virtual machine system 1 acquires a new physical memory area, and acquires the acquired physical memory area. Copy the contents of the physical memory area to be accessed.
  • the virtual machine system 1 is configured so that the accessed virtual machine writes to the newly acquired physical memory area.
  • FIG. 19 is a diagram illustrating processing when the virtual machine performs read access to the memory area to which the classification value “3” is assigned, and schematically illustrates the third memory processing.
  • the virtual machine system 1 when another virtual machine has read access to the physical memory area with the classification value “3”, the virtual machine system 1 newly acquires a physical memory area, and the acquired physical memory area includes Copy the contents of the physical memory area to be accessed. Then, the virtual machine system 1 reads the contents from the physical memory area. In this case, there is no problem even if another virtual machine reads the contents of the memory area rewritten by one virtual machine.
  • an unused memory area or a memory area where a reference source is present can be obtained from any virtual machine.
  • a write access is first made, a new physical memory area is not acquired, so that the memory usage can be further reduced as compared with the copy-on-write process.
  • step S14 of the memory classification process the virtual machine system 1 according to the first embodiment sets the classification value to “1” when the usage count is “0” (Yes in step S14). (Step S15).
  • the configuration of the virtual machine system 1B is the same as that of the virtual machine system 1.
  • symbol is attached
  • FIG. 20 is a flowchart showing the operation of the memory classification process by the memory classification unit 21B of the virtual machine system 1B. Only differences from the first embodiment will be described.
  • Steps S31 to S34 are the same as steps S11 to S14 (see FIG. 11).
  • step S35 the memory classification unit 21B requests the memory allocation release unit 34 to request a physical memory area corresponding to the memory area. To release. Further, the memory classification unit 21B sets the new memory allocation area 41 with the classification value “5” corresponding to the memory area in the access control table 310. Then, the memory classification process ends.
  • FIG. 21 is a diagram schematically showing a state when a virtual machine is replicated by the virtual computer system 1B.
  • the virtual machine system 1B determines that the use state of the memory area is not used when replicating the virtual machine, the virtual machine system 1B releases the physical memory area corresponding to the memory area. Then, the new memory allocation area 41 with the classification value “5” corresponds to the memory area. Thereafter, when any virtual machine accesses the new memory allocation area 41, the virtual machine system 1B performs a new memory allocation process as shown in FIG.
  • Embodiment 3 when replicating a virtual machine, it is possible to release all physical memory areas corresponding to memory areas not used by the virtual machine.
  • Embodiment 3 a third embodiment of the present invention will be described with reference to FIGS. ⁇ Overview>
  • an application or the like in a virtual machine stops using a logical memory area and the virtual OS releases the logical memory area (for example, deletes information for memory management in which an application and a logical memory area are associated with each other).
  • the logical memory area is connected to a free memory list that manages unused logical memory areas in the virtual machine.
  • the physical memory area corresponding to the logical memory area is not released and remains allocated to the virtual machine.
  • the virtual computer system 1C releases a physical memory area corresponding to the logical memory area when it detects that the virtual OS has accessed a free memory list in order to release the logical memory area.
  • the physical memory area can be immediately released to the virtual machine, and the use efficiency of the physical memory area can be improved.
  • FIG. 22 is a functional configuration diagram of the virtual machine system 1C according to the third embodiment.
  • symbol is attached
  • the virtual machine system 1C includes a free memory list 15 in the virtual machine A10C, a virtual machine activation device 70, a memory list processing unit 68 in the virtual machine memory management device 30C, and a memory list monitoring area 42 in the physical memory 40C.
  • the free memory list 15 is management information for managing free memory areas in the virtual machine. For example, all of the unused logical memory areas in the virtual machine A10C among the logical memory areas of the virtual machine A10C are listed. It is a list including information (address etc.) for specifying.
  • FIG. 23 is a diagram showing an example of the free memory list 15.
  • Each data “1”, “2”,..., “N” in this list is an address of an unused logical memory area in the virtual machine A10C.
  • the OS memory management unit 13 always accesses the free memory list 15 when a logical memory area is allocated or released.
  • the OS memory management unit 13 accesses the free memory list 15 and includes the logical memory area specified by the application 11 in the free memory list 15.
  • the OS memory management unit 13 accesses the free memory list 15, acquires an unused logical memory area from the free memory list 15, and stores the logical memory area in the application 11. Allocate memory space.
  • the virtual machine activation device 70 includes an OS memory processing setting unit 71.
  • the OS memory process setting unit 71 is called when the virtual machine A 10C is activated, and performs an access control setting process.
  • the access control setting process is performed so that the OS memory process setting unit 71 accesses a memory list monitoring area 42 for a predetermined logical memory area in which the free memory list 15 is stored. This is done by setting in the access control table 310C.
  • FIG. 24 is a diagram illustrating an example after the OS memory processing setting unit 71 updates the access control table 310C when the virtual machine A10C is activated.
  • the logical memory area 310 a “free memory list area” is, for example, the top logical address of the free memory list 15.
  • a “memory list monitoring area” is set in the corresponding physical memory area 310 b so that the access to the logical address becomes the access to the memory list monitoring area 42.
  • the memory list monitoring area 42 exists as a part of the physical memory 40 as with the new memory allocation area 41.
  • “R / W prohibition” is set in the access authority, and the access is monitored.
  • the access control unit 31 detects access to the memory list monitoring area 42, it notifies the access detection unit 32.
  • the access detection unit 32 is configured to call a memory list processing unit 68 described later of the memory allocation processing unit 35C.
  • the access control unit 31 receives access information from the virtual machine to the free memory list 15 and passes this information to the access detection unit 32.
  • the access information to the free memory list 15 is information that can be used to determine whether the virtual machine is about to release or allocate a memory area.
  • the memory list processing unit 68 receives access information to the free memory list 15 from the access detection unit 32 and determines whether the virtual machine is about to release or allocate a memory area. When the memory list processing unit 68 determines that the virtual machine is releasing the memory area, the memory list processing unit 68 passes the physical memory area corresponding to the logical memory area to be released to the memory allocation releasing unit 34 and releases the physical memory area. Instruct. When the memory list processing unit 68 determines that the virtual machine is about to allocate a memory area, it instructs the memory allocation release unit 34 to allocate a physical memory area. ⁇ Operation> Hereinafter, the operation of the virtual computer system 1C will be described with reference to FIGS. 25 and 26 (the configuration is appropriately FIG. 22).
  • FIG. 25 is a flowchart showing access control setting processing by the OS memory processing setting unit 71 of the virtual machine system 1C.
  • This process starts when the virtual machine is started.
  • the OS memory processing setting unit 71 sets the access control table 310C so that read access or write access to the free memory list 15 is access to the memory list monitoring area 42 (step S41).
  • the OS memory process setting unit 71 sets read access and write access monitoring to the memory list monitoring area 42 in the access control table 310C (step S42).
  • the access control setting process ends.
  • FIG. 26 is a flowchart showing a memory allocation release process of the virtual machine system 1C.
  • This process is a process when the virtual machine system 1C allocates or releases a physical memory area to the virtual machine.
  • the OS memory management unit 13 accesses the free memory list 15 (step S51).
  • the access control unit 31 detects the access and notifies the access detection unit 32 (step S52).
  • the memory list processing unit 68 called from the access detection unit determines whether the access is a memory area release or allocation (step S53).
  • the memory allocation release unit 34 performs a memory release process (step S54).
  • the memory allocation release unit 34 receives the physical memory area to be released from the memory list processing unit 68, and sets the use count corresponding to the physical memory area to “1” in the virtual machine memory management table 311. This is done by subtracting.
  • the memory allocation release unit 34 performs memory allocation processing (step S55).
  • the memory allocation release unit 34 refers to the virtual machine memory management table 311, searches for a released unused physical memory area (use count is “0”), and corresponds to the physical memory area. This is done by adding “1” to the use count to be used and setting the use in use, and passing the logical memory area corresponding to the physical memory area to the virtual OS 12C. This is the end of the memory allocation release process.
  • the virtual computer system according to the present invention has been described based on the embodiment, but can be changed without departing from the gist of the present invention.
  • the present invention can be modified as follows, and the present invention is not limited to the virtual machine system as shown in the above embodiment.
  • the use state of the memory area includes information on whether it is used by an application, a driver, and the like, and whether or not there is a reference source of information stored in the memory area. It is not limited. For example, information indicating whether or not the memory area can be used by an application other than the application in use may be included.
  • a private memory flag item is provided in the OS memory management table 14 (see FIG. 5).
  • the private memory flag stores “1” when the memory area can be used only by the application being used, and stores “0” otherwise.
  • the use state of the memory area corresponds to “no reference source” described in the first embodiment, and when the private memory flag is “0”, It may be made to correspond to “with reference source”.
  • step S11 of the memory classification process the new memory allocation processing unit 64 calls the memory initialization processing unit 65 to store the acquired physical memory area. It was explained as being initialized. However, this initialization may not be performed when the virtual machine to which the memory area is allocated is secure. Thereby, the processing can be reduced.
  • this initialization may not be performed.
  • the virtual machine system 1 when another virtual machine has read access to the physical memory area with the classification value “3”, the virtual machine system 1 newly acquires the physical memory area. The contents of the physical memory area to be accessed are copied to the acquired physical memory area.
  • the virtual machine system 1 has been described as reading its contents from the physical memory area. However, another virtual machine that has read and accessed the contents of the memory area before the write access of one virtual machine from the location (for example, storage etc.) into the newly acquired physical memory area The contents may be read from the physical memory area.
  • the list is used as the management information for managing the free memory area in the virtual machine.
  • the present invention is not limited to this. Any information may be used as long as it is information for managing the free memory area and the virtual OS always accesses when the memory area is released.
  • the management information for managing the free memory area may be a so-called bit map method or memory map method.
  • the access control unit 31 is configured to detect that the virtual OS has accessed these management information. (6) Part or all of the modifications (1) to (5) may be applied in combination to the virtual computer system 1 according to the embodiment. (7)
  • the configuration of the virtual machine system according to an embodiment of the present invention, its modified examples, and each effect will be described.
  • a virtual machine system is a virtual machine system that creates one or more second virtual machines by duplicating a first virtual machine, wherein the first virtual machine For each of the one or more memory areas that can be accessed by the virtual machine, any one of the first virtual machine and the one or more second virtual machines is written after the generation of the one or more second virtual machines.
  • Management means that can be read-accessed together from each virtual machine and each memory area managed by the management means until the write access is performed.
  • the memory content before access is a specific memory area that does not need to be retained for future access by a virtual machine other than the virtual machine that performed the write access
  • a second detection unit that detects that a virtual machine other than the virtual machine is attempting to access the specific type memory area; and a virtual machine that is detected by the second detection unit to be accessing the specific type memory area.
  • a memory allocation unit that newly acquires a memory area as an access target and performs allocation is provided.
  • this virtual machine system When creating a virtual machine by duplicating one virtual machine, this virtual machine system first writes from one of the virtual machines to an unused memory area or a memory area where a reference source exists. When there is a write access, a new physical memory area is not acquired, so that the memory usage can be further reduced as compared with the copy-on-write process.
  • the determination unit when the determination unit generates the one or more second virtual machines by duplicating the first virtual machine, for each memory area used in the first virtual machine The determination may be performed on the basis of information indicating the usage status.
  • the determining means may determine that a memory area that is unused and initialized and accessed is a specific type memory area.
  • the usage status of each memory area used in the copy source virtual machine is whether the memory area is unused and the memory area is initialized and accessed. Therefore, it is possible to prevent a useless memory area from being secured for these memory areas and to reduce the memory usage of the entire physical memory area.
  • the information indicating the usage status of each memory area is for distinguishing whether or not the same contents as the contents of the memory area exist in an external storage means, and the determination means includes: A memory area having the same contents as in the external storage means may be determined to be a specific type memory area.
  • the usage status of each memory area used in the replication source virtual machine distinguishes whether or not the same contents as the contents of the memory area exist in the external storage means. Therefore, it is possible to prevent a useless memory area from being secured for these memory areas and reduce the memory usage of the entire physical memory area.
  • the determination unit is configured so that a content of a memory area when any one of the first virtual machine and the one or more second virtual machines accesses for the first time is a virtual that performs the access.
  • the memory area that may be the content of the last write access to a virtual machine other than the machine may be determined to be a specific type memory area.
  • the usage status of each memory area used in the replication source virtual machine is such that any one of the replication source virtual machine and one or more replication destination virtual machines is
  • the memory area when the memory area is accessed for the first time may be the last write access to a virtual machine other than the virtual machine performing the access. Therefore, it is possible to prevent a useless memory area from being secured for these memory areas and reduce the memory usage of the entire physical memory area.
  • the information indicating the usage status of each memory area is used to distinguish whether or not the memory area is unused, and the virtual machine system is further configured based on the information.
  • Second determination means for determining whether or not a memory area allocated to the first virtual machine is unused when generating one or more second virtual machines by duplicating one virtual machine;
  • the memory area determined to be unused by the second determining means can detect access to the memory area by any one of the first virtual machine and the one or more second virtual machines. To the virtual machine when the virtual machine access to the released memory area is later detected. It may comprise a memory allocation release means for assigning entity of memory regions.
  • this virtual machine system when replicating a virtual machine, it is possible to release all physical memory areas corresponding to memory areas not used by the virtual machine.
  • the virtual OS of the virtual machine accesses a memory area storing management information for managing the free memory area of the virtual machine in order to release the memory area, the access is detected.
  • a memory release unit for releasing the entity of the memory area to be released by the virtual OS when the access is detected by the third detection unit.
  • This virtual machine system releases the physical memory area corresponding to the logical memory area when it detects that the virtual OS has accessed the free memory list in order to release the logical memory area.
  • the physical memory area can be released immediately, and the use efficiency of the physical memory area can be improved.
  • the memory classification unit 21, the memory duplication unit 22, the access control unit 31, the access detection unit 32, the memory allocation release unit 34, the memory allocation unit 35, the memory list processing unit 68, and the memory processing setting unit 71 are a virtual machine system 1 is operated by a memory management program that causes the computer in 1 to function as the functional unit.
  • Each functional unit described in the embodiment may be realized by a hardware circuit such as an IC (Integrated Circuit) or an LSI (Large Scale Integration).
  • the memory management program can be distributed and distributed through various recording media or communication channels.
  • the distributed and distributed program is used by being stored in a memory or the like that can be read by the CPU in the device, and each function of the virtual computer system shown in the embodiment is executed by the CPU executing the program. Is realized.
  • the steps of the flowchart show an example of processing performed in time series in the described order. However, even if not necessarily time-series processing, the steps of the flowchart are executed in parallel or individually. It also includes the processing.
  • the present invention can be applied to any computer (for example, an electronic device, an information device, an AV device, a communication device, a home appliance, etc.) as long as it is a calculation processing device including a processor and a timer. Specifically, it is also applied to personal computers, mobile phones such as smartphones and PDAs, hard disk recorders, disk recorders using DVDs and Blu-ray discs, disk players using DVDs and Blu-ray discs, car navigation systems, televisions, etc. Applicable. (11)
  • the management unit according to the present invention corresponds to the access control unit 31 according to the embodiment, and the determination unit according to the present invention corresponds to the memory classification unit 21 and the OS memory management table 14 according to the embodiment.
  • the specific type memory area according to the present invention corresponds to a case where the use state of the memory area according to the embodiment corresponds to “unused” or “with reference source”, and the first detection unit according to the present invention includes: It corresponds to the access control unit 31, the access detection unit 32, the memory allocation processing unit 35, and the virtual machine memory management table 311 according to the embodiment, and the second detection unit according to the present invention is the access control unit 31 according to the embodiment.
  • the memory allocation unit according to the present invention is a memory allocation release according to the embodiment.
  • the second determination unit according to the present invention corresponds to the memory classification unit 21 and the OS memory management table 14 according to the embodiment, and the memory allocation release unit according to the present invention is a memory allocation release unit according to the embodiment. 34, the memory allocation processing unit 35, and the virtual machine memory management table 311.
  • the third detection unit according to the present invention corresponds to the OS memory processing setting unit 71 and the access control unit 31 according to the embodiment, and the memory release unit according to the present invention is a memory list processing unit according to the embodiment. 68 and the virtual machine memory management table 311.
  • the virtual computer system prevents a physical memory area from being unnecessarily secured by copy-on-write processing.
  • the virtual computer system relates to a virtual computer system, and in particular, an operating system (OS) serving as an execution environment for an application program is required from time to time. This is useful for techniques for reducing the amount of memory area used in a system that generates and operates the system.
  • OS operating system

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Storage Device Security (AREA)
  • Memory System (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

 第1の仮想マシンを複製することで1以上の第2の仮想マシンを生成する仮想計算機システムであって、第1の仮想マシンがアクセスし得る各メモリ領域について、1以上の第2の仮想マシンの生成後、いずれかの仮想マシンが書込アクセスをするまでは、各仮想マシンから共に読出アクセスし得るものとして管理する管理手段と、各メモリ領域について特定種メモリ領域か否かの判別を行う判別手段と、特定種メモリ領域への書込アクセスが検知された後に、当該書込アクセスを行った仮想マシン以外の仮想マシンが当該特定種メモリ領域にアクセスしようとしていることを検知する検知手段と、特定種メモリ領域にアクセスしようとしていることが検知された仮想マシンに対して、新たにメモリ領域を獲得して割当を行うメモリ割当手段とを備える。

Description

仮想計算機システム、メモリ管理方法、メモリ管理プログラム、記録媒体および集積回路
 本発明は、仮想計算機システムに関し、特に、アプリケーションプログラムの実行環境となるオペレーティングシステム(OS)を随時生成し動作させるシステムにおける、メモリ領域の使用量低減のための技術に関する。
 近年、パーソナルコンピュータのみならず家電機器でも、ネットワーク接続機能を有するものが普及しつつある。ところが、ネットワークにはスパイウェア等の不正動作をするプログラムが意図的に流されることがあり、これらのプログラムをダウンロードして実行してしまう危険性が高まっている。このような状況におけるセキュリティ対策として、信頼していないプログラムをダウンロードして実行する環境となるOS(Operating System)を安全なOSとは分離して生成し、複数のOS(仮想マシン)を同時に実行させる仮想計算機システム技術が研究、開発されている。
 一般に、複数の仮想マシンを同時に実行すれば、実行に必要なメモリ量は増大し、機器の製造コストが上昇する。コスト削減のために、仮想マシンの複製方式が提案されている(例えば、特許文献1、特許文献2参照)。
特開2008-165795号公報 特開2009-116914号公報
 しかしながら、上記のように、コピーオンライト処理によって仮想マシンを複製する構成においても、さらなるメモリ領域の使用量低減が求められていた。
 そこで、本発明は、係る問題に鑑みてなされたものであり、コピーオンライト処理によって物理メモリ領域を無駄に確保することを防ぐ仮想計算機システムを提供することを目的とする。
 上記課題を解決するために、本発明の一実施態様に係る仮想計算機システムは、第1の仮想マシンを複製することで1以上の第2の仮想マシンを生成する仮想計算機システムであって、前記第1の仮想マシンがアクセスし得る1以上の各メモリ領域について、前記1以上の第2の仮想マシンの生成後、前記第1の仮想マシンおよび前記1以上の第2の仮想マシンのうちいずれかの仮想マシンが書込アクセスをするまでは、各仮想マシンから共に読出アクセスし得るものとして管理する管理手段と、前記管理手段が管理する前記各メモリ領域について、前記書込アクセスが行われる場合には、当該書込アクセス前のメモリ内容を当該書込アクセスを行った仮想マシン以外の仮想マシンが将来アクセスするときのために保持しておく必要がない特定種メモリ領域か否かの判別を行う判別手段と、前記特定種メモリ領域への前記書込アクセスを検知する第1検知手段と、前記第1検知手段により前記書込アクセスが検知された後に、当該書込アクセスを行った仮想マシン以外の仮想マシンが当該特定種メモリ領域にアクセスしようとしていることを検知する第2検知手段と、前記第2検知手段により特定種メモリ領域にアクセスしようとしていることが検知された仮想マシンに対して、当該アクセスの対象として新たにメモリ領域を獲得して割当を行うメモリ割当手段とを備えることを特徴とする。
 上記構成を備える本発明に係る仮想計算機システムによれば、コピーオンライト処理によって物理メモリ領域を無駄に確保することを防ぐことができる。
仮想計算機システム1による仮想マシン複製時の様子を模式的に表した図である。 分類値「1」が付された物理メモリ領域に、いずれかの仮想マシンが書込アクセスした時の処理を示す図であり、第1メモリ処理を模式的に示す図である。 分類値「5」が付されたメモリ領域に、仮想マシンが書込アクセスした時の処理を示す図であり、新規メモリ割当処理を模式的に示す図である。 実施の形態1に係る仮想計算機システム1の機能構成図である。 OSメモリ管理テーブル14のデータ構成および内容例を示す図である。 分類値テーブル201のデータ構成および内容例を示す図である。 仮想マシンメモリ管理テーブル311のデータ構成および内容例を示す図である。 アクセス制御テーブル310のデータ構成および内容例を示す図である。 メモリ割当処理部35の機能構成図である。 仮想マシン複製後、仮想マシンA10から最初に書込アクセスがあった場合における第1メモリ処理終了後のアクセス制御テーブル310を示した図である。 仮想計算機システム1のメモリ分類部21によるメモリ分類処理を示すフローチャートである。 仮想計算機システム1のメモリ割当処理部35によるメモリ割当処理を示すフローチャートである。 仮想計算機システム1の第1メモリ処理部63による第1メモリ処理を示すフローチャートである。 仮想計算機システム1の新規メモリ割当処理部64による新規メモリ割当処理を示すフローチャートである。 仮想計算機システム1の第2メモリ処理部66による第2メモリ処理を示すフローチャートである。 分類値「2」が付されたメモリ領域に、仮想マシンが書込アクセスした時の処理を示す図であり、第2メモリ処理を模式的に示す図である。 仮想計算機システム1の第3メモリ処理部67による第3メモリ処理を示すフローチャートである。 分類値「3」が付されたメモリ領域に、仮想マシンが書込アクセスした時の処理を示す図であり、第3メモリ処理を模式的に示す図である。 分類値「3」が付されたメモリ領域に、仮想マシンが読出アクセスした時の処理を示す図であり、第3メモリ処理を模式的に示す図である。 実施の形態2に係る仮想計算機システム1Bのメモリ分類部21Bによるメモリ分類処理を示すフローチャートである。 仮想計算機システム1Bによる仮想マシン複製時の様子を模式的に表した図である。 実施の形態3に係る仮想計算機システム1Cの機能構成図である。 空きメモリリスト15の一例を示す図である。 OSメモリ処理設定部71が、仮想マシンA10が起動する際に、アクセス制御テーブル310Cを更新した後の一例を示す図である。 仮想計算機システム1CのOSメモリ処理設定部71によるアクセス制御設定処理を示すフローチャートである。 仮想計算機システム1Cのメモリ割当解放処理を示すフローチャートである。 仮想マシン複製時の処理を説明するための図である。 コピーオンライト処理を説明するための図である。
≪本発明に係る一形態を得るに至った経緯≫
 本発明者は、前述した従来技術に基づき想定される仮想マシンの複製方式について詳細に検討した。
 この仮想マシンの複製方式では、信頼していないプログラム(アプリケーションプログラム)を実行する実行環境として、実行中の仮想マシンを複製した新たな仮想マシンを生成する。このとき、OSの基本プログラムやミドルウェア等を同一の物理メモリ領域に置いて、両仮想マシンで共用させる。そして、仮想マシン実行中に両仮想マシンで共用している物理メモリ領域のメモリ内容を一方の仮想マシンが変化させる時に、初めて新たに別の物理メモリ領域を獲得し、両仮想マシンにそれぞれ専用の物理メモリ領域を割り当てるようにする処理(コピーオンライト処理)を行っている。このようにすることで、メモリ使用量を削減することができる。
 図27および図28は、コピーオンライト処理を説明するための図である。
 仮想マシンAに割り当てられたメモリ領域の論理アドレスは、物理メモリの物理アドレスへ1対1にマッピングされている(図27(1))。仮想マシンの複製時に、仮想マシンAの論理アドレスが複製され、仮想マシンBが生成される。このようにして、同じ物理アドレスを参照する複数の仮想マシンが存在するようになる(図27(2))。
 図28に示す「コピーオンライト処理」では、いずれかの仮想マシンから最初の書込アクセスがあった時に(図28(1))、物理メモリの物理メモリ領域を新たに獲得してコピーを作成する(図28(2))。そして、その最初に書込アクセスをした仮想マシンが、その新たに獲得された物理メモリ領域に書き込むようにしている(図28(3))。すなわち、いずれかの仮想マシンから最初の書込アクセスがあるまでは、物理メモリ領域を両仮想マシンで共用することで、メモリ使用量を削減している。そして、一方の仮想マシンから最初の書込アクセスがあったときは、他方の仮想マシンが書込アクセス前の内容を参照できるようにしている。
 本発明者は、以上のような従来技術に基づき想定される仮想マシンの複製方式を詳細に検討した結果、コピーオンライト処理では、仮想マシン複製前の物理メモリ領域の内容が仮想マシンBにとって必要がない場合は、物理メモリ領域を無駄に確保してしまうという問題がある点を見出した。例えば、仮想マシン複製前の仮想マシンAにおいて、アプリケーションプログラム等があるメモリ領域を使用しておらず、未使用のメモリ領域となっている場合、そのメモリ領域に対応する物理メモリ領域には意味のある値は入っていない。前述したコピーオンライト処理では、もし一方の仮想マシンが書込アクセスした場合、当該物理メモリ領域の内容が他方の仮想マシンにとって参照する必要がないにも関わらず、物理メモリ領域を使用してその内容を保持し続けることになる。
 そして、この点に関して、本発明者は検討を重ねた結果、仮想マシン複製前の物理メモリ領域の内容を判別し、物理メモリ領域の内容が他方の仮想マシンにとって参照する必要がない場合には新たに物理メモリ領域を獲得しないようにすることで従来技術に基づき想定される仮想マシン複製処理よりもメモリ使用量を削減可能であることを見出し、本発明に至った。
 以下、本発明に係る仮想計算機システムの一実施の形態について図1~図19を参照して説明する。
≪実施の形態1≫
<概要>
 図1は、実施の形態1に係る仮想計算機システム1による仮想マシン複製時の様子を模式的に表した図である。
 仮想計算機システム1は、仮想マシン複製時に、仮想マシンAのメモリ領域の使用状態に応じて、分類値を付す(図1(2))。ここでは、例えば、仮想計算機システム1は、未使用のメモリ領域を複製する場合に、そのメモリ領域に対応する物理メモリ領域に分類値「1」を付している。
 図2は、分類値「1」が付された物理メモリ領域に、いずれかの仮想マシンが書込アクセスした時の処理を示す図である。
 図2に示すように、まず、分類値「1」が付された物理メモリ領域に、仮想マシンAから最初に書込アクセスがあった時には(図2(1))、新たに物理メモリ領域を獲得することなく(図2(2))、仮想マシンAは、そのままアクセス対象の物理メモリ領域に書き込む(図2(3))。このとき、仮想計算機システム1は、仮想マシンBに対しては、仮想的なメモリ領域をアクセスするように設定しておく(図2(3))。
 その後、仮想計算機システム1は、図3に示すように、他方の仮想マシンBがその仮想的なメモリ領域をアクセスしてきた時に(図3(1))、はじめて新たに物理メモリ領域を獲得し(図3(2))、獲得した物理メモリ領域に、アクセスした仮想マシンBが書き込む(または読み出す)ようにする(図3(3))。すなわち、仮想マシンBが物理メモリ領域へアクセスしたときに初めて新たに物理メモリ領域を獲得し、初期化する等して未使用のメモリ領域を用意すれば足りる。
 このように、仮想計算機システム1は、仮想マシン複製後、いずれかの仮想マシンから最初に書込アクセスがあった時には、新たに物理メモリ領域を獲得しないので、コピーオンライト処理よりもメモリ使用量を削減することができる。
<構成>
 次に、仮想計算機システム1の構成について図4~図10を参照して説明する。
 図4は、実施の形態1に係る仮想計算機システム1の機能構成図である。
 仮想計算機システム1は、仮想マシンA10を複製して仮想マシンB50を生成し、両仮想マシンに対するメモリ領域の割当ておよび各仮想マシンの実行を制御するものである。
 図4に示すように、仮想計算機システム1は、仮想マシンA10と、仮想マシン複製装置20と、仮想マシンメモリ管理装置30と、物理メモリ40とを備えている。
 仮想マシンA10および仮想マシンB50は、OS、アプリケーションプログラム等が動作する一つの仮想的な計算機として、例えばAV処理、ネットワーク処理等を行うものである。
 仮想マシン複製装置20は、仮想マシンAの実行中にユーザ等から新たな仮想マシンの起動要求を受けて、仮想マシンA10を複製することにより、新たな仮想マシンB50を生成するものである。なお、仮想マシンは、複数同時に生成されてもよい。
 仮想マシンメモリ管理装置30は、仮想マシンA10および仮想マシンB50から物理メモリ40へのアクセス要求を受け、該当のメモリ領域へのアクセス制御を行うものである。
 物理メモリ40は、アドレスによりメモリ領域を特定して情報を格納するものである。
 以下、仮想マシンA10、仮想マシン複製装置20および仮想マシンメモリ管理装置30について説明する。
 仮想マシンA10は、アプリケーション11と、仮想OS12とを備える。
 アプリケーション11は、仮想マシンA10において、例えば、AV処理、ネットワーク処理等を行うためのプログラムである。
 仮想OS12は、一般的なOSと同様な機能を備えており、仮想マシンA10において、アプリケーション11から要求を受けて、仮想マシンA10内のメモリ使用状態、メモリ領域の割当て、プログラム実行の管理等を行うものである。仮想OS12は、OSメモリ管理部13と、OSメモリ管理テーブル14とを備える。
 OSメモリ管理部13は、仮想マシンA10に割り当てられたメモリ領域の使用状態の管理を行うものである。メモリ領域の使用状態には、アプリケーションやドライバ等により使用されているかという情報、メモリ領域に格納された情報の参照元の有無が含まれる。
 OSメモリ管理テーブル14は、OSメモリ管理部13が仮想マシンA10内でのメモリ管理を行う際に用いるテーブルである。
 図5は、OSメモリ管理テーブル14のデータ構成および内容例を示す図である。
 OSメモリ管理テーブル14は、同図に示すように、論理メモリ領域14aと、使用カウント14bと、参照元情報14cとを対応付けて構成される情報である。論理メモリ領域14aは、仮想マシンA10に割り当てられたメモリ領域の論理アドレスを格納する項目である。なお、論理メモリ領域各々は、例えば、4KB等のページ単位で管理される。使用カウント14bは、仮想マシンA10内において、当該メモリ領域を使用しているアプリケーションやドライバ等の数を格納する項目である。例えば、この使用カウントが「0」である場合、当該メモリ領域は、未使用であることを示す。参照元情報は、当該メモリ領域の内容が補助記憶装置(例えば、ハードディスク等)にも存在する場合、存在する場所を示す情報(例えば、パス等)を格納する項目である。参照元がない場合は、参照元がないことを示す値「0」を格納する。OSメモリ管理部13は、例えば、アプリケーション11から仮想OS12へメモリ獲得要求があった場合は、このOSメモリ管理テーブル14を参照し、未使用のメモリ領域(使用カウントが「0」である論理メモリ領域)を探して、アプリケーション11に対して当該未使用のメモリ領域の割当てを行う。そして、OSメモリ管理部13は、当該割当てを行ったメモリ領域が使用中であることを識別できるように、当該メモリ領域に対応する使用カウントを「1」加算する。
 次に、仮想マシン複製装置20が備える構成について説明する。
 仮想マシン複製装置20は、メモリ分類部21と、メモリ複製部22を備える。
 メモリ分類部21は、分類値テーブル201を備え、メモリ分類処理を行うものである。メモリ分類処理は、仮想マシンA10を複製するに先立って、仮想マシンA10が使用しているメモリ領域について、OSメモリ管理テーブル14に保持されるメモリ領域の使用状態に関する情報と分類値テーブル201とに基づいて、当該メモリ領域に後述する分類値を付す処理である。
 図6は、分類値テーブル201のデータ構成および内容例を示す図である。
 分類値テーブル201は、分類値201aと使用状態201bとを対応付けて構成される情報である。分類値201aは、仮想マシンメモリ管理装置30が行うメモリ割当処理の内容を識別するための値である分類値を格納する項目である。メモリ割当処理201cは、仮想マシン複製後、いずれかの仮想マシンがアクセスしてきたときの、アクセス対象のメモリ領域を扱う処理である。詳細は、後述する。使用状態201bは、仮想マシンA10が使用しているメモリ領域の使用状態を示す情報を格納する項目である。メモリ分類部21は、OSメモリ管理テーブル14を参照して、メモリ領域の使用状態を判別し、該当する分類値テーブル201の使用状態に対応する分類値を定める。例えば、「一の仮想マシン専用」は、一の仮想マシンにのみ割り当てられるべき、あるいは、割り当てられたメモリ領域であることを意味する。「未使用」は、仮想マシンA10において、アプリケーションやドライバ等が使用しておらず、未使用であることを意味する。例えば、OSメモリ管理テーブル14の使用カウントが「0」となっている場合が「未使用」に該当する。「参照元あり」は、仮想マシンA10が当該メモリ領域に保持して使用していた内容と同じ内容が、当該メモリ領域以外の場所(例えば、ハードディスクやOSが別に管理しているメモリ領域等)にも保持されている状態を意味する。よって、当該メモリ領域を仮想マシンA10と仮想マシンB50が共用する扱いとなっているときは、一の仮想マシンが当該メモリ領域に書込アクセスしてきたときでも、他の仮想マシンのために書込アクセス前の内容を保持しておく必要がない。OSメモリ管理テーブル14の参照元情報が存在する場合や、一の仮想マシンによって書き換えられたメモリ領域の内容を他の仮想マシンが読み出しても問題のない場合が「参照元あり」に該当する。「参照元なし」は、仮想マシンA10が当該メモリ領域に保持して使用していた内容と同じ内容が、当該メモリ領域以外の場所には保持されていない状態を意味する。よって、この使用状態のメモリ領域を仮想マシンA10と仮想マシンB50が共用する扱いとなっているときは、一の仮想マシンが当該メモリ領域に書込アクセスしてきたときには、他の仮想マシンのために書込アクセス前の内容を保持しておく必要がある。OSメモリ管理テーブル14の参照元情報に値がない場合や、一の仮想マシンによってメモリ領域の内容が書き換えられてはいけない場合が「参照元なし」に該当する。
 本実施の形態では、使用状態が「一の仮想マシン専用」に対応する分類値は「0」、「未使用」に対応する分類値は「1」、「参照元あり」に対応する分類値は「2」、「参照元なし」に対応する分類値は「4」としている。分類値「3」および「5」は、メモリ分類部21が付与する値ではなく、後述するメモリ割当処理の過程で付与される中間的な値である。
 また、メモリ分類部21は、メモリ分類処理において、メモリ領域の使用状態に対応する分類値を取得し、仮想マシンメモリ管理テーブル311の分類値に書き込んでいく。
 図7は、仮想マシンメモリ管理テーブル311のデータ構成および内容例を示す図である。
 同図に示すように、仮想マシンメモリ管理テーブル311は、物理メモリ領域311aと、使用カウント311bと、分類値311cとを対応付けて構成される情報である。物理メモリ領域311aは、物理メモリ40のメモリ領域を示す物理アドレスを格納する項目である。使用カウント311bは、当該物理メモリ領域を使用している仮想マシンの数を格納する項目である。使用カウントが「0」の場合、当該物理メモリ領域は、どの仮想マシンからも使用されていないこと意味する。分類値311cは、仮想マシンメモリ管理装置30が行うメモリ割当処理の内容を識別するための値である分類値を格納する項目である。メモリ分類部21は、メモリ分類処理において、仮想マシンA10に割り当てられたメモリ領域のすべてについて、このテーブルの分類値に値を書き込んでいく。分類値が書込まれた仮想マシンメモリ管理テーブル311は、後にメモリ割当処理部35によってメモリ割当処理を行う際に参照される。
 さらに、メモリ分類部21は、メモリ分類処理において、後述するアクセス制御テーブル310に、分類値に応じて、アクセス権限を設定する。これは、仮想マシンメモリ管理装置30が、仮想マシンがアクセスしてきたことおよび当該アクセスのアクセス種別を検知するためである。
 図8は、アクセス制御テーブル310のデータ構成および内容例を示す図である。
 アクセス制御テーブル310は、論理メモリ領域と物理メモリ領域との変換(マッピング)を行うためのものであり、また、各物理メモリ領域に割り当てられた仮想マシンおよびそのアクセス権限を設定するものである。
 アクセス制御テーブル310は、論理メモリ領域310aと、物理メモリ領域310bと、物理メモリ領域が割り当てられた仮想マシンの情報である仮想マシン310cと、当該仮想マシンのアクセス権限310dとが対応付けて構成される情報である。仮想マシンごとにみると、論理メモリ領域と物理メモリ領域は、1対1に対応付けられている。図8の内容例は、仮想マシン複製後の状態を示している。物理メモリ領域310bの「P1」、「P3」、「P4」は、仮想マシンA10および仮想マシンB50が共用するメモリ領域である。物理メモリ領域310bの「P2」、「P10」は、一の仮想マシンにのみ割り当てられている。メモリ分類部21は、仮想マシンがアクセスしてきたことを検知するために、アクセス権限310dを設定する。後述するアクセス制御部31は、例えば、アクセス権限310dに「R/W禁止」が設定された場合、仮想マシンが読出アクセスまたは書込アクセスしてきたときに、このアクセス制御テーブル310を参照して例外を発生させる。また、アクセス制御部31は、仮想マシンがアクセスしてきたことおよびアクセス種別を検知することができる。
 メモリ複製部22は、メモリ分類部21からの要求を受け、後述するメモリ割当解放部34に対して物理メモリ領域の割当てを依頼し、物理メモリ領域を獲得するものである。また、メモリ複製部22は、獲得した物理メモリ領域に対して、指定されたメモリ領域のデータをコピーし、指定された仮想マシンが新たに獲得した物理メモリ領域へアクセスするようにアクセス制御テーブル310に設定する。すなわち、新たに獲得した物理メモリ領域と仮想マシンとをこのテーブルで対応付ける。さらに、メモリ複製部22は、仮想マシンメモリ管理テーブル311における当該新たに獲得した物理メモリ領域に対応する分類値に「0」を設定し、使用カウントに「1」を加える。
 次に、仮想マシンメモリ管理装置30が備える構成について説明する。
 仮想マシンメモリ管理装置30は、アクセス制御部31と、アクセス制御テーブル310と、アクセス検知部32と、メモリ割当処理部35と、仮想マシンメモリ管理テーブル311と、メモリ割当解放部34とを備える。
 アクセス制御部31は、仮想マシン複製後、仮想マシンA10または仮想マシンB50からの物理メモリ領域へのアクセスを監視するものである。また、アクセス制御部31は、書込アクセス、読出アクセスまたは両方のアクセスの監視設定がされている場合、その監視対象のアクセスがあったときに、アクセス検知部32に通知するように構成されている。その際、アクセス制御部31は、書込アクセスか読出アクセスかのアクセス種別、アクセスした仮想マシンの情報およびアクセスする対象の物理メモリ領域の情報をアクセス検知部32へ渡す。
 アクセス検知部32は、アクセス制御部31からアクセス種別、仮想マシンの情報および物理メモリ領域の情報を受け取ると、後述するメモリ割当処理部35にメモリ割当処理要求を行うものである。
 メモリ割当解放部34は、メモリ分類部21、メモリ複製部22および後述するメモリ割当処理部35から物理メモリ領域の割当要求または指定した物理メモリ領域の解放要求を受けて、仮想マシンA10および仮想マシンB50に対してそれぞれ物理メモリ領域の割当処理または解放処理を行うものである。メモリ割当解放部34は、割当要求を受けると、仮想マシンメモリ管理テーブル311(図7参照)を参照して、使用していない物理メモリ領域(つまり、使用カウントが「0」の物理メモリ領域)を検索し、該当する物理メモリ領域に対応する使用カウントを「1」加算することにより、当該物理メモリ領域が使用中であることをセットする。また、メモリ割当解放部34は、当該割当要求の要求元へ当該物理メモリ領域を割り当てる。メモリ割当解放部34は、解放要求を受けると、要求時に指定された物理メモリ領域について、対応する仮想マシンメモリ管理テーブル311の使用カウントを「1」減じる。
 メモリ割当処理部35は、アクセス検知部32からメモリ割当処理要求を受けると、メモリ分類部21により付された分類値に基づき、必要に応じて、仮想マシンへのメモリ割当てを行うものである。具体的には、メモリ割当処理部35は、仮想マシンメモリ管理テーブル311を参照し、仮想マシンがアクセスしてきた物理メモリ領域に対応する分類値を判別し、当該分類値に応じて、メモリ割当処理を行う。メモリ割当処理部35は、必要に応じてメモリ割当解放部34に対して新たな物理メモリ領域の割当てを依頼する。また、メモリ割当処理部35は、必要に応じて、アクセス制御テーブル310の設定を行う。さらに、メモリ割当処理部35は、必要に応じて、仮想マシンメモリ管理テーブル311の分類値を変更する。
 次に、メモリ割当処理部35の構成について説明する。
 図9は、メモリ割当処理部35の機能構成図である。
 メモリ割当処理部35は、同図に示すように、判別部61と、コピーオンライト処理部62と、第1メモリ処理部63と、新規メモリ割当処理部64と、メモリ初期化処理部65と、第2メモリ処理部66と、第3メモリ処理部67とを備える。
 判別部61は、物理メモリ領域に付された分類値に基づいて、当該物理メモリ領域に対する処理を判別するものである。判別部61は、アクセス検知部32から、仮想マシンのアクセスについて書込アクセスか読出アクセスかのアクセス種別、アクセスした仮想マシンの情報およびアクセス対象の物理メモリ領域の情報を受け取る。判別部61は、仮想マシンメモリ管理テーブル311を参照して、受け取った物理メモリ領域に対応する分類値を取得する。判別部61は、分類値が「1」のときは第1メモリ処理部63へ、分類値が「2」のときは第2メモリ処理部66へ、分類値が「3」のときは第3メモリ処理部67へ、分類値が「4」のときはコピーオンライト処理部62へ、分類値が「5」のときは新規メモリ割当処理部64へ、それぞれ処理を依頼する。
 コピーオンライト処理部62は、コピーオンライト処理を行うものである。コピーオンライト処理は、前述した処理(図28参照)であり、分類値「4」に対応する処理である。分類値「4」が付されたメモリ領域のアクセス権限は、メモリ分類部21によって、「W禁止」に設定されている。したがって、仮想マシンからの書込アクセスが検知されたときのみ判別部61からコピーオンライト処理部62へ処理の依頼が来ることとなる。コピーオンライト処理部62は、判別部61から呼び出され、メモリ割当解放部34に対して新たな物理メモリ領域の割当てを依頼し、獲得した物理メモリ領域に対して、アクセス対象の物理メモリ領域の内容をコピーする。また、コピーオンライト処理部62は、新たに獲得した物理メモリ領域をアクセスしてきた仮想マシンに割り当てるようにアクセス制御テーブル310に設定し、アクセス監視を解除する。さらに、コピーオンライト処理部62は、仮想マシンメモリ管理テーブル311に対して、新たに獲得した物理メモリ領域に対応する使用カウントを「1」、分類値を「0」に設定する。コピーオンライト処理部62は、元の物理メモリ領域についてもアクセス監視を解除し、仮想マシンメモリ管理テーブル311に対して、元の物理メモリ領域に対応する使用カウントを「1」減じ、分類値を「0」に設定する。
 第1メモリ処理部63は、第1メモリ処理を行うものである。第1メモリ処理は、前述した<概要>の項目で示した処理(図2参照)であり、分類値「1」に対応する処理である。第1メモリ処理部63は、判別部61から呼び出され、アクセスしてきた仮想マシンに対してのアクセス監視を解除するようにアクセス制御テーブル310に設定する。また、第1メモリ処理部63は、仮想マシンメモリ管理テーブル311に対して、アクセス対象の物理メモリ領域に対応する使用カウントを「1」、分類値を「0」に設定する。それとともに、第1メモリ処理部63は、当該物理メモリ領域を参照するように設定されている他の仮想マシンに対して、新規メモリ割当領域41にアクセスするようにアクセス制御テーブル310に設定する。
 図10は、仮想マシン複製後、仮想マシンA10から最初に書込アクセスがあった場合における第1メモリ処理終了後のアクセス制御テーブル310を示した図である。なお、図8は、仮想マシン複製後、第1メモリ処理開始前のアクセス制御テーブル310である。
 図10に示すように、仮想マシンA10には、物理メモリ領域「P4」がそのまま割り当てられ、アクセス監視は解除されている。仮想マシンB50には、新規メモリ割当領域41である「Pk」が割り当てられ、アクセス監視は「R/W禁止」が設定されている。物理メモリ領域「Pk」は、仮想マシンメモリ管理テーブル311において、分類値「5」に設定されている。
 新規メモリ割当領域41は、特定のメモリ領域を指すものであり、仮想マシンからそのメモリ領域へのアクセスについては、アクセス制御部31がそのアクセスを検知し、アクセス検知部32へ通知する。この新規メモリ割当領域41に対応する仮想マシンメモリ管理テーブル311の分類値は「5」としておく。なお、新規メモリ割当領域41に対して、現実に存在する物理メモリ領域を対応付ける必要は必ずしもなく、仮想的なメモリ領域を定義する(つまり、アクセス制御テーブル310の物理メモリ領域310bに識別子等を設定しておき、その識別子が仮想マシンメモリ管理テーブル311において分類値「5」と対応づけられている)だけでよい。すなわち、仮想マシンがアクセスしたときに、分類値「5」に対応する新規メモリ割当処理を実行させることができればよい。
 新規メモリ割当処理部64は、新規メモリ割当処理を行うものである。新規メモリ割当処理は、前述した<概要>の項目で示した処理(図3参照)であり、分類値「5」に対応する処理である。新規メモリ割当処理部64は、判別部61から呼び出され、メモリ割当解放部34に対して新たな物理メモリ領域の割当てを依頼し、獲得した物理メモリ領域に対して、後述するメモリ初期化処理部65を呼び出して、初期値を書き込ませる。新規メモリ割当処理部64は、新たに獲得した物理メモリ領域を、アクセスしてきた仮想マシンに割り当てるようにアクセス制御テーブル310に設定する。また、新規メモリ割当処理部64は、新たに獲得した物理メモリ領域に対するアクセス監視を解除する。さらに、新規メモリ割当処理部64は、仮想マシンメモリ管理テーブル311に対して、新たに獲得した物理メモリ領域に対応する使用カウントを「1」、分類値を「0」に設定する。
 メモリ初期化処理部65は、新規メモリ割当処理部64から呼び出され、指定された物理メモリ領域について、予め定められた一定のデータ列(例えば、「00…0」のようなオールゼロ等)で初期化処理を行う。
 第2メモリ処理部66は、第2メモリ処理を行うものである。第2メモリ処理は、分類値「2」に対応する処理である。ここで、第2メモリ処理について説明する。分類値「2」は、仮想マシン複製時のメモリ領域の使用状態が「参照元あり」として分類されたものである。これは、仮想マシン複製前にアプリケーション等が当該メモリ領域を使用していたものであり、仮想マシン複製後において、一の仮想マシンから最初に読出アクセスがあった後、他の仮想マシンからも読出アクセスがあることが考えられる。読出アクセスがあるごとに例外を発生させると、仮想マシンシステムの性能の観点から好ましくないため、一の仮想マシンから最初に読出アクセスがあった物理メモリ領域は、読出アクセスによって例外が発生しないコピーオンライト処理の対象とする。すなわち、第2メモリ処理部66は、仮想マシンメモリ管理テーブル311に対して、アクセス対象の物理メモリ領域に対応する分類値を「4」に設定する。また、第2メモリ処理部66は、アクセスしてきた仮想マシンに対しての読出アクセス監視を解除するようにアクセス制御テーブル310に設定する。
 一方、仮想マシン複製後において、一の仮想マシンから最初に書込アクセスがあったときには、第1メモリ処理と同様に、コピーオンライト処理よりもさらにメモリ使用量を削減する処理を行う。すなわち、第2メモリ処理部66は、仮想マシンメモリ管理テーブル311に対して、アクセス対象の物理メモリ領域に対応する分類値を「3」に設定する。また、第2メモリ処理部66は、アクセスしてきた仮想マシンに対しての読出/書込アクセス監視を解除するようにアクセス制御テーブル310に設定する。
 第3メモリ処理部67は、第3メモリ処理を行うものである。第3メモリ処理は、分類値「3」に対応する処理である。第3メモリ処理は、仮想マシンが読出アクセスまたは書込アクセスしてきたときに、メモリ割当解放部34に対して新たな物理メモリ領域の割当てを依頼し、獲得した物理メモリ領域に対して、アクセス対象の物理メモリ領域の内容をコピーする。また、第3メモリ処理部67は、新たに獲得した物理メモリ領域をアクセスしてきた仮想マシンに割り当てるようにアクセス制御テーブル310に設定し、アクセス監視も解除する。さらに、第3メモリ処理部67は、仮想マシンメモリ管理テーブル311に対して、新たに獲得した物理メモリ領域に対応する使用カウントを「1」、分類値を「0」に設定する。さらに、第3メモリ処理部67は、仮想マシンメモリ管理テーブル311に対して、コピー元の物理メモリ領域に対応する使用カウントを「1」減じる。「1」減じた結果、当該使用カウントが「1」である場合には、分類値を「0」に設定する。
<動作>
 以下、仮想計算機システム1の動作について、図11~図19(構成は適宜図1および図9)を参照して説明する。
<メモリ分類処理>
 図11は、仮想計算機システム1のメモリ分類部21によるメモリ分類処理を示すフローチャートである。
 メモリ分類処理は、複製元の仮想マシンのメモリ領域の使用状態に応じて、メモリ領域ごとに分類値を付す処理である。メモリ分類部21は、仮想マシンを複製する際に、仮想マシンA10に割り当てられた各々のメモリ領域に対してこの処理を行う。
 メモリ分類部21は、該当のメモリ領域についてコピー処理が必要か否かを判断する(ステップS11)。ここで、コピー処理について説明する。仮想マシンA10に割り当てられたメモリ領域が一の仮想マシンにのみ割り当てられる必要がある場合は、仮想マシン複製後、仮想マシンA10と仮想マシンB50が当該メモリ領域に対応する物理メモリ領域を共用しないようにする必要がある。そのため、仮想マシンA10および仮想マシンB50のそれぞれに対して物理メモリ領域を用意するため、新たに物理メモリ領域を獲得して、当該物理メモリ領域に、仮想マシンA10に割り当てられていたメモリ領域の内容をコピーする。一の仮想マシンにのみ割り当てられる必要があるか否かは、メモリ領域ごとに予め定められている。
 コピー処理が必要である場合は(ステップS11・Yes)、メモリ分類部21は、分類値を「0」にし(ステップS12)、仮想マシンメモリ管理テーブル311の分類値に「0」を設定し(ステップS19)、当該物理メモリ領域のコピー処理をメモリ複製部22に依頼する(ステップS21)。
 一方、コピー処理が必要でない場合は(ステップS11・No)、メモリ分類部21は、OSメモリ管理テーブル14(図5参照)を参照する(ステップS13)。そして、メモリ分類部21は、当該メモリ領域の使用カウントが「0」か否かを判定する(ステップS14)。
 使用カウントが「0」である場合は(ステップS14・Yes)、メモリ分類部21は、分類値を「1」にする(ステップS15)。
 一方、使用カウントが「0」でない場合は(ステップS14・No)、メモリ分類部21は、当該メモリ領域の参照元情報が存在するか否かを判定する(ステップS16)。
 参照元情報が存在する場合は(ステップS16・Yes)、メモリ分類部21は、分類値を「2」にする(ステップS18)。
 一方、参照元情報が存在しない場合は(ステップS16・No)、メモリ分類部21は、分類値を「4」にする(ステップS17)。
 ステップS19において、メモリ分類部21は、仮想マシンメモリ管理テーブル311(図7参照)の分類値311cに値を書き込む。次に、メモリ分類部21は、該当のメモリ領域に対して、分類値を検査する(ステップS20)。分類値が「4」の場合は、メモリ分類部21は、該当のメモリ領域に対して、書込アクセスを監視するようにアクセス制御テーブル310に設定する(ステップS22)。分類値が「1」または「2」の場合は、メモリ分類部21は、該当のメモリ領域に対して、読出アクセスおよび書込アクセスを監視するようにアクセス制御テーブル310に設定する(ステップS23)。以上でメモリ分類処理は、終了する。
 メモリ分類部21は、このメモリ分類処理を仮想マシンA10に割り当てられたすべてのメモリ領域に対して行う。
<メモリ割当処理>
 図12は、仮想計算機システム1のメモリ割当処理部35によるメモリ割当処理を示すフローチャートである。
 メモリ割当処理は、仮想マシン複製後、いずれかの仮想マシンから物理メモリ40へのアクセスがあったときに開始する。具体的には、メモリ割当処理部35がアクセス検知部32からメモリ割当処理要求を受け取ったときに開始する。
 判別部61は、仮想マシンメモリ管理テーブル311(図7参照)を参照して、アクセス対象の物理メモリ領域に対応する分類値を読み込む(ステップS21)。次に、判別部61は、当該分類値を判定し(ステップS22)、分類値が「1」の場合は(ステップS22・分類値1)、第1メモリ処理部63が、第1メモリ処理を行う(ステップS23)。分類値が「2」の場合は(ステップS22・分類値2)、第2メモリ処理部66が、第2メモリ処理を行う(ステップS24)。分類値が「3」の場合は(ステップS22・分類値3)、第3メモリ処理部67が、第3メモリ処理を行う(ステップS25)。分類値が「4」の場合は(ステップS22・分類値4)、コピーオンライト処理部62が、コピーオンライト処理を行う(ステップS26)。分類値が「5」の場合は(ステップS22・分類値5)、新規メモリ割当処理部64が、新規メモリ割当処理を行う(ステップS27)。
<第1メモリ処理(分類値「1」)>
 図13は、仮想計算機システム1の第1メモリ処理部63による第1メモリ処理を示すフローチャートである。
 第1メモリ処理は、判別部61から、アクセスした仮想マシンの情報およびアクセスする対象の物理メモリ領域の情報とともに、第1メモリ処理の依頼がきたときに、開始される。
 第1メモリ処理部63は、アクセスしてきた仮想マシンに対してのアクセス監視を解除するようにアクセス制御テーブル310(図8参照)に設定する(ステップS231)。これは、アクセス対象のメモリ領域が、以降、アクセスしてきた仮想マシン専用のメモリ領域となるため、アクセスを検知する必要がないからである。次に、第1メモリ処理部63は、仮想マシンメモリ管理テーブル311に対して、アクセス対象の物理メモリ領域に対応する使用カウントを「1」、分類値を「0」に設定する(ステップS232)。次に、第1メモリ処理部63は、当該物理メモリ領域を参照するように設定されている他の仮想マシンに対して、新規メモリ割当領域41にアクセスするようにアクセス制御テーブル310に設定する(ステップS233)。以上で第1メモリ処理は、終了する。
 図2は、分類値「1」が付された物理メモリ領域に、いずれかの仮想マシンが書込アクセスした時の処理を示す図であり、第1メモリ処理を模式的に示す図である。
 図2に示すように、分類値「1」が付された物理メモリ領域に、一の仮想マシンから最初に書込アクセスがあった時には、新たに物理メモリ領域を獲得することなく、アクセスした仮想マシンは、そのままアクセス対象の物理メモリ領域に書き込む。このとき、仮想計算機システム1は、他の仮想マシンに対しては、新規メモリ割当領域41をアクセスするように設定しておく。新規メモリ割当領域41の分類値は「5」である。
<新規メモリ割当処理(分類値「5」)>
 図14は、仮想計算機システム1の新規メモリ割当処理部64による新規メモリ割当処理を示すフローチャートである。
 新規メモリ割当処理は、判別部61から、アクセスしてきた仮想マシンの情報とともに、新規メモリ割当処理の依頼がきたときに、開始される。
 新規メモリ割当処理部64は、メモリ割当解放部34に依頼して新たな物理メモリ領域を獲得する(ステップS271)。次に、新規メモリ割当処理部64は、メモリ初期化処理部65を呼び出して、獲得した物理メモリ領域を初期化する(ステップS272)。新規メモリ割当処理部64は、新たに獲得した物理メモリ領域を、アクセスしてきた仮想マシンに割り当てるようにアクセス制御テーブル310に設定する(ステップS273)。つまり、アクセス制御テーブル310の物理メモリ領域310bの新規メモリ割当領域41が設定されていたところに、新たに獲得した物理メモリ領域のアドレスをセットする。新規メモリ割当処理部64は、仮想マシンメモリ管理テーブル311に対して、新たに獲得した物理メモリ領域に対応する使用カウントを「1」、分類値を「0」に設定する(ステップS274)。以上で新規メモリ割当処理は、終了する。
 図3は、分類値「5」が付されたメモリ領域に、仮想マシンが書込アクセスした時の処理を示す図であり、新規メモリ割当処理を模式的に示す図である。
 図3に示すように、他の仮想マシンが新規メモリ割当領域41にアクセスしてきた時に、仮想計算機システム1は、新たに物理メモリ領域を獲得し、獲得した物理メモリ領域に当該他の仮想マシンが書き込むようにしている。
<第2メモリ処理(分類値「2」)>
 図15は、仮想計算機システム1の第2メモリ処理部66による第2メモリ処理を示すフローチャートである。
 第2メモリ処理は、判別部61から、仮想マシンのアクセスについて書込アクセスか読出アクセスかのアクセス種別、アクセスした仮想マシンの情報およびアクセスする対象の物理メモリ領域の情報とともに、第2メモリ処理の依頼がきたときに、開始される。
 まず、第2メモリ処理部66は、仮想マシンからのアクセス種別を判定する(ステップS241)。
 読出アクセスの場合は(ステップS241・読出アクセス)、第2メモリ処理部66は、仮想マシンメモリ管理テーブル311に対して、アクセス対象の物理メモリ領域に対応する分類値を「4」に設定する(ステップS242)。次に、第2メモリ処理部66は、アクセスしてきた仮想マシンに対しての読出アクセス監視を解除するようにアクセス制御テーブル310に設定する(ステップS243)。
 一方、書込アクセスの場合は(ステップS241・書込アクセス)、第2メモリ処理部66は、仮想マシンメモリ管理テーブル311に対して、アクセス対象の物理メモリ領域に対応する分類値を「3」に設定する(ステップS244)。次に、第2メモリ処理部66は、アクセスしてきた仮想マシンに対しては、読出/書込アクセス監視を解除するように、また、他の仮想マシンに対しては、読出/書込アクセス監視をするように、アクセス制御テーブル310に設定する(ステップS245)。以上で第2メモリ処理は、終了する。
 図16は、分類値「2」が付されたメモリ領域に、仮想マシンが書込アクセスした時の処理を示す図であり、第2メモリ処理を模式的に示す図である。
 図16に示すように、分類値「2」が付された物理メモリ領域に、一の仮想マシンから最初に書込アクセスがあった時には、新たに物理メモリ領域を獲得することなく、アクセスした仮想マシンは、そのままアクセス対象の物理メモリ領域に書き込む。そして、当該物理メモリ領域の分類値は「3」に変更する。図示していないが、一の仮想マシンから最初に読出アクセスがあった時には、同様に、新たに物理メモリ領域を獲得することなく、アクセスした仮想マシンは、そのままアクセス対象の物理メモリ領域から読み出す。そして、当該物理メモリ領域の分類値は「4」に変更する。
<第3メモリ処理(分類値「3」)>
 図17は、仮想計算機システム1の第3メモリ処理部67による第3メモリ処理を示すフローチャートである。
 第3メモリ処理は、判別部61から、アクセスした仮想マシンの情報およびアクセスする対象の物理メモリ領域の情報とともに、第3メモリ処理の依頼がきたときに、開始される。
 第3メモリ処理部67は、仮想マシンが読出アクセスまたは書込アクセスしてきたときに、メモリ割当解放部34に依頼して、新たな物理メモリ領域を獲得する(ステップS251)。次に、第3メモリ処理部67は、獲得した物理メモリ領域に対して、アクセス対象の物理メモリ領域の内容をコピーする(ステップS252)。次に、第3メモリ処理部67は、新たに獲得した物理メモリ領域をアクセスしてきた仮想マシンに割り当てるようにアクセス制御テーブル310に設定する(ステップS253)。次に、第3メモリ処理部67は、仮想マシンメモリ管理テーブル311に対して、新たに獲得した物理メモリ領域に対応する使用カウントを「1」、分類値を「0」に設定する(ステップS254)。次に、第3メモリ処理部67は、仮想マシンメモリ管理テーブル311に対して、コピー元の物理メモリ領域に対応する使用カウントを「1」減じる(ステップS255)。第3メモリ処理部67は、使用カウントを「1」減じた結果、当該使用カウントが「1」である場合には、分類値を「0」に設定する(ステップS257)。以上で第3メモリ処理は、終了する。
 図18は、分類値「3」が付されたメモリ領域に、仮想マシンが書込アクセスした時の処理を示す図であり、第3メモリ処理を模式的に示す図である。
 図18に示すように、他の仮想マシンが分類値「3」の物理メモリ領域に書込アクセスしてきた時に、仮想計算機システム1は、新たに物理メモリ領域を獲得し、獲得した物理メモリ領域に、アクセス対象の物理メモリ領域の内容をコピーする。そして、仮想計算機システム1は、新たに獲得した物理メモリ領域に、アクセスした仮想マシンが書き込むようにしている。
 図19は、分類値「3」が付されたメモリ領域に、仮想マシンが読出アクセスした時の処理を示す図であり、第3メモリ処理を模式的に示す図である。
 図19に示すように、他の仮想マシンが分類値「3」の物理メモリ領域に読出アクセスしてきた時に、仮想計算機システム1は、新たに物理メモリ領域を獲得し、獲得した物理メモリ領域に、アクセス対象の物理メモリ領域の内容をコピーする。そして、仮想計算機システム1は、当該物理メモリ領域からその内容を読み出すようにしている。なお、この場合は、一の仮想マシンによって書き換えられたメモリ領域の内容を他の仮想マシンが読み出しても問題のない場合である。
 以上、実施の形態1によると、一の仮想マシンを複製して他の仮想マシンを生成する際に、未使用のメモリ領域や参照元が存在するメモリ領域に対して、いずれかの仮想マシンから最初に書込アクセスがあったときには、新たに物理メモリ領域を獲得することがないので、コピーオンライト処理よりもさらにメモリ使用量を削減することができる。
 また、参照元が存在するメモリ領域に対して読出/書込アクセスを監視している場合において、一の仮想マシンから最初に読出アクセスがあった場合は、その後の他の仮想マシンから当該メモリ領域へのアクセスに対しては、コピーオンライト処理を行うこととしているので、一の仮想マシンから最初に読出アクセスがあった後、他の仮想マシンから読出アクセスがあっても、例外が発生せず、仮想計算機システムの性能面を改善することができる。
≪実施の形態2≫
 次に、本発明の実施の形態2について、図20および図21を参照して説明する。
<概要>
 実施の形態1に係る仮想計算機システム1は、メモリ分類処理のステップS14において(図11参照)、使用カウントが「0」である場合は(ステップS14・Yes)、分類値を「1」にすることとしている(ステップS15)。すなわち、仮想マシン複製前のメモリ領域の使用状態が未使用であるときでも、物理メモリ領域は解放せずに仮想マシンA10と仮想マシンB50が共用するようにしている。一方、実施の形態2に係る仮想計算機システム1Bは、メモリ分類処理において、メモリ領域の使用状態が未使用であると判別したときは、そのメモリ領域に対応する物理メモリ領域を解放するようにする。これにより、さらにメモリ使用量を削減することができる。
<構成>
 仮想計算機システム1Bの構成は、仮想計算機システム1の構成と同様である。なお、仮想計算機システム1の構成と同一の構成には同一の符号を付して、重複した説明は省略する。
<動作>
 以下、仮想計算機システム1Bの動作について、図20および図21を参照して説明する。
 図20は、仮想計算機システム1Bのメモリ分類部21Bによるメモリ分類処理の動作を示すフローチャートである。実施の形態1と異なる点のみを説明する。
 ステップS31~34は、ステップS11~14(図11参照)と同様である。
 ステップS34において、使用カウントが「0」である場合は(ステップS34・Yes)、ステップS35において、メモリ分類部21Bは、メモリ割当解放部34に依頼して、当該メモリ領域に対応する物理メモリ領域を解放する。さらに、メモリ分類部21Bは、当該メモリ領域に対して分類値「5」が付された新規メモリ割当領域41が対応するようにアクセス制御テーブル310に設定する。そして、メモリ分類処理は、終了する。
 図21は、仮想計算機システム1Bによる仮想マシン複製時の様子を模式的に表した図である。
 仮想計算機システム1Bは、仮想マシン複製時に、メモリ領域の使用状態が未使用であると判別したときは、そのメモリ領域に対応する物理メモリ領域を解放するようにする。そして、当該メモリ領域に対して分類値「5」が付された新規メモリ割当領域41が対応するようにしておく。その後、いずれかの仮想マシンが当該新規メモリ割当領域41にアクセスしてきたときは、図3に示すように、仮想計算機システム1Bは、新規メモリ割当処理を行う。
 以上、実施の形態2によると、仮想マシン複製時に、仮想マシンが未使用であるメモリ領域に対応する物理メモリ領域をすべて解放することができる。
≪実施の形態3≫
 次に、本発明の実施の形態3について、図22~図26を参照して説明する。
<概要>
 一般に、仮想マシンにおけるアプリケーション等が論理メモリ領域を使用しなくなり、仮想OSがその論理メモリ領域を解放する(例えば、アプリケーションと論理メモリ領域とを対応付けたメモリ管理用の情報を削除する等)と、当該論理メモリ領域は、当該仮想マシンにおける未使用の論理メモリ領域を管理する空きメモリリストにつなげられる。しかしながら、当該論理メモリ領域に対応する物理メモリ領域は解放されるわけではなく、当該仮想マシンに割り当てられたままとなっている。
 実施の形態3に係る仮想計算機システム1Cは、仮想OSが論理メモリ領域を解放するために、空きメモリリストにアクセスしたことを検知した時に、当該論理メモリ領域に対応する物理メモリ領域の解放を行うことで、仮想マシンに対する物理メモリ領域の解放を即時に行うことができ、物理メモリ領域の使用効率を向上することができるようにしたものである。
<構成>
 次に、仮想計算機システム1Cの構成について図22を参照して説明する。
 図22は、実施の形態3に係る仮想計算機システム1Cの機能構成図である。なお、仮想計算機システム1の構成と同一の構成には同一の符号を付して、重複した説明は省略する。
 仮想計算機システム1Cは、仮想マシンA10Cにおける空きメモリリスト15と、仮想マシン起動装置70と、仮想マシンメモリ管理装置30Cにおけるメモリリスト処理部68と、物理メモリ40Cにおけるメモリリスト監視領域42とを備える。
 空きメモリリスト15は、仮想マシン内の空きメモリ領域を管理するための管理情報であり、例えば、仮想マシンA10Cの論理メモリ領域のうち仮想マシンA10C内において未使用であるすべての論理メモリ領域各々を特定するための情報(アドレス等)を含ませたリストである。
 図23は、空きメモリリスト15の一例を示す図である。このリストの各データ「1」、「2」、…、「n」は、仮想マシンA10C内において未使用である論理メモリ領域のアドレスである。本実施の形態では、OSメモリ管理部13は、論理メモリ領域の割当てまたは解放をするときは、必ず空きメモリリスト15にアクセスするようになっているものとする。OSメモリ管理部13は、アプリケーション11から論理メモリ領域の解放要求があると、空きメモリリスト15にアクセスし、アプリケーション11が指定した論理メモリ領域を空きメモリリスト15に含ませる。また、OSメモリ管理部13は、アプリケーション11から論理メモリ領域の割当要求があると、空きメモリリスト15にアクセスし、空きメモリリスト15から未使用の論理メモリ領域を取得し、アプリケーション11に当該論理メモリ領域を割り当てる。
 仮想マシン起動装置70は、OSメモリ処理設定部71を備える。OSメモリ処理設定部71は、仮想マシンA10Cが起動する際に呼び出され、アクセス制御設定処理を行うものである。アクセス制御設定処理は、OSメモリ処理設定部71が、空きメモリリスト15が格納されている所定の論理メモリ領域について、そのメモリ領域へのアクセスがメモリリスト監視領域42へのアクセスとなるように、アクセス制御テーブル310Cに設定することにより行われる。
 図24は、OSメモリ処理設定部71が、仮想マシンA10Cが起動する際に、アクセス制御テーブル310Cを更新した後の一例を示す図である。
 論理メモリ領域310a「空きメモリリストの領域」は、例えば、空きメモリリスト15の先頭の論理アドレスである。この論理アドレスへのアクセスがメモリリスト監視領域42へのアクセスとなるように、対応する物理メモリ領域310bに「メモリリスト監視領域」が設定されている。
 メモリリスト監視領域42は、新規メモリ割当領域41と同様、物理メモリ40内の一部として存在する。仮想マシンからこのメモリリスト監視領域42へのアクセスについては、図24に示すように、アクセス権限に「R/W禁止」が設定されており、アクセスが監視される。アクセス制御部31が、このメモリリスト監視領域42へのアクセスを検知すると、アクセス検知部32へ通知する。このとき、アクセス検知部32は、メモリ割当処理部35Cの後述するメモリリスト処理部68を呼び出すように構成されている。また、アクセス制御部31は、仮想マシンから空きメモリリスト15へのアクセス情報を受け取り、この情報をアクセス検知部32へ渡す。この空きメモリリスト15へのアクセス情報は、仮想マシンがメモリ領域を解放しようとしているのか、割当てしようとしているのかを判断することができる情報である。例えば、アドレス値および空きメモリリスト15につなぐ処理を要求する情報であるときは、仮想マシンがメモリ領域を解放しようとしていると判断する。一方、空きメモリリスト15からメモリ領域を取得する処理を要求する情報であるときは、仮想マシンがメモリ領域を割当てしようとしていると判断する。
 メモリリスト処理部68は、アクセス検知部32から空きメモリリスト15へのアクセス情報を受け取り、仮想マシンがメモリ領域を解放しようとしているのか、または割当てしようとしているのかを判断するものである。メモリリスト処理部68は、仮想マシンがメモリ領域を解放しようとしていると判断すると、解放しようとしている論理メモリ領域に対応する物理メモリ領域をメモリ割当解放部34に渡し、当該物理メモリ領域の解放を指示する。メモリリスト処理部68は、仮想マシンがメモリ領域を割当てしようとしていると判断すると、メモリ割当解放部34に物理メモリ領域の割当てを指示する。
<動作>
 以下、仮想計算機システム1Cの動作について、図25および図26(構成は適宜図22)を参照して説明する。
 図25は、仮想計算機システム1CのOSメモリ処理設定部71によるアクセス制御設定処理を示すフローチャートである。
 この処理は、仮想マシンが起動される際に、開始する。
 まず、OSメモリ処理設定部71は、空きメモリリスト15に対する読出アクセスまたは書込アクセスがメモリリスト監視領域42へのアクセスとなるように、アクセス制御テーブル310Cを設定する(ステップS41)。次に、OSメモリ処理設定部71は、メモリリスト監視領域42への読出アクセスおよび書込アクセス監視をアクセス制御テーブル310Cに設定をする(ステップS42)。以上で、アクセス制御設定処理は、終了する。
 図26は、仮想計算機システム1Cのメモリ割当解放処理を示すフローチャートである。
 この処理は、仮想計算機システム1Cが仮想マシンに対して物理メモリ領域を割当または解放するときの処理である。
 まず、OSメモリ管理部13が空きメモリリスト15へアクセスする(ステップS51)。次に、アクセス制御部31は、当該アクセスを検知し、アクセス検知部32へ通知する(ステップS52)。次に、アクセス検知部から呼び出されたメモリリスト処理部68は、当該アクセスが、メモリ領域の解放なのか、割当てなのかを判断する(ステップS53)。メモリ領域の解放であるときは(ステップS53・解放)、メモリ割当解放部34は、メモリ解放処理を行う(ステップS54)。メモリ解放処理は、メモリ割当解放部34が、解放の対象である物理メモリ領域をメモリリスト処理部68から受け取り、仮想マシンメモリ管理テーブル311において、当該物理メモリ領域に対応する使用カウントを「1」減じることにより行われる。その結果、使用カウントが「0」になれば、当該物理メモリ領域は、解放されたことになり、未使用となる。メモリ領域の割当てであるときは(ステップS53・割当)、メモリ割当解放部34は、メモリ割当処理を行う(ステップS55)。メモリ割当処理は、メモリ割当解放部34が、仮想マシンメモリ管理テーブル311を参照し、解放されている未使用(使用カウントが「0」)の物理メモリ領域を検索し、当該物理メモリ領域に対応する使用カウントを「1」加算することで使用中であることをセットし、当該物理メモリ領域に対応する論理メモリ領域を仮想OS12Cへ渡すことにより行われる。以上で、メモリ割当解放処理は、終了する。
 以上、実施の形態3によると、仮想OSが論理メモリ領域を解放するために、空きメモリリストにアクセスしたことを検知した時に、当該論理メモリ領域に対応する物理メモリ領域の解放が行われるので、仮想マシンに対する物理メモリ領域の解放を即時に行うことができ、物理メモリ領域の使用効率を向上することができる。
≪補足≫
 以上、本発明に係る仮想計算機システムを、実施の形態に基づいて説明したが、本発明の趣旨を逸脱しない範囲で変更することができる。例えば、以下のように変形することも可能であり、本発明は上述した実施の形態で示した通りの仮想計算機システムに限らない。
(1)実施の形態では、メモリ領域の使用状態には、アプリケーションやドライバ等により使用されているかという情報、メモリ領域に格納された情報の参照元の有無が含まれるとして説明したが、これらに限るものではない。例えば、当該メモリ領域を使用中のアプリケーション以外のアプリケーションにより利用可能であるか否かという情報を含んでもよい。
 この場合、OSメモリ管理テーブル14(図5参照)に、プライベートメモリフラグの項目を設ける。プライベートメモリフラグは、当該メモリ領域が、使用しているアプリケーションのみで使用可能である場合に「1」を、それ以外の場合に「0」を格納するものである。プライベートメモリフラグが「1」となっている場合は、メモリ領域の使用状態を実施の形態1で説明した「参照元なし」に該当させ、プライベートメモリフラグが「0」となっている場合は、「参照元あり」に該当させることとしてもよい。
(2)実施の形態では、メモリ分類処理(図11参照)のステップS11において、当該メモリ領域についてコピー処理が必要か否かを判断するとして説明したが、次のようにしてもよい。すなわち、一の仮想マシンにのみ割り当てられる必要があるメモリ領域については、仮想マシン複製前に予め仮想マシンメモリ管理テーブル311(図7参照)の使用カウント311bに「1」、分類値311cに「0」を設定しておいてもよい。これにより、メモリ分類処理のステップS11における判断が省略できるので、処理効率を上げることができる。
(3)実施の形態では、図14のフローチャートに示すように、新規メモリ割当処理のステップS272において、新規メモリ割当処理部64は、メモリ初期化処理部65を呼び出して、獲得した物理メモリ領域を初期化するとして説明した。しかしながら、メモリ領域の割当てを受ける仮想マシンがセキュアである場合については、この初期化を行わないとしてもよい。これにより、処理の軽減化を図ることができる。例えば、割当てが行われた物理メモリ領域がもともとどの仮想マシンで使われていたかを判断し、その仮想マシンが今回割当てを受ける仮想マシンと同じである場合には、この初期化を行わないとしてもよい。
(4)実施の形態では、図19に示すように、他の仮想マシンが分類値「3」の物理メモリ領域に読出アクセスしてきた時に、仮想計算機システム1は、新たに物理メモリ領域を獲得し、獲得した物理メモリ領域に、アクセス対象の物理メモリ領域の内容をコピーする。そして、仮想計算機システム1は、当該物理メモリ領域からその内容を読み出すようにしているとして説明した。しかしながら、一の仮想マシンの書込アクセス前のメモリ領域の内容を保持している場所(例えば、ストレージ等)から、当該内容を新たに獲得した物理メモリ領域に読み込み、アクセスした他の仮想マシンが当該内容を当該物理メモリ領域から読み出すようにしてもよい。
(5)実施の形態では、図23に示すように、仮想マシン内の空きメモリ領域を管理するための管理情報として、リストを使用したが、これに限られない。空きメモリ領域を管理するための情報であって、メモリ領域を解放する際に必ず仮想OSがアクセスするものであれば、どのような形態でもよい。例えば、空きメモリ領域を管理するための管理情報は、いわゆるビットマップ方式やメモリマップ方式でもよい。アクセス制御部31は、これらの管理情報に仮想OSがアクセスしたことを検知するように構成される。
(6)実施の形態に係る仮想計算機システム1に、上記(1)~(5)の一部または全部の変形を組み合わせて適用してもよい。
(7)以下、さらに本発明の一実施形態に係る仮想計算機システムの構成およびその変形例と各効果について説明する。
(a)本発明の一実施形態に係る仮想計算機システムは、第1の仮想マシンを複製することで1以上の第2の仮想マシンを生成する仮想計算機システムであって、前記第1の仮想マシンがアクセスし得る1以上の各メモリ領域について、前記1以上の第2の仮想マシンの生成後、前記第1の仮想マシンおよび前記1以上の第2の仮想マシンのうちいずれかの仮想マシンが書込アクセスをするまでは、各仮想マシンから共に読出アクセスし得るものとして管理する管理手段と、前記管理手段が管理する前記各メモリ領域について、前記書込アクセスが行われる場合には、当該書込アクセス前のメモリ内容を当該書込アクセスを行った仮想マシン以外の仮想マシンが将来アクセスするときのために保持しておく必要がない特定種メモリ領域か否かの判別を行う判別手段と、前記特定種メモリ領域への前記書込アクセスを検知する第1検知手段と、前記第1検知手段により前記書込アクセスが検知された後に、当該書込アクセスを行った仮想マシン以外の仮想マシンが当該特定種メモリ領域にアクセスしようとしていることを検知する第2検知手段と、前記第2検知手段により特定種メモリ領域にアクセスしようとしていることが検知された仮想マシンに対して、当該アクセスの対象として新たにメモリ領域を獲得して割当を行うメモリ割当手段とを備える。
 この仮想計算機システムは、一の仮想マシンを複製して他の仮想マシンを生成する際に、未使用のメモリ領域や参照元が存在するメモリ領域に対して、いずれかの仮想マシンから最初に書込アクセスがあったときには、新たに物理メモリ領域を獲得することがないので、コピーオンライト処理よりもさらにメモリ使用量を削減することができる。
 また、動的に仮想マシンを生成・消滅させるような仮想計算機システムにおいて、動的に生成した仮想マシンと元の仮想マシンとのいずれか一方しか使わないメモリ領域について、無駄なメモリ領域の確保を防止し、全体の物理メモリ領域のメモリ使用量を削減することができる。
(b)また、前記判別手段は、前記第1の仮想マシンの複製により前記1以上の第2の仮想マシンを生成する際に、当該第1の仮想マシン内で使用している各メモリ領域についての使用状況を示す情報に基づいて、前記判別を行うとしてもよい。
 この仮想計算機システムによれば、複製元の仮想マシン内で使用している各メモリ領域についての使用状況に基づいて、特定種メモリ領域か否かを判定するので、動的に仮想マシンを生成させ、それぞれの仮想マシンが動作しても、不必要なメモリ領域の割当てを行うことなく仮想マシンを動作させることができる。
(c)また、各メモリ領域についての使用状況を示す前記情報は、当該メモリ領域が未使用でありかつ当該メモリ領域が初期化してアクセスされるものであるか否かを区別するものであり、前記判別手段は、未使用でありかつ初期化してアクセスされるメモリ領域については特定種メモリ領域であると判別するとしてもよい。
 この仮想計算機システムは、複製元の仮想マシン内で使用している各メモリ領域についての使用状況が、当該メモリ領域が未使用でありかつ当該メモリ領域が初期化してアクセスされるものであるか否かを区別するので、これらのメモリ領域について無駄なメモリ領域の確保を防止し、全体の物理メモリ領域のメモリ使用量を削減することができる。
(d)また、各メモリ領域についての使用状況を示す前記情報は、当該メモリ領域の内容と同一の内容が外部の記憶手段に存在するか否かを区別するものであり、前記判別手段は、外部の記憶手段内と同一の内容のメモリ領域については特定種メモリ領域であると判別するとしてもよい。
 この仮想計算機システムによれば、複製元の仮想マシン内で使用している各メモリ領域についての使用状況が、当該メモリ領域の内容と同一の内容が外部の記憶手段に存在するか否かを区別するので、これらのメモリ領域について無駄なメモリ領域の確保を防止し、全体の物理メモリ領域のメモリ使用量を削減することができる。
(e)また、前記判別手段は、前記第1の仮想マシンおよび前記1以上の第2の仮想マシンのうちいずれかの仮想マシンが初めてアクセスするときのメモリ領域の内容が、当該アクセスを行う仮想マシン以外の仮想マシンに最後に書込アクセスされた内容であってもよいところのメモリ領域については、特定種メモリ領域であると判別するとしてもよい。
 この仮想計算機システムによれば、複製元の仮想マシン内で使用している各メモリ領域についての使用状況が、複製元の仮想マシンおよび1以上の複製先の仮想マシンのうちいずれかの仮想マシンが初めてアクセスするときのメモリ領域の内容が、当該アクセスを行う仮想マシン以外の仮想マシンに最後に書込アクセスされた内容であってもよいところのメモリ領域については、特定種メモリ領域であると判別するので、これらのメモリ領域について無駄なメモリ領域の確保を防止し、全体の物理メモリ領域のメモリ使用量を削減することができる。
(f)また、各メモリ領域についての使用状況を示す前記情報は、当該メモリ領域が未使用であるか否かを区別するものであり、前記仮想計算機システムは、更に、前記情報に基づき、第1の仮想マシンの複製により1以上の第2の仮想マシンを生成する際に、当該第1の仮想マシンに割り当てられていたメモリ領域が未使用であるか否かを判別する第2判別手段と、前記第2判別手段により未使用と判別されたメモリ領域について、当該メモリ領域への前記第1の仮想マシンおよび前記1以上の第2の仮想マシンのうちいずれかの仮想マシンによるアクセスを検知可能に設定した上で当該メモリ領域の実体を解放し、実体が解放された当該メモリ領域への当該仮想マシンによるアクセスが後に検知された場合に当該仮想マシンに対して当該メモリ領域の実体を割り当てるメモリ割当解放手段とを備えるとしてもよい。
 この仮想計算機システムによれば、仮想マシン複製時に、仮想マシンが未使用であるメモリ領域に対応する物理メモリ領域をすべて解放することができる。
(g)また、仮想マシンの仮想OSが、メモリ領域の解放のために、前記仮想マシンの空きメモリ領域を管理するための管理情報が格納されるメモリ領域へアクセスした場合に、当該アクセスを検知する第3検知手段と、前記第3検知手段により前記アクセスが検知された場合に、前記仮想OSが解放しようとしている前記メモリ領域の実体の解放を行うメモリ解放手段とを更に備えるとしてもよい。
 この仮想計算機システムは、仮想OSが論理メモリ領域を解放するために、空きメモリリストにアクセスしたことを検知した時に、当該論理メモリ領域に対応する物理メモリ領域の解放が行われるので、仮想マシンに対する物理メモリ領域の解放を即時に行うことができ、物理メモリ領域の使用効率を向上することができる。
(8)メモリ分類部21、メモリ複製部22、アクセス制御部31、アクセス検知部32、メモリ割当解放部34、メモリ割当部35、メモリリスト処理部68およびメモリ処理設定部71は、仮想計算機システム1におけるコンピュータを当該機能部として機能させるメモリ管理プログラムによって、動作する。また、実施の形態において説明した各機能部は、IC(Integrated Circuit)やLSI(Large Scale Integration)等のハードウェア回路で実現してもよい。
 また、メモリ管理プログラムを各種記録媒体または通信路を通じて流通させ頒布することもできる。流通、頒布されたプログラムは、機器におけるCPUで読み取り可能なメモリ等に格納されることにより利用に供され、そのCPUがそのプログラムを実行することにより実施の形態で示した仮想計算機システムの各機能が実現される。
(9)実施の形態では、フローチャートのステップは、記載された順序に沿って時系列的に行われる処理の例を示したが、必ずしも時系列的に処理されなくとも、並列的あるいは個別実行される処理をも含むものである。
(10)本発明は、プロセッサとタイマとを備えた計算処理装置であれば、あらゆる計算機(例えば、電子機器、情報機器、AV機器、通信機器、家電機器等)に適用可能である。具体的には、パーソナルコンピュータ、スマートフォンおよびPDA等の携帯電話機、ハードディスクレコーダ、DVDおよびブルーレイディスク等を用いたディスクレコーダ、DVDおよびブルーレイディスク等を用いたディスクプレーヤ、カーナビゲーションシステムおよびテレビジョン等にも適用可能である。
(11)本発明に係る管理手段は、実施の形態に係るアクセス制御部31に相当し、本発明に係る判別手段は、実施の形態に係るメモリ分類部21およびOSメモリ管理テーブル14に相当し、本発明に係る特定種メモリ領域は、実施の形態に係るメモリ領域の使用状態が「未使用」または「参照元あり」に該当する場合に相当し、本発明に係る第1検知手段は、実施の形態に係るアクセス制御部31、アクセス検知部32、メモリ割当処理部35および仮想マシンメモリ管理テーブル311に相当し、本発明に係る第2検知手段は、実施の形態に係るアクセス制御部31、アクセス検知部32、メモリ割当処理部35および仮想マシンメモリ管理テーブル311に相当し、本発明に係るメモリ割当手段は、実施の形態に係るメモリ割当解放部34および仮想マシンメモリ管理テーブル311に相当する。
 また、本発明に係る第2判別手段は、実施の形態に係るメモリ分類部21およびOSメモリ管理テーブル14に相当し、本発明に係るメモリ割当解放手段は、実施の形態に係るメモリ割当解放部34、メモリ割当処理部35および仮想マシンメモリ管理テーブル311に相当する。
 また、本発明に係る第3検知手段は、実施の形態に係るOSメモリ処理設定部71およびアクセス制御部31に相当し、本発明に係るメモリ解放手段は、実施の形態に係るメモリリスト処理部68および仮想マシンメモリ管理テーブル311に相当する。
 本発明に係る仮想計算機システムは、コピーオンライト処理によって物理メモリ領域を無駄に確保することを防ぐものであり、仮想計算機システムに関し、特に、アプリケーションプログラムの実行環境となるオペレーティングシステム(OS)を随時生成し動作させるシステムにおける、メモリ領域の使用量低減のための技術等に有用である。
 1   仮想計算機システム
 10  仮想マシンA
 11  アプリケーション
 12  仮想OS
 13  OSメモリ管理部
 14  OSメモリ管理テーブル
 15  空きメモリリスト
 20  仮想マシン複製装置
 21  メモリ分類部
 22  メモリ複製部
 30  仮想マシンメモリ管理装置
 31  アクセス制御部
 32  アクセス検知部
 34  メモリ割当解放部
 35  メモリ割当処理部
 40  物理メモリ
 41  新規メモリ割当領域
 42  メモリリスト監視領域
 50  仮想マシンB
 61  判別部
 62  コピーオンライト処理部
 63  第1メモリ処理部
 64  新規メモリ割当処理部
 65  メモリ初期化処理部
 66  第2メモリ処理部
 67  第3メモリ処理部
 68  メモリリスト処理部
 70  仮想マシン起動装置
 71  OSメモリ処理設定部
 201 分類値テーブル
 310 アクセス制御テーブル
 311 仮想マシンメモリ管理テーブル

Claims (11)

  1.  第1の仮想マシンを複製することで1以上の第2の仮想マシンを生成する仮想計算機システムであって、
     前記第1の仮想マシンがアクセスし得る1以上の各メモリ領域について、前記1以上の第2の仮想マシンの生成後、前記第1の仮想マシンおよび前記1以上の第2の仮想マシンのうちいずれかの仮想マシンが書込アクセスをするまでは、各仮想マシンから共に読出アクセスし得るものとして管理する管理手段と、
     前記管理手段が管理する前記各メモリ領域について、前記書込アクセスが行われる場合には、当該書込アクセス前のメモリ内容を当該書込アクセスを行った仮想マシン以外の仮想マシンが将来アクセスするときのために保持しておく必要がない特定種メモリ領域か否かの判別を行う判別手段と、
     前記特定種メモリ領域への前記書込アクセスを検知する第1検知手段と、
     前記第1検知手段により前記書込アクセスが検知された後に、当該書込アクセスを行った仮想マシン以外の仮想マシンが当該特定種メモリ領域にアクセスしようとしていることを検知する第2検知手段と、
     前記第2検知手段により特定種メモリ領域にアクセスしようとしていることが検知された仮想マシンに対して、当該アクセスの対象として新たにメモリ領域を獲得して割当を行うメモリ割当手段とを備える
     ことを特徴とする仮想計算機システム。
  2.  前記判別手段は、前記第1の仮想マシンの複製により前記1以上の第2の仮想マシンを生成する際に、当該第1の仮想マシン内で使用している各メモリ領域についての使用状況を示す情報に基づいて、前記判別を行う
     ことを特徴とする請求項1に記載の仮想計算機システム。
  3.  各メモリ領域についての使用状況を示す前記情報は、当該メモリ領域が未使用でありかつ当該メモリ領域が初期化してアクセスされるものであるか否かを区別するものであり、
     前記判別手段は、未使用でありかつ初期化してアクセスされるメモリ領域については特定種メモリ領域であると判別する
     ことを特徴とする請求項2に記載の仮想計算機システム。
  4.  各メモリ領域についての使用状況を示す前記情報は、当該メモリ領域の内容と同一の内容が外部の記憶手段に存在するか否かを区別するものであり、
     前記判別手段は、外部の記憶手段内と同一の内容のメモリ領域については特定種メモリ領域であると判別する
     ことを特徴とする請求項2に記載の仮想計算機システム。
  5.  前記判別手段は、前記第1の仮想マシンおよび前記1以上の第2の仮想マシンのうちいずれかの仮想マシンが初めてアクセスするときのメモリ領域の内容が、当該アクセスを行う仮想マシン以外の仮想マシンに最後に書込アクセスされた内容であってもよいところのメモリ領域については、特定種メモリ領域であると判別する
     ことを特徴とする請求項2に記載の仮想計算機システム。
  6.  各メモリ領域についての使用状況を示す前記情報は、当該メモリ領域が未使用であるか否かを区別するものであり、
     前記仮想計算機システムは、更に、
     前記情報に基づき、第1の仮想マシンの複製により1以上の第2の仮想マシンを生成する際に、当該第1の仮想マシンに割り当てられていたメモリ領域が未使用であるか否かを判別する第2判別手段と、
     前記第2判別手段により未使用と判別されたメモリ領域について、当該メモリ領域への前記第1の仮想マシンおよび前記1以上の第2の仮想マシンのうちいずれかの仮想マシンによるアクセスを検知可能に設定した上で当該メモリ領域の実体を解放し、実体が解放された当該メモリ領域への当該仮想マシンによるアクセスが後に検知された場合に当該仮想マシンに対して当該メモリ領域の実体を割り当てるメモリ割当解放手段とを備える
     ことを特徴とする請求項2に記載の仮想計算機システム。
  7.  仮想マシンの仮想OSが、メモリ領域の解放のために、前記仮想マシンの空きメモリ領域を管理するための管理情報が格納されるメモリ領域へアクセスした場合に、当該アクセスを検知する第3検知手段と、
     前記第3検知手段により前記アクセスが検知された場合に、前記仮想OSが解放しようとしている前記メモリ領域の実体の解放を行うメモリ解放手段とを更に備える
     ことを特徴とする請求項6に記載の仮想計算機システム。
  8.  管理手段と、判別手段と、第1検知手段と、第2検知手段と、メモリ割当手段とを備え、第1の仮想マシンを複製することで1以上の第2の仮想マシンを生成する仮想計算機システムにおけるメモリ管理方法であって、
     前記仮想計算機システムの管理手段が、前記第1の仮想マシンがアクセスし得る1以上の各メモリ領域について、前記1以上の第2の仮想マシンの生成後、前記第1の仮想マシンおよび前記1以上の第2の仮想マシンのうちいずれかの仮想マシンが書込アクセスをするまでは、各仮想マシンから共に読出アクセスし得るものとして管理する管理ステップと、
     前記仮想計算機システムの判別手段が、前記管理手段が管理する前記各メモリ領域について、前記書込アクセスが行われる場合には、当該書込アクセス前のメモリ内容を当該書込アクセスを行った仮想マシン以外の仮想マシンが将来アクセスするときのために保持しておく必要がない特定種メモリ領域か否かの判別を行う判別ステップと、
     前記仮想計算機システムの第1検知手段が、前記特定種メモリ領域への前記書込アクセスを検知する第1検知ステップと、
     前記仮想計算機システムの第2検知手段が、前記第1検知手段により前記書込アクセスが検知された後に、当該書込アクセスを行った仮想マシン以外の仮想マシンが当該特定種メモリ領域にアクセスしようとしていることを検知する第2検知ステップと、
     前記仮想計算機システムのメモリ割当手段が、前記第2検知手段により特定種メモリ領域にアクセスしようとしていることが検知された仮想マシンに対して、当該アクセスの対象として新たにメモリ領域を獲得して割当を行うメモリ割当ステップとを含む
     ことを特徴とするメモリ管理方法。
  9.  管理手段と、判別手段と、第1検知手段と、第2検知手段と、メモリ割当手段とを備え、第1の仮想マシンを複製することで1以上の第2の仮想マシンを生成する仮想計算機システムにおけるコンピュータに、
     前記仮想計算機システムの管理手段が、前記第1の仮想マシンがアクセスし得る1以上の各メモリ領域について、前記1以上の第2の仮想マシンの生成後、前記第1の仮想マシンおよび前記1以上の第2の仮想マシンのうちいずれかの仮想マシンが書込アクセスをするまでは、各仮想マシンから共に読出アクセスし得るものとして管理する管理ステップと、
     前記仮想計算機システムの判別手段が、前記管理手段が管理する前記各メモリ領域について、前記書込アクセスが行われる場合には、当該書込アクセス前のメモリ内容を当該書込アクセスを行った仮想マシン以外の仮想マシンが将来アクセスするときのために保持しておく必要がない特定種メモリ領域か否かの判別を行う判別ステップと、
     前記仮想計算機システムの第1検知手段が、前記特定種メモリ領域への前記書込アクセスを検知する第1検知ステップと、
     前記仮想計算機システムの第2検知手段が、前記第1検知手段により前記書込アクセスが検知された後に、当該書込アクセスを行った仮想マシン以外の仮想マシンが当該特定種メモリ領域にアクセスしようとしていることを検知する第2検知ステップと、
     前記仮想計算機システムのメモリ割当手段が、前記第2検知手段により特定種メモリ領域にアクセスしようとしていることが検知された仮想マシンに対して、当該アクセスの対象として新たにメモリ領域を獲得して割当を行うメモリ割当ステップと
     を実行させるためのメモリ管理プログラム。
  10.  管理手段と、判別手段と、第1検知手段と、第2検知手段と、メモリ割当手段とを備え、第1の仮想マシンを複製することで1以上の第2の仮想マシンを生成する仮想計算機システムにおいて用いられるメモリ管理プログラムを記録しているコンピュータ読取可能な記録媒体であって、
     前記仮想計算機システムにおけるコンピュータに、
     前記仮想計算機システムの管理手段が、前記第1の仮想マシンがアクセスし得る1以上の各メモリ領域について、前記1以上の第2の仮想マシンの生成後、前記第1の仮想マシンおよび前記1以上の第2の仮想マシンのうちいずれかの仮想マシンが書込アクセスをするまでは、各仮想マシンから共に読出アクセスし得るものとして管理する管理ステップと、
     前記仮想計算機システムの判別手段が、前記管理手段が管理する前記各メモリ領域について、前記書込アクセスが行われる場合には、当該書込アクセス前のメモリ内容を当該書込アクセスを行った仮想マシン以外の仮想マシンが将来アクセスするときのために保持しておく必要がない特定種メモリ領域か否かの判別を行う判別ステップと、
     前記仮想計算機システムの第1検知手段が、前記特定種メモリ領域への前記書込アクセスを検知する第1検知ステップと、
     前記仮想計算機システムの第2検知手段が、前記第1検知手段により前記書込アクセスが検知された後に、当該書込アクセスを行った仮想マシン以外の仮想マシンが当該特定種メモリ領域にアクセスしようとしていることを検知する第2検知ステップと、
     前記仮想計算機システムのメモリ割当手段が、前記第2検知手段により特定種メモリ領域にアクセスしようとしていることが検知された仮想マシンに対して、当該アクセスの対象として新たにメモリ領域を獲得して割当を行うメモリ割当ステップと
     を実行させるためのメモリ管理プログラムを記録している記録媒体。
  11.  第1の仮想マシンを複製することで1以上の第2の仮想マシンを生成する仮想計算機システムを構成する集積回路であって、
     前記第1の仮想マシンがアクセスし得る1以上の各メモリ領域について、前記1以上の第2の仮想マシンの生成後、前記第1の仮想マシンおよび前記1以上の第2の仮想マシンのうちいずれかの仮想マシンが書込アクセスをするまでは、各仮想マシンから共に読出アクセスし得るものとして管理する管理手段と、
     前記管理手段が管理する前記各メモリ領域について、前記書込アクセスが行われる場合には、当該書込アクセス前のメモリ内容を当該書込アクセスを行った仮想マシン以外の仮想マシンが将来アクセスするときのために保持しておく必要がない特定種メモリ領域か否かの判別を行う判別手段と、
     前記特定種メモリ領域への前記書込アクセスを検知する第1検知手段と、
     前記第1検知手段により前記書込アクセスが検知された後に、当該書込アクセスを行った仮想マシン以外の仮想マシンが当該特定種メモリ領域にアクセスしようとしていることを検知する第2検知手段と、
     前記第2検知手段により特定種メモリ領域にアクセスしようとしていることが検知された仮想マシンに対して、当該アクセスの対象として新たにメモリ領域を獲得して割当を行うメモリ割当手段とを備える
     ことを特徴とする集積回路。
PCT/JP2012/004436 2011-07-14 2012-07-10 仮想計算機システム、メモリ管理方法、メモリ管理プログラム、記録媒体および集積回路 WO2013008450A1 (ja)

Priority Applications (3)

Application Number Priority Date Filing Date Title
CN201280002859.5A CN103098028B (zh) 2011-07-14 2012-07-10 虚拟计算机系统、存储器管理方法以及集成电路
JP2013502937A JP5864534B2 (ja) 2011-07-14 2012-07-10 仮想計算機システム、メモリ管理方法、メモリ管理プログラム、記録媒体および集積回路
US13/814,589 US9176781B2 (en) 2011-07-14 2012-07-10 Virtual machine system, memory management method, memory management program, recording medium, and integrated circuit

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2011-155328 2011-07-14
JP2011155328 2011-07-14

Publications (1)

Publication Number Publication Date
WO2013008450A1 true WO2013008450A1 (ja) 2013-01-17

Family

ID=47505754

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2012/004436 WO2013008450A1 (ja) 2011-07-14 2012-07-10 仮想計算機システム、メモリ管理方法、メモリ管理プログラム、記録媒体および集積回路

Country Status (4)

Country Link
US (1) US9176781B2 (ja)
JP (1) JP5864534B2 (ja)
CN (1) CN103098028B (ja)
WO (1) WO2013008450A1 (ja)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9720717B2 (en) * 2013-03-14 2017-08-01 Sandisk Technologies Llc Virtualization support for storage devices
CN113449292B (zh) * 2020-03-27 2022-07-29 支付宝(杭州)信息技术有限公司 一种可信应用的运行方法、装置及设备
CN113641466A (zh) * 2021-10-15 2021-11-12 云宏信息科技股份有限公司 Xen平台的内存分配方法、系统及计算机可读存储介质

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004133894A (ja) * 2002-07-11 2004-04-30 Microsoft Corp 仮想マシンをフォークまたはマイグレートするための方法
JP2007066265A (ja) * 2005-09-02 2007-03-15 Hitachi Ltd 計算機装置及び仮想マシン提供方法
JP2010033206A (ja) * 2008-07-28 2010-02-12 Fujitsu Ltd 仮想マシンモニタ装置およびプログラム,ならびに仮想マシン間メモリ共有管理方法

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8336046B2 (en) 2006-12-29 2012-12-18 Intel Corporation Dynamic VM cloning on request from application based on mapping of virtual hardware configuration to the identified physical hardware resources
CN101727331B (zh) * 2008-10-24 2013-03-20 国际商业机器公司 升级活动虚拟机的客户操作系统的方法和设备

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004133894A (ja) * 2002-07-11 2004-04-30 Microsoft Corp 仮想マシンをフォークまたはマイグレートするための方法
JP2007066265A (ja) * 2005-09-02 2007-03-15 Hitachi Ltd 計算機装置及び仮想マシン提供方法
JP2010033206A (ja) * 2008-07-28 2010-02-12 Fujitsu Ltd 仮想マシンモニタ装置およびプログラム,ならびに仮想マシン間メモリ共有管理方法

Also Published As

Publication number Publication date
US9176781B2 (en) 2015-11-03
CN103098028B (zh) 2016-09-14
CN103098028A (zh) 2013-05-08
JPWO2013008450A1 (ja) 2015-02-23
JP5864534B2 (ja) 2016-02-17
US20130139161A1 (en) 2013-05-30

Similar Documents

Publication Publication Date Title
JP6903682B2 (ja) 仮想リソースビューを使用するデータ保護
US11842217B1 (en) Isolating tenants executing in multi-tenant software containers
CN102938039B (zh) 针对应用的选择性文件访问
US8966464B1 (en) Isolating tenants executing in multi-tenant software containers
US8689212B2 (en) Information processing device for controlling an application able to access a predetermined device, and control method using an information processing device for controlling an application able to access a predetermined device
US9471353B1 (en) Isolating tenants executing in multi-tenant software containers
US10180915B2 (en) Method and apparatus for accessing physical resources
US8578370B2 (en) Managing memory in multiple virtual machines
US9058212B2 (en) Combining memory pages having identical content
US10402378B2 (en) Method and system for executing an executable file
CN111695163B (zh) 存储装置以及控制方法
US20060136779A1 (en) Object-based storage device with low process load and control method thereof
JP2007200314A (ja) 隠蔽領域管理装置および方法
JP5338435B2 (ja) 情報処理プログラム、情報処理装置および情報処理方法
US20080276065A1 (en) Method of partitioning storage area of recording medium and recording medium using the method, and method of accessing recording medium and recording device using the method
US11556468B2 (en) Multi-ring shared, traversable, and dynamic advanced database
KR20090121712A (ko) 가상화 시스템 및 그 가상화 시스템에서의 컨텐트 사용제한 방법
US11409451B2 (en) Systems, methods, and storage media for using the otherwise-unutilized storage space on a storage device
JP5864534B2 (ja) 仮想計算機システム、メモリ管理方法、メモリ管理プログラム、記録媒体および集積回路
JP2006338201A (ja) 論理ボリューム管理装置、論理ボリューム管理方法およびプログラム
US20190370436A1 (en) Memory assignment for guest operating systems
US20220374256A1 (en) Information processing system, information processing apparatus, method of controlling the same, and storage medium
JP5482781B2 (ja) 情報処理システム及び情報処理システムの動作方法
JP5821392B2 (ja) ストレージ装置、およびストレージ管理方法
KR20090131142A (ko) 메모리 관리 장치 및 방법

Legal Events

Date Code Title Description
WWE Wipo information: entry into national phase

Ref document number: 201280002859.5

Country of ref document: CN

ENP Entry into the national phase

Ref document number: 2013502937

Country of ref document: JP

Kind code of ref document: A

WWE Wipo information: entry into national phase

Ref document number: 13814589

Country of ref document: US

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 12812062

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 12812062

Country of ref document: EP

Kind code of ref document: A1