MEMORY ALLOCATION DEVICE, MEMORY ALLOCATION PROGRAM, AND MEMORY ALLOCATION ME

The memory allocation device efficiently estimates the memory needed for the second kernel by measuring its usage, addressing the challenge of varying allocations and optimizing memory usage.

JP7564445B2Active Publication Date: 2024-10-09FUJITSU LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
JP2021025875
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Filing Date
2021-02-22
Publication Date
2024-10-09
Estimated Expiration
2041-02-22

AI Technical Summary

Technical Problem

The challenge lies in accurately determining the appropriate amount of memory to allocate for the second kernel in an operating system, as it varies with hardware and software configurations, making it difficult to estimate and adjust effectively.

Method used

A memory allocation device and method that includes a first kernel to set an environment for acquiring a dump, a second kernel to execute the dump, and a measurement unit to measure the second kernel's memory usage, enabling adaptive estimation of the memory allocation amount based on actual usage.

Benefits of technology

Enables quick and accurate estimation of memory allocation for the second kernel, simplifying the process and ensuring optimal memory usage without unnecessary waste or interference.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007564445000001
    Figure 0007564445000001
  • Figure 0007564445000002
    Figure 0007564445000002
  • Figure 0007564445000003
    Figure 0007564445000003
Patent Text Reader

Abstract

To estimate in a short time an adaptive memory quantity that is allocated for use by a second kernel.SOLUTION: This memory allocation device comprises: a first execution unit for executing a first kernel that sets an acquisition environment for a dump that represents a memory content on failure of an operating system (OS); a second execution unit for executing a second kernel that acquires the dump; an execution indication unit for indicating to the second kernel in the middle of setting of the acquisition environment that the dump be acquired; a measurement unit for measuring memory usage of the second kernel during startup of the second kernel; and an estimation unit for estimating, on the basis of the measured memory usage, a memory allocation quantity that is allocated for use by the second kernel.SELECTED DRAWING: Figure 9
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present invention relates to a memory allocation device, a memory allocation program, and a memory allocation method. [Background technology]

[0002] It is known that when an operating system (hereinafter simply referred to as OS) cannot maintain normal operation, the OS generates an exception signal and instructs the kernel, the core part of the OS that performs basic control of the CPU (Central Processing Unit), to execute a core dump process. The core dump process is a process in which the entire contents of the memory space at the time the exception signal occurred is stored as is in a core file.

[0003] For example, a general-purpose OS such as UNIX (registered trademark) has a function for constantly monitoring signal events, and when an exception signal occurs, it executes an exception process according to the exception signal. For example, when it is determined that it is difficult to continue the operation of the OS any further, it executes a core dump process and generates a core file that stores all of the contents of the memory space at that time as is. The core file generated in this way is used to analyze the cause of the failure (see, for example, Patent Document 1). [Prior art documents] [Patent documents]

[0004] [Patent Document 1] JP 2007-172414 A Summary of the Invention [Problem to be solved by the invention]

[0005] Some OSs are provided with two types of kernels. For example, Linux (registered trademark) has a system operation kernel (hereinafter referred to as the first kernel) that performs normal control such as job management and memory management, and a dump operation kernel (hereinafter referred to as the second kernel) that performs control when a failure (crash) occurs in the OS (specifically, the first kernel). When a failure occurs in the OS, the second kernel executes kdump (kernel crash dump or kernel memory dump) processing and generates a dump file that stores the kernel part of the memory space contents at the time of the failure.

[0006] The amount of memory used by the second kernel when it is running is specified by the operator's prior estimate so that the first kernel does not use it. This amount of memory is pre-allocated by the first kernel as an environment setting when the OS starts up. If the amount of memory allocated to the second kernel becomes large, the amount of memory available to the first kernel will decrease, so it is desirable to keep the amount of memory for the second kernel as small as possible.

[0007] However, the amount of memory to be allocated for use by the second kernel varies depending on the hardware and software configuration, making it difficult for the worker to estimate an appropriate amount of memory. For this reason, when building a new environment for dump processing or when changing the configuration of that environment, the worker checks the actual performance on the actual machine while adjusting the amount of memory, and then estimates and determines the amount of memory to be allocated for use by the second kernel. However, this work is insufficient because it is cumbersome and it is not possible to evaluate whether it is appropriate.

[0008] Therefore, in one aspect, an object of the present invention is to quickly estimate an adaptive amount of memory to be allocated for use by a second kernel. [Means for solving the problem]

[0009] In one embodiment, the memory allocation device has a first execution unit that executes a first kernel that sets up an environment for acquiring a dump representing memory contents in the event of an OS failure, a second execution unit that executes a second kernel that acquires the dump, an execution instruction unit that instructs the second kernel to acquire the dump in the middle of setting the acquisition environment, a measurement unit that measures the memory usage of the second kernel while the second kernel is running, and an estimation unit that estimates a memory allocation amount to be allocated for use by the second kernel based on the measured memory usage. Effect of the Invention

[0010] It is possible to quickly estimate an adaptive amount of memory to allocate for use by the second kernel. [Brief description of the drawings]

[0011] [Figure 1] FIG. 1 is a block diagram illustrating an example of a hardware configuration of a server device. [Diagram 2] FIG. 2 is a block diagram illustrating an example of the functional configuration of the server device. [Diagram 3] FIG. 3 is a block diagram illustrating the functional configuration of the first kernel and the second kernel. [Figure 4] FIG. 4 is a flowchart showing an example of a process executed by the first kernel. [Diagram 5] FIG. 5 is an example of a table of areas in the auxiliary storage unit for saving dumps (hereinafter, dump save areas). [Figure 6] FIG. 6 is a flowchart showing an example of a process executed by the second kernel. [Figure 7] 7A and 7B are flowcharts showing an example of a memory allocation process and a memory release process, respectively. [Figure 8] FIG. 8 is a graph showing the transition of new memory usage. [Figure 9] FIG. 9 is a diagram for explaining a comparative example and the first embodiment. [Figure 10]FIG. 10 is a flowchart showing another example of the process executed by the first kernel. [Figure 11] FIG. 11 is a diagram for explaining the second embodiment. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0012] Hereinafter, an embodiment of the present invention will be described with reference to the drawings.

[0013] FIG. 1 is a block diagram illustrating a hardware configuration of a server device 100. As shown in FIG. 1, the server device 100 as a memory allocation device includes a CPU 100A and a RAM (Random Access Memory) 100B as hardware processors. The server device 100 includes a ROM (Read Only Memory) 100C, a network I / F (Interface) 100D, and a HDD (Hard Disk Drive) 100E. Instead of the HDD (Hard Disk Drive) 100E, a SSD (Solid State Drive) may be used. The server device 100 may include at least one of an input I / F 100F, an output I / F 100G, an input / output I / F 100H, and a drive device 100I, as necessary. The CPU 100A to the drive device 100I are connected to each other by an internal bus 100J. That is, the server device 100 can be realized by a computer. Note that an MPU (Micro Processing Unit) may be adopted as a hardware processor instead of the CPU 100A.

[0014] An input device 11 is connected to the input I / F 100F. Examples of the input device 11 include a keyboard, a mouse, and a touch panel. A display device 12 is connected to the output I / F 100G. Examples of the display device 12 include an LCD display. A semiconductor memory 13 is connected to the input / output I / F 100H. Examples of the semiconductor memory 13 include a USB (Universal Serial Bus) memory and a flash memory. The input / output I / F 100H reads programs and data stored in the semiconductor memory 730. The input I / F 100F and the input / output I / F 100H each include a USB port, for example. The output I / F 100G includes a display port, for example.

[0015] A portable recording medium 14 is inserted into the drive device 100I. The portable recording medium 14 may be a removable disk such as a CD (Compact Disc)-ROM or a DVD (Digital Versatile Disc). The drive device 100I reads programs and data recorded on the portable recording medium 14. The network I / F 100D includes, for example, a LAN (Local Area Network) port and a communication circuit.

[0016] A program stored in at least one of the ROM 100C, the HDD 100E, and the semiconductor memory 13 is temporarily stored in the RAM 100B by the CPU 100A. A program recorded in the portable recording medium 14 is temporarily stored in the RAM 100B by the CPU 100A. By executing the stored program, the CPU 100A realizes various functions described later and executes various processes described later. The program may correspond to a flowchart described later.

[0017] Next, the functional configuration of the server device 100 will be described with reference to FIG.

[0018] FIG. 2 is a block diagram illustrating an example of a functional configuration of the server device 100. FIG. 2 shows the main functions of the server device 100. As shown in FIG. 2, the server device 100 includes an auxiliary memory unit 110, a main memory unit 120, and a processing unit 130. The auxiliary memory unit 110 can be realized by the above-mentioned HDD 100E or the like. The main memory unit 120 can be realized by the above-mentioned RAM 100B. The processing unit 130 can be realized by the above-mentioned CPU 100A. Therefore, the auxiliary memory unit 110, the main memory unit 120, and the processing unit 130 are connected to each other.

[0019] Here, the auxiliary storage unit 110 stores an OS (not shown). For example, the OS is Linux (registered trademark), but may be an OS other than Linux (registered trademark). When the power button of the server device 100 is pressed and power is supplied to the server device 100, the processing unit 130 calls up the OS from the auxiliary storage unit 110. Then, the processing unit 130 stores the first kernel 50 included in the called OS in the first kernel memory area 121 of the main storage unit 120, and starts up the first kernel 50. That is, the first kernel memory area 121 is a memory area in which the first kernel 50 operates. By starting up the first kernel 50, the first kernel 50 performs normal control such as job (or process) management, memory management, operation management, and input / output management, and also executes various processes described later. The first kernel 50 is sometimes called a system kernel.

[0020] Furthermore, by starting the first kernel 50, the first kernel 50 allocates (or reserves) the second kernel memory area 122 in the main memory unit 120, and stores the second kernel 60 included in the OS in the second kernel memory area 122. In other words, the second kernel memory area 122 is a memory area in which the second kernel 60 operates. The second kernel 60 performs control when a failure (abnormality) such as a kernel crash occurs in the OS (specifically, the first kernel 50). The second kernel is sometimes called a dump capture kernel or simply a dump kernel.

[0021] More specifically, when the first kernel 50 detects a logical anomaly in its own processing and determines that it is impossible to continue the processing, it starts the second kernel 60. The second kernel 60 writes a dump file that stores the kernel portion of the memory space contents in the first kernel memory area 121 into the dump save area 111 of the auxiliary storage unit 110. After writing the dump file, the second kernel 60 shuts down or restarts itself.

[0022] Next, an overview of the functions of the first kernel 50 and the second kernel 60 will be described with reference to Fig. 3. The functions of the first kernel 50 can be realized by the processing unit 130 cooperating with the main memory unit 120 to execute the processing of the first kernel 50. The processing of the second kernel 60 is similar to that of the first kernel 50. The processing of the first kernel 50 and the second kernel 60 will be described in detail when explaining the operation of the server device 100.

[0023] 3 is a block diagram illustrating the functional configuration of the first kernel 50 and the second kernel 60. The first kernel 50 includes a first kernel execution unit 51, a first judgment unit 52, a second judgment unit 53, and an environment construction unit 54 as components. The first kernel 50 also includes an initial setting unit 55, a dump operation unit 56, a checkpoint setting unit 57, and a second kernel execution instruction unit 58 as components. The first kernel execution unit 51 is an example of a first execution unit, the second kernel execution instruction unit 58 is an example of an execution instruction unit, the environment construction unit 54 is an example of an estimation unit, and the checkpoint setting unit 57 is an example of a setting unit.

[0024] The second kernel 60 includes, as components, a second kernel execution unit 61, a memory usage measurement unit 62, a memory usage registration unit 63, and a first kernel execution instruction unit 64. The second kernel execution unit 61 is an example of a second execution unit, and the memory usage measurement unit 62 is an example of a measurement unit. The first kernel 50 and the second kernel 60 cooperate directly with each other and also cooperate indirectly with each other via the dump save area 111.

[0025] Next, the processing of the first kernel 50 and the second kernel 60 will be described with reference to FIGS.

[0026] Fig. 4 is a flowchart showing an example of processing executed by the first kernel 50. Fig. 5 is an example of the dump save area table T1. Fig. 6 is a flowchart showing an example of processing executed by the second kernel 60. First, when power is supplied to the server device 100, the first kernel execution unit 51 starts the first kernel 50 (step S1). This causes the initial setting unit 55 to start initial setting of the acquisition environment or collection environment (hereinafter simply referred to as the acquisition environment) of the dump file, and starts setting, for example, the network IP address and the partition of the HDD 100E.

[0027] When the first kernel 50 is started, in parallel with the initial setting, the first determination unit 52 determines whether or not the environment for acquiring the dump file has been constructed (step S2). Specifically, the first determination unit 52 accesses the dump save area 111 and determines whether or not the environment for acquiring the dump file has been constructed. Note that the state in which the memory usage for the second kernel 60 has already been set in the first kernel 50.

[0028] Here, as shown in Fig. 5, the dump save area 111 manages various information by means of a dump save area table T1. Specifically, the dump save area table T1 includes information such as an acquisition environment state identifier, a second kernel memory usage, a data length, and a first kernel initial setting value. For example, one of three types of identifiers is registered in the acquisition environment state identifier. Identifier "0" indicates that the dump file acquisition environment has not yet been constructed (not constructed). Identifier "1" indicates that the dump file acquisition environment is in the process of being constructed (under construction). Identifier "2" indicates that the dump file acquisition environment has been constructed (constructed). The remaining information will be described later.

[0029] The first determination unit 52 accesses the dump save area 111, and when the identifier "0" is assigned to the acquired environment state identifier, for example, the first determination unit 52 determines that the acquired environment has not been constructed (step S2: NO). In this case, the first determination unit 52 subsequently determines whether the acquired environment of the dump file is being constructed (step S3). Specifically, the first determination unit 52 accesses the dump save area 111 and determines whether the acquired environment of the dump file is being constructed. When the identifier "0" is similarly assigned to the acquired environment state identifier, the first determination unit 52 determines that the acquired environment is not being constructed (step S3: NO). Therefore, the first determination unit 52 determines that the acquired environment of the dump file has not been constructed by the processing of steps S2 and S3.

[0030] If the environment for acquiring the dump file has not been constructed, then the checkpoint setting unit 57 sets a checkpoint (step S4). Specifically, if the environment for acquiring the dump file has not been constructed, the environment construction unit 54 requests the checkpoint setting unit 57 to set a checkpoint. When the checkpoint setting unit 57 is requested to set a checkpoint, it sets all initial setting values ​​(specifically, network addresses, partitions, etc.) that have been set from the start of the first kernel 50 to the present time and the data lengths of the initial setting values ​​as checkpoints. Then, the checkpoint setting unit 57 requests the dump operation unit 56 to register the set checkpoint. When the dump operation unit 56 is requested to register a checkpoint, it registers the checkpoint in the dump save area 111. As a result, as shown in FIG. 5, the initial setting values ​​as checkpoints and the data lengths of the initial setting values ​​are registered in the dump save area 111.

[0031] Once the checkpoint is set, the environment construction unit 54 then rewrites the identifier to "under construction" (step S5). Specifically, the environment construction unit 54 requests the dump operation unit 56 to rewrite the acquired environment state identifier to the identifier "1". Upon receiving the rewrite request, the dump operation unit 56 deletes the identifier "0" from the acquired environment state identifier and registers the identifier "1" in the dump save area 111. As a result, the acquired environment state identifier in the dump save area table T1 is rewritten to the identifier "1" indicating "under construction", and the state transitions to one in which setting of the memory usage for the second kernel 60 begins.

[0032] When the identifier is rewritten during construction, the environment construction unit 54 allocates the entire memory capacity in the server device 100 for the operation of the second kernel 60 (step S6). This entire memory capacity corresponds to the capacity of the RAM 100B. This makes it possible to avoid interruption or delay in the operation of the second kernel 60 due to memory shortage. Thereafter, the second kernel execution instruction unit 58 instructs the execution of the second kernel 60 (step S7). Specifically, the second kernel execution instruction unit 58 instructs the second kernel execution unit 61 of the second kernel 60 to execute the second kernel 60. When the second kernel execution instruction unit 58 instructs the execution of the second kernel 60, the first kernel execution unit 51 temporarily terminates the start of the first kernel even in the middle of the initial setting, and forcibly switches to the execution of the second kernel 60.

[0033] When execution of the second kernel 60 is instructed, the second kernel execution unit 61 starts the second kernel 60 (step S8), as shown in Fig. 6. After the second kernel execution unit 61 starts the second kernel 60, the memory usage measurement unit 62 then executes a measurement process (step S9). Although details will be described later, the measurement process is a process of actually measuring (actually measuring) the amount of memory used when the second kernel 60 operates, and outputting the maximum memory usage. By executing the measurement process, the memory usage measurement unit 62 can identify the maximum memory usage required for use by the second kernel 60.

[0034] Once the memory usage is specified, the memory usage registration unit 63 then registers the memory usage (step S10). Specifically, the memory usage registration unit 63 accesses the dump save area 111 and registers the memory usage. As a result, the specified memory usage is registered in the second kernel memory usage of the dump save area table T1, as shown in Fig. 5. The memory usage registered in the second kernel memory usage is, for example, a memory usage in units of several hundred megabytes, ranging from 128 megabytes (MB) to approximately 512 megabytes.

[0035] When the memory usage is registered, the first kernel execution instructing unit 64 instructs the first kernel 50 to execute (step S11). Specifically, the first kernel execution instructing unit 64 instructs the first kernel execution unit 51 of the first kernel 50 to execute the first kernel 50. As a result, the process of step S1 shown in Fig. 4 is executed again. When the first kernel execution instructing unit 64 instructs the execution of the first kernel 50, the second kernel execution unit 61 ends the startup of the second kernel.

[0036] Returning to FIG. 4, when execution of the first kernel 50 is instructed, the first kernel execution unit 51 starts the first kernel 50 in the process of step S1. Here, in the process of step S5 described above, the acquisition construction state identifier is rewritten to the identifier "1". Therefore, in the process of step S2, the first determination unit 52 determines that the acquisition environment has not been constructed, but in the process of step S3, the first determination unit 52 determines that the acquisition environment is being constructed (step S3: YES). As a result, the dump operation unit 56 acquires various information from the dump save area 111 (step S12). Specifically, the dump operation unit 56 acquires the values ​​of the second kernel memory usage, data length, and first kernel initial setting value.

[0037] When the dump operation unit 56 acquires various information, the environment construction unit 54 judges whether the data length is 0 (zero) based on the data length (step S13). If the data length is not 0 (step S13: NO), the first kernel initial setting value exists, so the checkpoint setting unit 57 restores the initial setting based on the first kernel initial setting value (step S14). The restored initial setting becomes a checkpoint for resuming the initial setting. The environment construction unit 54 continues the initial setting again based on this checkpoint. Note that if the data length is 0 (step S13: YES), the first kernel initial setting value does not exist, so the checkpoint setting unit 57 skips the processing of step S14.

[0038] Next, the environment construction unit 54 estimates the memory allocation based on the second kernel memory usage (step S15). For example, the environment construction unit 54 may estimate the second kernel memory usage as the memory allocation as it is, or may calculate the memory usage based on the second kernel memory usage and a predetermined calculation formula for calculating a memory usage larger than the second kernel memory usage, and estimate the memory usage as the memory allocation. Simply, in order to provide a margin for memory usage, the memory usage obtained by adding a predetermined memory usage to the second kernel memory usage may be estimated as the memory allocation.

[0039] When the environment construction unit 54 estimates the memory allocation amount, it sets the memory allocation amount to the first kernel 50 (step S16). As a result, when the first kernel 50 is started, the first kernel 50 can reserve the second kernel memory area 122 of the memory allocation amount in the main storage unit 120. After the memory allocation amount is set, the environment construction unit 54 then rewrites the identifier to "constructed" (step S17). Specifically, the environment construction unit 54 requests the dump operation unit 56 to rewrite the acquired environment state identifier to the identifier "2". When the dump operation unit 56 is requested to rewrite, it deletes the identifier "1" of the acquired environment state identifier and registers the identifier "2" in the dump save area 111. As a result, the acquired environment state identifier in the dump save area table T1 is rewritten to the identifier "2" indicating "constructed", and the state transitions to a state in which the setting of the memory usage amount for the second kernel 60 has been completed.

[0040] When the process of step S17 is completed, the environment construction unit 54 initializes the dump save area table T1 (step S18). Specifically, the environment construction unit 54 requests the dump operation unit 56 to delete the values ​​of the second kernel memory usage, data length, and first kernel initial setting value. When the dump operation unit 56 receives the deletion request, it deletes the values ​​of the second kernel memory usage, data length, and first kernel initial setting value from the dump save area table T1 of the dump save area 111. As a result, the identifier "2" remains in the acquired environment state identifier of the dump save area table T1, and the second kernel memory usage, data length, and first kernel initial setting value each have no value.

[0041] When the processing of step S18 is completed, the environment construction unit 54 continues to start the first kernel 50 (step S19), and the initial setting unit 55 proceeds with the processing of the initial setting. Then, when the initial setting unit 55 finishes the initial setting, the first kernel 50 ends the processing. Note that, in the processing of step S2 described above, if it is determined that the acquisition environment has been constructed (step S2: YES), the environment construction unit 54 executes step S19. Then, when the initial setting unit 55 finishes the initial setting, the first kernel 50 ends the processing.

[0042] Next, the above-mentioned measurement process will be described with reference to FIGS. 7(a) and 7(b) and FIG.

[0043] FIG. 7(a) is a flowchart showing an example of memory allocation processing. FIG. 7(b) is a flowchart showing an example of memory release processing. FIG. 8 is a graph showing the transition of new memory usage. The above-mentioned measurement processing includes memory allocation processing and memory release processing. First, when the second kernel 60 is started, as shown in FIG. 7(a), the memory usage measurement unit 62 acquires memory (step S31). That is, the memory usage measurement unit 62 acquires the amount of memory to be used for the operation of the second kernel 60. This amount corresponds to the amount set by the program requesting memory acquisition.

[0044] Next, the memory usage measurement unit 62 calculates a new memory usage by adding the acquired memory amount to the current memory usage (step S32). The initial value of the current memory usage is 0 (zero). The acquired memory amount is the amount of memory acquired by the memory usage measurement unit 62. Therefore, as shown in Fig. 8, a new memory amount according to the processing amount of the second kernel 60 is acquired until time t1, at which the new memory usage increases steadily with the passage of time.

[0045] Next, the memory usage measurement unit 62 judges whether or not the new memory usage is larger than the maximum memory usage (step S33). If the new memory usage is larger than the maximum memory usage (step S33: YES), the new memory usage is set as the maximum memory usage (step S34). That is, the maximum memory usage is updated to the new memory usage. This makes it possible to identify the maximum memory usage up to time t1, as shown in FIG. 8. Note that if the new memory usage is equal to or smaller than the maximum memory usage (step S33: NO), the process of step S34 is skipped. Therefore, the maximum memory usage is maintained without being updated.

[0046] On the other hand, when the execution of part of the processing of the second kernel 60 is completed, the memory usage measurement unit 62 releases the memory (step S41) as shown in Fig. 7(b). That is, the memory usage measurement unit 62 releases the amount of memory that was used for the operation of the part of the second kernel 60. This amount corresponds to the amount set by the program requesting the memory release.

[0047] Next, the memory usage measurement unit 62 calculates a new memory usage by subtracting the memory release amount from the current memory usage (step S42). The memory release amount is the amount of memory released by the memory usage measurement unit 62. In this way, when the execution of a part of the processing of the second kernel 60 is completed, the memory is released. As a result, as shown in FIG. 8, for example, after the time t1, the new memory usage starts to decline.

[0048] In this way, the memory usage measurement unit 62 measures the maximum memory usage by independently executing the memory acquisition process and the memory release process or by executing them in parallel depending on the processing status of the second kernel 60. After the memory usage measurement unit 62 finishes measuring the maximum memory usage, since the new memory usage is expressed as a percentage, it converts the new memory usage into memory usage in megabytes based on, for example, the memory capacity, the new memory usage, and a predetermined conversion formula for converting a percentage into megabytes, and outputs the converted new memory usage.

[0049] Next, the first embodiment will be described in comparison with a comparative example with reference to FIG.

[0050] 9 is a diagram for explaining a comparative example and the first embodiment. First, in the case of the comparative example shown in the upper part of FIG. 9, the first kernel 50 sets the memory usage for the second kernel 60 to the memory amount specified the first time by the worker. When the memory usage for the second kernel 60 is set, the second kernel 60 executes the kdump process and attempts to obtain a dump file. At this time, if the acquisition of the dump file fails, the set memory usage is insufficient, and the worker specifies a memory amount larger than the memory amount specified the first time and attempts to reconfigure the first kernel 50.

[0051] On the other hand, if the set memory usage is large enough to not interfere with the operation of the second kernel 60, the setting may be completed. However, if the specified memory amount is larger than necessary for the actual memory usage of the second kernel 60, there is waste in the memory amount, and it is unclear whether the optimal memory usage has been set. In some cases, the operation of the first kernel 50 may be hindered. For this reason, the worker checks the actual machine, and if it is determined that the memory usage is not optimal, the worker specifies the memory amount again. If the worker obtains the same result in the second operation as in the first operation, the worker performs the operation a third time, and thereafter repeats the operation until the worker determines that the memory usage is optimal. Thus, in the comparative example, the operation was complicated and it was difficult to evaluate whether it was appropriate.

[0052] However, according to the first embodiment shown in the lower part of Fig. 9, the first kernel 50 starts the initial setting even if the memory amount is not specified by the worker. When the first kernel 50 sets a checkpoint, it starts the second kernel 60 even in the middle of the initial setting, and temporarily ends the processing of the first kernel 50. The second kernel 60 executes the kdump process, measures the maximum memory usage actually used by the second kernel 60 during the kdump process, and registers it in the dump save area 111. When the kdump process ends, the second kernel 60 starts the first kernel 50.

[0053] When the first kernel 50 starts up, the first kernel 50 estimates the memory allocation for the second kernel 60 based on the memory usage registered in the dump save area 111, and resumes the initial setting from the checkpoint. In this way, even if the worker does not specify the memory amount, the first kernel 50 estimates the memory allocation based on the maximum memory usage actually used by the second kernel 60, and sets the estimated memory allocation for itself. Therefore, the worker can estimate an adaptive memory usage in a short time without performing complicated work.

[0054] As described above, according to the first embodiment, the server device 100 includes the first kernel execution unit 51, the second kernel execution unit 61, the memory usage measurement unit 62, and the environment construction unit 54. The first kernel execution unit 51 executes the first kernel 50 that sets an environment for acquiring a dump file that represents memory contents at the time of an OS failure. The second kernel execution unit 61 executes the second kernel 60 that acquires a dump file in the middle of setting the environment for acquiring the dump file. The memory usage measurement unit 62 measures the memory usage of the second kernel 60 while the second kernel 60 is running. The environment construction unit 54 estimates the memory allocation amount to be allocated to the use of the second kernel 60 based on the memory usage measured by the memory usage measurement unit 62. This makes it possible to estimate an adaptive memory amount to be allocated to the use of the second kernel 60 in a short time.

[0055] Here, it is also conceivable that the adaptive memory amount to be allocated for use by the second kernel 60 can be estimated based on, for example, the memory amount required to start the first kernel 50. However, while the first kernel 50 is started using a swap area, the second kernel 60 is started without using a swap area. For this reason, the memory amount required to start the first kernel 50 tends to be smaller than the memory amount required to start the second kernel 60. Therefore, even if the memory amount required to start the first kernel 50 is used, it is not always possible to estimate the adaptive memory amount to be allocated for use by the second kernel 60.

[0056] It is also possible to calculate the memory amount used by each piece of software (e.g., drivers, middleware, etc.) owned by the second kernel 60, and determine the memory usage to be allocated to the second kernel 60 by calculating the sum of the calculated memory amounts. However, the individual pieces of software owned by the second kernel 60 are diverse, and it is extremely difficult to investigate the memory usage of all the software in advance. In addition, since the memory amount used varies depending on the hardware environment in which the second kernel 60 operates, the estimation formula for estimating the memory usage may become complicated. However, according to the first embodiment and the second embodiment described later, the operator can estimate an adaptive memory amount to be allocated to the second kernel 60 in a short time without performing a cumbersome verification of the memory amount.

[0057] Second embodiment Next, a second embodiment of the present invention will be described with reference to Fig. 10 and Fig. 11. Fig. 10 is a flowchart showing another example of the process executed by the first kernel 50. As shown in Fig. 10, the second determination unit 53 of the first kernel 50 waits until an instruction to change the configuration is received (step S51: NO). For example, the second determination unit 53 waits until an instruction to change the memory allocation amount is detected from the worker. When the second determination unit 53 determines that an instruction to change the configuration is received (step S51: YES), the environment construction unit 54 rewrites the identifier to "under construction" (step S52). In the case of a configuration change, since the identifier "2" indicating "constructed" is registered in the acquired environment state identifier of the dump save area table T1, when the dump operation unit 56 is requested to rewrite, it deletes the identifier "2" of the acquired environment state identifier and registers the identifier "1" in the dump save area 111.

[0058] When the identifier is rewritten during construction, the environment construction unit 54 allocates the entire memory capacity in the server device 100 for the operation of the second kernel 60 (step S53). When the process of step S53 is completed, the second kernel execution instruction unit 58 instructs the execution of the second kernel 60 (step S54) and ends the process. The process executed by the second kernel is the same as that of the first embodiment described with reference to FIG. 6, and therefore a detailed description thereof will be omitted. The process after the second kernel has finished executing the process is the same as that of the first embodiment described with reference to FIG. 4, and therefore a detailed description thereof will be omitted. In the second embodiment, the initial setting value is not registered in the dump save area 111, so the environment construction unit 54 determines that the data length is 0 in the process of step S13 in FIG. 4.

[0059] 11 is a diagram for explaining the second embodiment. According to the second embodiment, the first kernel 50 allocates the entire memory amount for the operation of the second kernel 60 when there is an instruction to change the configuration even if the memory amount is not specified by the worker. Then, the first kernel 50 starts the second kernel 60 and ends the processing of the first kernel 50. The second kernel 60 executes the kdump process, measures the maximum memory usage actually used by the second kernel 60 during the kdump process, and registers it in the dump save area 111. The second kernel 60 starts the first kernel 50 when the dump process ends.

[0060] When the first kernel 50 is started, the first kernel 50 estimates a memory allocation amount for the second kernel 60 based on the memory usage amount registered in the dump save area 111. In this way, even if the worker does not specify the memory amount, the first kernel 50 estimates the memory allocation amount based on the maximum memory usage amount actually used by the second kernel 60. In this way, even in the second embodiment, the worker can estimate an adaptive memory usage amount in a short time without performing complicated work.

[0061] Although the preferred embodiment of the present invention has been described in detail above, the present invention is not limited to the specific embodiment, and various modifications and variations are possible within the scope of the gist of the present invention described in the claims.

[0062] In addition, the following supplementary notes are provided in relation to the above description. (Supplementary Note 1) A memory allocation device having a first execution unit that executes a first kernel that sets up an environment for acquiring a dump representing memory contents in the event of an OS failure, a second execution unit that executes a second kernel that acquires the dump, an execution instruction unit that instructs the second kernel to acquire the dump in the middle of setting up the acquisition environment, a measurement unit that measures memory usage of the second kernel while the second kernel is running, and an estimation unit that estimates a memory allocation amount to be assigned to use by the second kernel based on the measured memory usage. (Supplementary Note 2) The memory allocation device according to Supplementary Note 1, further comprising a setting unit that sets the time when the setting of the acquisition environment is resumed, and the estimation unit resumes the setting of the acquisition environment from the time when the setting is resumed. (Appendix 3) The memory allocation device described in Appendix 1 or 2, characterized in that the second execution unit executes the second kernel after the entire capacity of the main memory unit of the memory allocation device has been allocated for use by the second kernel by the first kernel. (Supplementary Note 4) A memory allocation device as described in any one of Supplementary Notes 1 to 3, characterized in that the dump represents a kernel portion of the memory contents. (Appendix 5) A memory allocation program for causing a computer to execute a process of executing a first kernel that sets up an environment for acquiring a dump representing memory contents in the event of an OS failure, instructing a second kernel that acquires the dump to acquire the dump during the setting of the acquisition environment, executing the second kernel that acquires the dump in response to the instruction, measuring memory usage of the second kernel while the second kernel is running, and estimating a memory allocation amount to be assigned to use by the second kernel based on the measured memory usage. (Appendix 6) A memory allocation program as described in Appendix 5, characterized in that it includes a process of setting a time when the setting of the acquisition environment is resumed, and the process of estimating the memory allocation amount resumes the setting of the acquisition environment from the time when the setting is resumed. (Appendix 7) The memory allocation program according to appendix 5 or 6, characterized in that the process of executing the second kernel executes the second kernel after the entire capacity of the main memory unit of the computer has been allocated by the first kernel for use by the second kernel. (Supplementary Note 8) The memory allocation program according to any one of Supplementary Notes 5 to 7, wherein the dump represents a kernel portion of the memory contents. (Appendix 9) A memory allocation method in which a computer executes a process of executing a first kernel that sets up an environment for acquiring a dump representing memory contents in the event of an OS failure, instructing a second kernel that acquires the dump to acquire the dump during the setting of the acquisition environment, executing the second kernel that acquires the dump in response to the instruction, measuring memory usage of the second kernel while the second kernel is running, and estimating a memory allocation amount to be assigned to use by the second kernel based on the measured memory usage. [Explanation of symbols]

[0063] 50 First Kernel 51 First Kernel Execution Unit (First Execution Unit) 54 Environment Construction Department (Estimation Department) 57 Checkpoint setting unit (setting unit) 58 Second kernel execution unit (execution unit) 60 Second Kernel 61 Second Kernel Execution Unit (Second Execution Unit) 62 Memory usage measurement unit (measurement unit) 100 Server device 110 Auxiliary storage 111 Dump Evacuation Area 120 Main memory 130 Processing section

Claims

1. a first execution unit that executes a first kernel that sets an environment for acquiring a dump representing memory contents when an OS (operating system) fails; a second execution unit that executes a second kernel that acquires the dump; an execution instruction unit that instructs the second kernel to acquire the dump during the setting of the acquisition environment; a measurement unit that measures a memory usage of the second kernel while the second kernel is running; an estimation unit that estimates a memory allocation to be allocated to the second kernel based on the measured memory usage; A memory allocation apparatus having:

2. A setting unit that sets a time when the acquisition environment is restarted, The estimation unit resumes the setting of the acquisition environment from the time of the resumption of the setting.

2. The memory allocation apparatus of claim 1.

3. the second execution unit executes the second kernel after the first kernel has allocated an entire capacity of a main memory unit included in the memory allocation device to be used by the second kernel.

3. The memory allocation device according to claim 1 or 2.

4. Executing a first kernel that sets up an environment for acquiring a dump representing memory contents in the event of an OS (operating system) failure; instructing a second kernel that acquires the dump to acquire the dump during the setting of the acquisition environment; In response to the instruction, execute a second kernel that obtains the dump; measuring memory usage of the second kernel while the second kernel is running; estimating a memory allocation to be allocated for use by the second kernel based on the measured memory usage; A memory allocation program that allows a computer to execute a process.

5. Executing a first kernel that sets up an environment for acquiring a dump representing memory contents in the event of an OS (operating system) failure; instructing a second kernel that acquires the dump to acquire the dump during the setting of the acquisition environment; In response to the instruction, execute a second kernel that obtains the dump; measuring memory usage of the second kernel while the second kernel is running; estimating a memory allocation to be allocated for use by the second kernel based on the measured memory usage; A method of allocating memory for a computer to carry out operations.

Citation Information

Patent Citations

  • Allocation system for memory size used by task

    JP1990031250A

  • Method and system having automatic memory dump size calculation function for gathering dump

    JP1999031092A

  • Compact core dump program for built-in equipment and method using compact core dump

    JP2007172414A

  • Multi-node system, node, memory dump processing method, and program

    JP2010176345A