JVM intelligent predictive tuning method, device and equipment based on large model and medium
By collecting and processing multimodal JVM runtime metrics data, and using performance prediction models and multi-objective optimization algorithms to generate optimization schemes, proactive prevention and automated regulation of JVM performance are achieved. This solves the problems of dynamic adaptability and multi-objective optimization in existing tuning methods and improves the regulation effect.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHANGHAI XINXIAOFEI DIGITAL TECHNOLOGY CO LTD
- Filing Date
- 2026-02-05
- Publication Date
- 2026-06-02
AI Technical Summary
Existing JVM tuning methods are insufficient in terms of dynamic adaptability and predictive capabilities, making it difficult to meet the elasticity and adaptive requirements of modern cloud-native environments. Furthermore, multi-objective optimization is difficult, and efficient performance control cannot be achieved.
Multimodal performance metrics data are collected, feature-engineered, and then input into a pre-trained performance prediction model to generate the predicted probability of performance degradation events. A multi-objective constraint optimization algorithm is used to generate JVM parameter optimization schemes, and a secure execution mechanism is combined to achieve automated deployment and canary release.
It improves the accuracy and reliability of JVM performance tuning, shifts from passive response to proactive prevention, solves the problems of poor dynamic adaptability and difficulty in balancing multiple objectives, and improves the tuning effect.
Smart Images

Figure CN122132280A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence technology, and in particular to a method, apparatus, device, and medium for intelligent predictive tuning of JVM based on a large model. Background Technology
[0002] In the operation and maintenance of Java application services, performance tuning of the Java Virtual Machine (JVM) is a crucial step in ensuring service response speed, throughput, and resource utilization efficiency. Currently, commonly used JVM performance optimization methods include static parameter configuration relying on human experience, rule engine mechanisms based on threshold alerts, and single-point optimization using traditional machine learning techniques. However, these methods all have certain limitations in practical applications and are insufficient to meet the higher requirements of elasticity, adaptability, and intelligent operation and maintenance in modern cloud-native environments.
[0003] A common practice is to rely on expert experience for static parameter tuning. Specifically, after a system undergoes performance stress testing or experiences an online failure, highly experienced engineers typically perform one-time or phased static settings on key JVM parameters, such as initial and maximum heap memory size, young generation capacity, garbage collector type, and numerous other advanced parameters. A significant drawback of this approach is its lack of dynamic adaptability. Once business traffic characteristics change, or the lifecycle distribution of objects within the application alters, the previously set fixed parameter combinations may quickly become invalid. Furthermore, this method heavily relies on the personal judgment of senior experts, making the tuning process not only labor-intensive but also time-consuming and inefficient in terms of parameter verification and regression testing.
[0004] To improve the automation of operations and maintenance, another widely implemented approach is to build a threshold-based alerting and rule engine. This approach collects runtime metrics through the management interface provided by the JVM and sets fixed threshold boundaries for key performance indicators such as heap memory utilization and garbage collection pause time. When monitored data reaches these preset thresholds, the system triggers corresponding handling rules. However, this approach is quite cumbersome to maintain. Due to differences in behavior patterns across different business periods, user tenants, and even application versions, it is difficult to set a universally applicable set of static thresholds, and the rule system easily becomes bloated and difficult to manage. Essentially, this is a passive response model, lacking the ability to predict performance trends, and intervention is usually only possible after service level objectives have suffered substantial damage, failing to achieve preventative measures.
[0005] With the development of artificial intelligence technology, the industry has begun to try to introduce traditional machine learning models or single-objective optimization algorithms to assist in tuning. These methods use statistical models or time series analysis to generate parameter adjustment suggestions for a specific type of performance metric. However, their limitations lie in their inability to effectively handle the massive, high-dimensional monitoring metrics generated by the JVM runtime, and even more so in their inability to effectively balance and compromise between multiple competing objectives (such as low latency, high throughput, and low resource costs). In addition, most of these technical solutions remain at the suggestion level, generally lacking online secure execution mechanisms that are linked to the production environment, and cannot reliably drive the system to automatically implement parameter changes and ensure that the risks of the change process are controllable. Summary of the Invention
[0006] This invention provides a JVM intelligent predictive tuning method, apparatus, device, and medium based on a large model, aiming to solve the problem of poor tuning effect of existing JVM tuning methods.
[0007] In a first aspect, embodiments of the present invention provide a JVM intelligent predictive tuning method based on a large model, comprising: Collect multimodal runtime metrics data of the target JVM instance; The multimodal performance index data is subjected to feature engineering to generate standardized feature vectors; The standardized feature vector is input into a pre-trained performance prediction model to obtain the predicted probability that the target JVM instance will experience a performance degradation event within a preset future time window. In response to the predicted probability exceeding a preset probability threshold, at least one candidate JVM parameter optimization scheme that satisfies the preset objective constraints is generated through a multi-objective constraint optimization algorithm. Select a target optimization scheme from the at least one candidate JVM parameter optimization schemes, and safely execute the target optimization scheme on the target JVM runtime instance.
[0008] A further technical solution is that the method further includes: After executing the target optimization scheme, the performance metrics of the target JVM instance are continuously monitored within a preset observation window. In response to the monitored performance indicators deteriorating to the point of exceeding the preset safety boundary, an automatic rollback operation is triggered to restore the JVM parameters of the target JVM instance to the state before the target optimization scheme was executed; The data and results of this optimization process are stored in a preset knowledge base to update the optimization strategy of the performance prediction model.
[0009] A further technical solution is that the collection of multimodal runtime metric data of the target JVM instance includes: Metrics for memory management, garbage collection, thread status, and class loading are collected via the JMX interface. Collect garbage collection pauses, object allocation rates, and lock contention events using a Java flight recorder; Collect garbage collection log files to obtain data on downtime distribution and collection efficiency; Collect the host operating system's CPU load, I / O wait time, and container resource limits.
[0010] A further technical solution is that, by using a multi-objective constraint optimization algorithm, at least one candidate JVM parameter optimization scheme that satisfies preset objective constraints is generated, including: The optimization objectives are at least two of the following: reducing service response latency, reducing total garbage collection downtime, increasing throughput, and reducing resource costs. The service level target threshold, the upper limit of JVM parameter change range, and the dependency relationship between JVM parameters are used as constraints. The Bayesian optimization algorithm is used to search within the feasible region defined by the constraints to generate the candidate JVM parameter optimization schemes.
[0011] A further technical solution involves safely executing the target optimization scheme on the target JVM runtime instance, including: Identify the adjustable class of the JVM parameters to be adjusted in the target optimization scheme, the adjustable class including runtime adjustable parameters and parameters that require a restart to take effect; For runtime adjustable parameters, they can be set online through the DiagnosticCommandMBean interface or the jcmd command provided by the JDK; For parameters that require a restart to take effect, configuration is performed through a preset rolling restart process.
[0012] A further technical solution is that the target optimization scheme adopts a canary release method, wherein the canary release includes: The target optimization scheme is executed on a pre-selected set of target instances of the target JVM runtime instance. If the performance metrics of the target instance set are confirmed to be stable or improved within the preset observation window, the execution scope of the target optimization scheme will be gradually expanded to more instances. If a performance metric is detected to deteriorate at any stage of the grayscale release, a rollback operation on the modified instance will be immediately triggered.
[0013] A further technical solution is that the method further includes: The optimization cases in the knowledge base are analyzed using a large language model to generate a readable optimization report that includes the reasons for the changes, the expected impact, and risk warnings. Transferable rules are extracted from successful optimization cases and used to optimize the search strategy of the multi-objective constraint optimization algorithm.
[0014] A further technical solution is that, before selecting the target optimization scheme from the at least one candidate JVM parameter optimization scheme, the method further includes: The interpretability of the candidate JVM parameter optimization schemes is analyzed using a large language model, and the tuning basis description text corresponding to the candidate JVM parameter optimization schemes is generated.
[0015] Secondly, embodiments of the present invention also provide a JVM intelligent predictive tuning device based on a large model, which includes a unit for performing the above-described method.
[0016] Thirdly, embodiments of the present invention also provide a computer device, which includes a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the above-described method.
[0017] Fourthly, embodiments of the present invention also provide a computer-readable storage medium storing a computer program that, when executed by a processor, can implement the above-described method.
[0018] This invention provides a method, apparatus, device, and medium for intelligent predictive tuning of JVM based on a large model. The method includes: collecting multimodal runtime metric data of a target JVM instance; performing feature engineering on the multimodal runtime metric data to generate a standardized feature vector; inputting the standardized feature vector into a pre-trained performance prediction model to obtain a predicted probability of a performance degradation event occurring in the target JVM instance within a preset future time window; in response to the predicted probability exceeding a preset probability threshold, generating at least one candidate JVM parameter optimization scheme that satisfies preset objective constraints using a multi-objective constraint optimization algorithm; selecting a target optimization scheme from the at least one candidate JVM parameter optimization scheme; and safely executing the target optimization scheme on the target JVM instance. This invention collects JVM multimodal runtime metric data and performs feature engineering to form a standardized feature vector; utilizes a pre-trained performance prediction model to achieve early warning of performance degradation events; generates a parameter optimization scheme that considers multiple performance objectives based on the prediction results using a multi-objective constraint optimization algorithm; and completes automated deployment through a secure execution mechanism. This method realizes the transformation from passive response to active prevention, effectively solving the shortcomings of traditional tuning methods such as poor dynamic adaptability, lack of predictive ability and difficulty in balancing multiple objectives. It significantly improves the accuracy and reliability of JVM performance tuning and effectively enhances the control effect of JVM performance. Attached Figure Description
[0019] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 A flowchart illustrating a JVM intelligent predictive tuning method based on a large model, provided in an embodiment of the present invention; Figure 2 This is a schematic block diagram of a computer device provided in an embodiment of the present invention. Detailed Implementation
[0021] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0022] It should be understood that, when used in this specification and the appended claims, the terms "comprising" and "including" indicate the presence of the described features, integrals, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.
[0023] It should also be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the invention. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.
[0024] It should also be further understood that the term "and / or" as used in this specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0025] As used in this specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if [described condition or event] is detected" may be interpreted, depending on the context, as "once determined," "in response to determination," "once [described condition or event] is detected," or "in response to detection of [described condition or event]."
[0026] Please see Figure 1 This invention provides a JVM intelligent predictive tuning method based on a large model. By constructing a systematic intelligent closed-loop tuning process, it achieves a fundamental improvement in Java Virtual Machine performance management. The method includes the following steps: S1 collects multimodal runtime metrics data of the target JVM instance.
[0027] In practice, by collecting multimodal runtime metric data of the target JVM instance, the system establishes a comprehensive perception foundation. This approach breaks through the single-perspective limitations of traditional monitoring methods, enabling the system to simultaneously acquire runtime status information from multiple dimensions such as memory management, garbage collection, thread concurrency, just-in-time compilation, and underlying operating system resources. This allows for the construction of a three-dimensional JVM health profile, laying a solid data foundation for subsequent in-depth analysis.
[0028] In some preferred embodiments, the above step of "collecting multimodal runtime metric data of the target JVM instance" specifically includes the following steps: collecting metrics of memory management, garbage collection, thread status, and class loading through the JMX interface; collecting garbage collection pauses, object allocation rates, and lock contention events through the Java Flight Recorder; collecting garbage collection log files to obtain pause time distribution and collection efficiency data; and collecting metrics of the host operating system's CPU load, input / output wait time, and container resource limits.
[0029] In practice, collecting metrics from core components such as memory management, garbage collection, thread states, and class loading via the JMX interface allows for the acquisition of standardized quantitative data on the JVM's internal operation. Collecting events through the Java Flight Recorder captures detailed, high-precision, low-overhead diagnostic information such as garbage collection pauses, object allocation rates, and lock contention events—crucial for pinpointing momentary performance bottlenecks. Collecting garbage collection log files provides a broader, macroscopic view of garbage collection behavior patterns over a longer time span, including the distribution of pause times and collection efficiency data. Collecting metrics from the host operating system's CPU load, I / O wait times, and container resource limits expands the analytical perspective from within the JVM to its runtime environment, helping to differentiate whether performance issues originate from the application itself or from underlying resource contention.
[0030] This fusion of multimodal data enables the system to form a holistic understanding of the JVM and its runtime environment, allowing for more accurate root cause analysis and performance trend assessment. For example, high JVM heap memory usage alone may not be enough to diagnose a problem, but by combining operating system memory pressure and container limits, it's possible to clearly determine whether the issue is an application memory leak or insufficient resource allocation, thus guiding the generation of more effective optimization solutions.
[0031] S2, perform feature engineering on the multimodal operation index data to generate standardized feature vectors.
[0032] In practice, feature engineering is performed on multimodal operational index data to generate standardized feature vectors. This step produces crucial data preprocessing results. Raw monitoring indicators often suffer from inconsistencies in units, differences in sampling frequencies, and noise interference. Through normalization, missing value imputation, and derived feature construction, not only are the negative impacts of data heterogeneity on model analysis eliminated, but time-series features with higher discriminative power are also extracted.
[0033] For example, transforming the original memory usage sequence into derived features such as allocation rate, promotion rate, and window statistics can more effectively reveal the inherent patterns of memory management. This processing significantly improves the quality and interpretability of subsequent model input data, providing a crucial guarantee for accurate prediction.
[0034] In one embodiment, the feature engineering process is implemented in the following way: First, data reception and time alignment are performed. The system receives multimodal operational metric data from various sources, including memory and thread status metrics obtained through the JMX interface, event-based data obtained through the Java Flight Recorder, text records from garbage collection log files, and resource monitoring metrics from the host operating system. Since these data sources have different acquisition periods and reporting delays, the system uses a unified baseline timestamp as a reference and employs linear interpolation or forward padding algorithms to normalize all input data onto a unified time series, with a time resolution, for example, at the millisecond level.
[0035] Secondly, missing value handling and noise filtering are performed. For missing data points caused by acquisition jitter or transmission loss, the system uses time-series-based predictive imputation methods, such as moving averages or linear interpolation algorithms. For transient impulse noise in the data, the system applies a mean-length filtering algorithm for smoothing to eliminate the interference of abnormal fluctuations on subsequent analysis.
[0036] Next, multi-dimensional feature construction is performed. Based on the well-organized time-series data, the system derives a series of statistical and composite features with higher discriminative power. Specifically, this includes: calculating the instantaneous rate of change and first derivative of key performance indicators, such as object allocation rate and memory promotion rate; calculating the correlation ratios between different indicators, such as the ratio of young generation memory to heap memory and garbage collection efficiency ratio; calculating the statistics of indicators within a sliding time window, including the arithmetic mean, variance, and specified high quantile within the window; and calculating the frequency of occurrence of specific events within a unit time window.
[0037] Next, feature scaling and standardization are performed. To eliminate the impact of differences in dimensions and orders of magnitude between different feature indicators on model convergence and accuracy, the system standardizes all constructed features. For features that conform to a Gaussian distribution, the Z-Score standardization method is used to transform them into a distribution with a mean of zero and a standard deviation of one; for features with significant outliers or unclear distributions, a robust standardization method based on the median and quantiles is used.
[0038] Finally, feature selection and vector assembly are performed. The system uses feature importance evaluation algorithms, such as feature importance ranking based on mutual information or tree models, to select the feature subset that contributes the most to the prediction of performance degradation events from the generated feature set. The selected feature subset is then concatenated and assembled according to a predetermined dimensional order to form a fixed-dimensional, numerically standardized feature vector, which serves as the standardized input to the performance prediction model.
[0039] Through the above progressive data processing steps, the original heterogeneous multimodal indicators are transformed into high-quality, standardized feature vectors suitable for machine learning models, laying a solid data foundation for subsequent accurate predictions.
[0040] S3, input the standardized feature vector into the pre-trained performance prediction model to obtain the predicted probability of the target JVM instance experiencing a performance degradation event within a preset future time window.
[0041] In practice, inputting standardized feature vectors into a pre-trained performance prediction model to obtain the predicted probability of performance degradation events within future time windows is the core step in this solution, enabling a shift from passive response to proactive intervention and endowing the system with forward-looking insights. By learning complex nonlinear time-series patterns from historical data, the performance prediction model can identify subtle signs of performance degradation, thus issuing early warnings before service level targets are actually compromised.
[0042] In some preferred embodiments, the performance prediction model is a machine learning model based on a multi-layer temporal convolutional network or a Transformer architecture; the performance degradation events include at least one of the following: service response latency degradation, memory overflow risk, garbage collection storm risk, and pause time exceeding the threshold risk.
[0043] In practice, machine learning models based on multi-layer temporal convolutional networks or Transformer architectures are particularly adept at handling sequential data with long-term dependencies and temporal dynamics, which are precisely the characteristics of JVM runtime metrics data. Temporal convolutional networks can effectively capture patterns in long sequences through dilated convolutions, while the Transformer architecture utilizes self-attention mechanisms to weigh the importance of data at different time points. These characteristics enable the model to learn subtle precursory patterns that indicate performance degradation from historical data, rather than simple threshold triggers.
[0044] Furthermore, defining performance degradation events specifically as various types, such as service response latency degradation, memory overflow risk, garbage collection storm risk, and pause time exceeding the threshold risk, means that the predictive model does not simply provide a general "abnormal" signal, but can distinguish between risks of different natures, thus providing more targeted input for subsequent optimization decisions. For example, the optimization strategies triggered by predicting "garbage collection storm risk" and predicting "memory overflow risk" will differ in focus and urgency. This fine-grained predictive capability makes preventative measures more accurate and effective, avoiding a "one-size-fits-all" approach and improving the targeting and efficiency of optimization actions.
[0045] S4. In response to the predicted probability exceeding a preset probability threshold, at least one candidate JVM parameter optimization scheme that satisfies the preset objective constraints is generated through a multi-objective constraint optimization algorithm.
[0046] In practice, when the predicted probability exceeds a preset threshold, the system immediately generates candidate JVM parameter optimization schemes through a multi-objective constraint optimization algorithm. The technical effect of this step is to achieve intelligent and context-based decision generation. It overcomes the limitations of traditional single-objective optimization or experience-based parameter tuning, and can automatically balance multiple competing objectives such as reducing service response latency, minimizing garbage collection pauses, increasing system throughput, and controlling resource costs.
[0047] Furthermore, the multi-objective constrained optimization algorithm searches under strict constraints, including service level target thresholds, parameter safety change ranges, and logical dependencies between parameters. This ensures that each generated candidate solution is not only theoretically efficient but also safe and feasible in actual deployment. This allows the tuning recommendations to accurately adapt to the specific load characteristics and runtime state of the current application.
[0048] In some preferred embodiments, the above step "generating at least one candidate JVM parameter optimization scheme that satisfies preset objective constraints through a multi-objective constraint optimization algorithm" specifically includes the following steps: taking at least two of the following as optimization objectives: reducing service response latency, reducing total garbage collection pause time, increasing throughput, and reducing resource costs; taking the service level target threshold, the upper limit of JVM parameter change range, and the dependency relationship between JVM parameters as constraints; and using a Bayesian optimization algorithm to search within the feasible region defined by the constraints to generate the candidate JVM parameter optimization scheme.
[0049] In practical implementation, at least two of the following optimization objectives are used: reducing service response latency, reducing total garbage collection pause time, increasing throughput, and reducing resource costs. These objectives can be selected by the user or determined based on the current degraded performance of the target JVM instance; this invention does not specifically limit this. This method forces consideration of the multidimensionality of performance during the optimization process, avoiding one-sided optimization that sacrifices other metrics to improve a single metric. For example, simply pursuing low latency might mean requiring more frequent garbage collection, thus sacrificing throughput and increasing CPU overhead. This method, through multi-objective optimization, can find a parameter combination that achieves the optimal balance between latency and throughput.
[0050] Meanwhile, by using service level target thresholds, upper limits on parameter change ranges, and dependencies between parameters as constraints, it is ensured that the generated candidate solutions are not only high-performing but also safe, feasible, and compliant with business requirements. Using a Bayesian optimization algorithm for search is an efficient optimization strategy for scenarios where objective function evaluation is costly (because directly testing different parameters in a production environment is expensive). It guides the search direction by constructing a surrogate model, enabling rapid convergence to the high-performance region with fewer attempts. Therefore, the optimization method of this invention can intelligently handle multi-objective trade-offs while ensuring safety, efficiently generating high-quality JVM parameter optimization solutions.
[0051] S5, Select a target optimization scheme from the at least one candidate JVM parameter optimization scheme, and safely execute the target optimization scheme on the target JVM runtime instance.
[0052] In practice, the target optimization scheme is selected from candidate solutions and executed securely, completing a closed loop from analysis and decision-making to actual action. Specifically, the target optimization scheme can be selected by the user; this invention is not specifically limited. The technical effect of this step is that the optimization strategy derived from the intelligent algorithm is reliably applied to the production environment, realizing the automated implementation of the tuning process. The secure execution mechanism ensures that parameter change operations themselves do not introduce new stability risks, thereby solving the most critical trust issue in automated operation and maintenance.
[0053] In some preferred embodiments, before the above step "selecting a target optimization scheme from the at least one candidate JVM parameter optimization scheme", the method further includes the following step: performing interpretability analysis on the candidate JVM parameter optimization scheme using a large language model, and generating tuning basis description text corresponding to the candidate JVM parameter optimization scheme.
[0054] In practice, before making a final selection from multiple candidate JVM parameter optimization schemes, a large language model is used to perform interpretability analysis and generate tuning justification text, essentially providing each candidate scheme with a "decision instruction manual." This manual explains in a human-readable way why this set of parameters is recommended, which performance metrics are expected to improve, and the potential risks or trade-offs. This allows those responsible for approving or overseeing the automation process to fully understand the system's recommendations before execution, rather than blindly executing an algorithm-generated, incomprehensible combination of numbers. This pre-decision transparency not only enhances user trust in the automated system, but more importantly, it allows human experts to incorporate their domain knowledge and business context into the final decision, enabling calibration and optimization of AI suggestions. This leads to a final judgment that better aligns with current business priorities and security requirements, avoiding potential risks arising from opaque AI decision-making logic.
[0055] In some preferred embodiments, the above step "safely execute the target optimization scheme on the target JVM runtime instance" specifically includes the following steps: identifying the adjustability classification of the JVM parameters to be adjusted in the target optimization scheme, wherein the adjustability classification includes runtime adjustable parameters and parameters that require a restart to take effect; for runtime adjustable parameters, online settings are made through the DiagnosticCommandMBean interface or jcmd command provided by JDK; for parameters that require a restart to take effect, configuration is performed through a preset rolling restart process.
[0056] In practice, by identifying whether the parameter to be adjusted is a runtime-tunable parameter or a parameter that requires a restart to take effect, the system can select the most suitable execution channel with the least impact on business operations. For runtime-tunable parameters, online settings can be made through the JDK's official DiagnosticCommandMBean interface or jcmd command, enabling dynamic and uninterrupted tuning of the target JVM instance. This is crucial for scenarios requiring rapid response to performance fluctuations, achieving true "online" optimization.
[0057] Furthermore, for parameters that require a restart to take effect, configuration is performed through a pre-defined rolling restart process, thus acknowledging and properly handling critical parameters that cannot be dynamically adjusted. Although restarting introduces a brief service interruption, its impact can be minimized through pre-defined, controllable processes (such as graceful stream extraction and warm-up). This categorized execution mechanism allows the automated system to cover a broader spectrum of JVM parameters, rather than being limited to a small subset of dynamic parameters, thereby expanding its optimization potential.
[0058] Specifically, the implementation methods of the above-mentioned rolling restart process include: First, a graceful load shedding operation is performed. The system sends a command to the load balancer or service registry associated with the target JVM instance to remove the instance from the list of available upstream services. After this, the system enters a preset waiting window, allowing the instance to continue processing received online requests but no longer accepting new external requests. Simultaneously, the system monitors the instance's active connection count and the status of business threads in the current thread pool until all ongoing business processing is completed or a preset timeout threshold is reached, ensuring uninterrupted business operations and preventing transaction failures or data inconsistencies caused by forced interruptions.
[0059] Secondly, parameter injection and instance restart are performed. After confirming that instance traffic has been cleared and the instance is in a quiescent state, the system dynamically injects the JVM parameters that need to be restarted, based on the selected target optimization scheme. This injection process is achieved by modifying the runtime configuration file corresponding to the instance, specifically by writing the new parameter key-value pairs into the JVM startup parameter file; or, in a containerized deployment environment, by updating the environment variables or command-line parameters in its Pod definition. After the parameters are updated, the system triggers the shutdown and restart of the JVM instance. During the shutdown process, the system calls the graceful shutdown hook to ensure that the JVM process completes the necessary resource cleanup work before terminating.
[0060] Subsequently, instance warm-up and health verification are performed. After a new JVM instance starts up, the system does not immediately expose it to the outside world. Instead, it first performs a series of preset health checks, including checking whether its critical management ports are ready and whether core basic services have been initialized. After the health checks pass, the system enters a critical warm-up phase. In this phase, the system can import preset simulated load or a small portion of extracted real historical traffic into the instance, driving the JVM's just-in-time compiler to compile and optimize critical business code paths, while simultaneously warming up various caches, gradually improving the instance's performance to a stable and usable level.
[0061] Finally, traffic recovery is performed. Once the system confirms that the instance has performed stably during the warm-up phase and that its key performance indicators have met the preset service standards, it sends a command to the load balancer or service registry to re-register the instance with the service discovery system, enabling it to receive and process a normal proportion of online traffic again, thus completing the entire rolling restart process.
[0062] This specific implementation method, through the above-described orderly and automated steps, maximizes the continuity of services and the consistency of data when the application needs to be restarted to take effect, and realizes safe and lossless changes to JVM parameters in the production environment.
[0063] In some preferred embodiments, the target optimization scheme adopts a canary release, which includes: executing the target optimization scheme on a pre-selected target instance set of the target JVM running instance; if the performance indicators of the target instance set are confirmed to be stable or improved within a preset observation window, gradually expanding the execution scope of the target optimization scheme to more instances; if the performance indicators are detected to deteriorate at any stage of the canary release, a rollback operation on the changed instances is immediately triggered.
[0064] In practice, by first executing the target optimization scheme on a pre-selected set of target instances (such as canary instances), the system can practically verify the effects of the changes in an environment with limited impact. This is equivalent to establishing a safe "test field" in the production environment. If the performance indicators of these instances are confirmed to be stable or improved within the observation window, it proves that the optimization scheme is effective and safe in the current environment, thus providing a basis for decision-making to gradually expand the implementation scope to more instances. This is an evidence-based and robust promotion strategy.
[0065] Furthermore, limited to any stage of the canary release, once performance metrics are detected to deteriorate (e.g., performance drops to a preset low threshold), a rollback operation on the changed instance is immediately triggered. This mechanism forms a safety net for rapid feedback and risk isolation. Even if the optimization solution is theoretically perfect, it may produce negative effects due to unforeseen complex interactions. In this case, immediate rollback can quickly restore the business to a normal state, preventing local problems from evolving into global failures. This phased verification and rapid rollback canary release strategy greatly enhances the confidence and security of implementing automated changes in the production environment, and is the core guarantee supporting the reliable operation of the closed-loop automated system.
[0066] In some preferred embodiments, the method further includes the following steps: after executing the target optimization scheme, continuously monitoring the performance indicators of the target JVM instance within a preset observation window; in response to the monitored performance indicators deteriorating to exceed a preset safety boundary, automatically triggering a rollback operation to restore the JVM parameters of the target JVM instance to the state before executing the target optimization scheme; and storing the data and results of this tuning process in a preset knowledge base for updating the optimization strategy of the performance prediction model.
[0067] In practice, by continuously monitoring performance indicators within a preset observation window and automatically triggering rollback operations in case of deterioration, a robust safety barrier is established for the automated tuning process. This mechanism greatly reduces the risk of production environment failures caused by inappropriate parameter adjustments, thereby enhancing the reliability and trustworthiness of the entire system and making large-scale application of automated tuning in production environments possible.
[0068] Specifically, even if the solution generated by the optimization algorithm is theoretically optimal, it may still have negative effects in complex real-world environments due to unmodeled factors. In such cases, the automatic rollback function can immediately restore the system to a safe state, effectively controlling the scope of the impact.
[0069] Furthermore, the data and results of each tuning process are stored in a knowledge base and used to update the model and strategies, enabling the system to continuously learn and improve. Every successful tuning experience or failed rollback case becomes training data for system evolution, making the performance prediction model more accurate over time and the optimization strategies more aligned with actual business scenarios. This closed-loop learning mechanism, which learns from practice and provides feedback for optimization, ensures that the system can adapt to continuous changes in business load and the continuous evolution of software versions, thereby maintaining its tuning effectiveness in the long term and preventing performance from gradually degrading over time.
[0070] In some preferred embodiments, the method further includes the following steps: analyzing the tuning cases in the knowledge base using a large language model to generate a readable tuning report containing the reasons for the changes, expected impacts, and risk warnings; and extracting transferable rules from successful tuning cases to optimize the search strategy of the multi-objective constraint optimization algorithm.
[0071] In practice, a large language model is used to analyze a large number of optimization cases accumulated in the knowledge base, generating readable optimization reports that include the reasons for changes, expected impacts, and risk warnings. This process interprets and translates the complex logic and data behind machine decision-making, transforming them into natural language descriptions that human experts can easily understand. This greatly improves the human-machine collaboration interface, enabling operations personnel or performance engineers to review, understand, and trust the system's automated decisions, and even intervene when necessary, thus solving the problem that AI systems are often regarded as "black boxes" and difficult to accept.
[0072] Furthermore, transferable rules are extracted from successful tuning cases to optimize the search strategy of multi-objective constrained optimization algorithms. This means the system is not merely storing historical data, but actively learning high-order, universal tuning principles from successful experiences. For example, the system might discover that a certain set of parameter tuning strategies typically yields good results for a specific type of application (such as high-concurrency web services). These refined rules can be used to guide the initial search direction of the optimization algorithm or constrain its search space, thereby accelerating the convergence speed of subsequent tuning processes and increasing the probability of finding high-quality solutions.
[0073] This invention proposes a JVM intelligent predictive tuning method based on a large model, comprising: collecting multimodal runtime metric data of a target JVM instance; performing feature engineering on the multimodal runtime metric data to generate standardized feature vectors; inputting the standardized feature vectors into a pre-trained performance prediction model to obtain the predicted probability of a performance degradation event occurring in the target JVM instance within a preset future time window; in response to the predicted probability exceeding a preset probability threshold, generating at least one candidate JVM parameter optimization scheme that satisfies preset objective constraints through a multi-objective constraint optimization algorithm; selecting a target optimization scheme from the at least one candidate JVM parameter optimization schemes, and safely executing the target optimization scheme on the target JVM instance. This invention collects JVM multimodal runtime metric data and performs feature engineering to form standardized feature vectors; utilizes a pre-trained performance prediction model to achieve early warning of performance degradation events; generates parameter optimization schemes that take into account multiple performance objectives based on the prediction results using a multi-objective constraint optimization algorithm; and completes automated deployment through a secure execution mechanism. This method realizes the transformation from passive response to active prevention, effectively solving the shortcomings of traditional tuning methods such as poor dynamic adaptability, lack of predictive ability and difficulty in balancing multiple objectives. It significantly improves the accuracy and reliability of JVM performance tuning and effectively enhances the control effect of JVM performance.
[0074] Please see Figure 2 , Figure 2 This is a schematic block diagram of a computer device provided in an embodiment of this application. The computer device 500 can be a terminal or a server. The terminal can be an electronic device with communication functions, such as a smartphone, tablet, laptop, desktop computer, personal digital assistant, or wearable device. The server can be a standalone server or a server cluster composed of multiple servers.
[0075] The computer device 500 includes a processor 502, a memory, and a network interface 505 connected via a system bus 501. The memory may include a non-volatile storage medium 503 and internal memory 504.
[0076] The non-volatile storage medium 503 can store an operating system 5031 and a computer program 5032. When the computer program 5032 is executed, it enables the processor 502 to execute a JVM intelligent predictive tuning method based on a large model.
[0077] The processor 502 provides computing and control capabilities to support the operation of the entire computer device 500.
[0078] The internal memory 504 provides an environment for the execution of the computer program 5032 in the non-volatile storage medium 503. When the computer program 5032 is executed by the processor 502, the processor 502 can execute a JVM intelligent predictive tuning method based on a large model.
[0079] The network interface 505 is used for network communication with other devices. Those skilled in the art will understand that the above structure is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device 500 to which the present application is applied. A specific computer device 500 may include more or fewer components than shown in the figures, or combine certain components, or have different component arrangements.
[0080] The processor 502 is used to run a computer program 5032 stored in the memory to perform the following steps: Collect multimodal runtime metrics data of the target JVM instance; The multimodal performance index data is subjected to feature engineering to generate standardized feature vectors; The standardized feature vector is input into a pre-trained performance prediction model to obtain the predicted probability that the target JVM instance will experience a performance degradation event within a preset future time window. In response to the predicted probability exceeding a preset probability threshold, at least one candidate JVM parameter optimization scheme that satisfies the preset objective constraints is generated through a multi-objective constraint optimization algorithm. Select a target optimization scheme from the at least one candidate JVM parameter optimization schemes, and safely execute the target optimization scheme on the target JVM runtime instance.
[0081] In some preferred embodiments, the method further includes: After executing the target optimization scheme, the performance metrics of the target JVM instance are continuously monitored within a preset observation window. In response to the monitored performance indicators deteriorating to the point of exceeding the preset safety boundary, an automatic rollback operation is triggered to restore the JVM parameters of the target JVM instance to the state before the target optimization scheme was executed; The data and results of this optimization process are stored in a preset knowledge base to update the optimization strategy of the performance prediction model.
[0082] In some preferred embodiments, the collection of multimodal runtime metric data of the target JVM instance includes: Metrics for memory management, garbage collection, thread status, and class loading are collected via the JMX interface. Collect garbage collection pauses, object allocation rates, and lock contention events using a Java flight recorder; Collect garbage collection log files to obtain data on downtime distribution and collection efficiency; Collect the host operating system's CPU load, I / O wait time, and container resource limits.
[0083] In some preferred embodiments, generating at least one candidate JVM parameter optimization scheme that satisfies preset objective constraints through a multi-objective constraint optimization algorithm includes: The optimization objectives are at least two of the following: reducing service response latency, reducing total garbage collection downtime, increasing throughput, and reducing resource costs. The service level target threshold, the upper limit of JVM parameter change range, and the dependency relationship between JVM parameters are used as constraints. The Bayesian optimization algorithm is used to search within the feasible region defined by the constraints to generate the candidate JVM parameter optimization schemes.
[0084] In some preferred embodiments, safely executing the target optimization scheme on the target JVM runtime instance includes: Identify the adjustable class of the JVM parameters to be adjusted in the target optimization scheme, the adjustable class including runtime adjustable parameters and parameters that require a restart to take effect; For runtime adjustable parameters, they can be set online through the DiagnosticCommandMBean interface or the jcmd command provided by the JDK; For parameters that require a restart to take effect, configuration is performed through a preset rolling restart process.
[0085] In some preferred embodiments, the target optimization scheme employs a canary release method, wherein the canary release includes: The target optimization scheme is executed on a pre-selected set of target instances of the target JVM runtime instance. If the performance metrics of the target instance set are confirmed to be stable or improved within the preset observation window, the execution scope of the target optimization scheme will be gradually expanded to more instances. If a performance metric is detected to deteriorate at any stage of the grayscale release, a rollback operation on the modified instance will be immediately triggered.
[0086] In some preferred embodiments, the method further includes: The optimization cases in the knowledge base are analyzed using a large language model to generate a readable optimization report that includes the reasons for the changes, the expected impact, and risk warnings. Transferable rules are extracted from successful optimization cases and used to optimize the search strategy of the multi-objective constraint optimization algorithm.
[0087] In some preferred embodiments, before selecting a target optimization scheme from the at least one candidate JVM parameter optimization schemes, the method further includes: The interpretability of the candidate JVM parameter optimization schemes is analyzed using a large language model, and the tuning basis description text corresponding to the candidate JVM parameter optimization schemes is generated.
[0088] It should be understood that in the embodiments of this application, the processor 502 may be a central processing unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.
[0089] It will be understood by those skilled in the art that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program may be stored in a storage medium, which is a computer-readable storage medium. The computer program is executed by at least one processor in the computer system to implement the process steps of the embodiments of the above methods.
[0090] Therefore, the present invention also provides a storage medium. This storage medium can be a computer-readable storage medium. The storage medium stores a computer program. When executed by a processor, the computer program causes the processor to perform the following steps: Collect multimodal runtime metrics data of the target JVM instance; The multimodal performance index data is subjected to feature engineering to generate standardized feature vectors; The standardized feature vector is input into a pre-trained performance prediction model to obtain the predicted probability that the target JVM instance will experience a performance degradation event within a preset future time window. In response to the predicted probability exceeding a preset probability threshold, at least one candidate JVM parameter optimization scheme that satisfies the preset objective constraints is generated through a multi-objective constraint optimization algorithm. Select a target optimization scheme from the at least one candidate JVM parameter optimization schemes, and safely execute the target optimization scheme on the target JVM runtime instance.
[0091] In some preferred embodiments, the method further includes: After executing the target optimization scheme, the performance metrics of the target JVM instance are continuously monitored within a preset observation window. In response to the monitored performance indicators deteriorating to the point of exceeding the preset safety boundary, an automatic rollback operation is triggered to restore the JVM parameters of the target JVM instance to the state before the target optimization scheme was executed; The data and results of this optimization process are stored in a preset knowledge base to update the optimization strategy of the performance prediction model.
[0092] In some preferred embodiments, the collection of multimodal runtime metric data of the target JVM instance includes: Metrics for memory management, garbage collection, thread status, and class loading are collected via the JMX interface. Collect garbage collection pauses, object allocation rates, and lock contention events using a Java flight recorder; Collect garbage collection log files to obtain data on downtime distribution and collection efficiency; Collect the host operating system's CPU load, I / O wait time, and container resource limits.
[0093] In some preferred embodiments, generating at least one candidate JVM parameter optimization scheme that satisfies preset objective constraints through a multi-objective constraint optimization algorithm includes: The optimization objectives are at least two of the following: reducing service response latency, reducing total garbage collection downtime, increasing throughput, and reducing resource costs. The service level target threshold, the upper limit of JVM parameter change range, and the dependency relationship between JVM parameters are used as constraints. The Bayesian optimization algorithm is used to search within the feasible region defined by the constraints to generate the candidate JVM parameter optimization schemes.
[0094] In some preferred embodiments, safely executing the target optimization scheme on the target JVM runtime instance includes: Identify the adjustable class of the JVM parameters to be adjusted in the target optimization scheme, the adjustable class including runtime adjustable parameters and parameters that require a restart to take effect; For runtime adjustable parameters, they can be set online through the DiagnosticCommandMBean interface or the jcmd command provided by the JDK; For parameters that require a restart to take effect, configuration is performed through a preset rolling restart process.
[0095] In some preferred embodiments, the target optimization scheme employs a canary release method, wherein the canary release includes: The target optimization scheme is executed on a pre-selected set of target instances of the target JVM runtime instance. If the performance metrics of the target instance set are confirmed to be stable or improved within the preset observation window, the execution scope of the target optimization scheme will be gradually expanded to more instances. If a performance metric is detected to deteriorate at any stage of the grayscale release, a rollback operation on the modified instance will be immediately triggered.
[0096] In some preferred embodiments, the method further includes: The optimization cases in the knowledge base are analyzed using a large language model to generate a readable optimization report that includes the reasons for the changes, the expected impact, and risk warnings. Transferable rules are extracted from successful optimization cases and used to optimize the search strategy of the multi-objective constraint optimization algorithm.
[0097] In some preferred embodiments, before selecting a target optimization scheme from the at least one candidate JVM parameter optimization schemes, the method further includes: The interpretability of the candidate JVM parameter optimization schemes is analyzed using a large language model, and the tuning basis description text corresponding to the candidate JVM parameter optimization schemes is generated.
[0098] The storage medium is a physical, non-transient storage medium, such as a USB flash drive, external hard drive, read-only memory (ROM), magnetic disk, or optical disk, or any other physical storage medium capable of storing program code. The computer-readable storage medium can be non-volatile or volatile.
[0099] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0100] In the several embodiments provided by this invention, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For example, the division of each unit is merely a logical functional division, and there may be other division methods in actual implementation. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed.
[0101] The steps in the method of this invention can be adjusted, merged, or reduced in order according to actual needs. The units in the device of this invention can be merged, divided, or reduced according to actual needs. Furthermore, the functional units in the various embodiments of this invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0102] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, a terminal, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention.
[0103] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.
[0104] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Since these modifications and variations fall within the scope of the claims and their equivalents, this invention also intends to include these modifications and variations.
[0105] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and these modifications or substitutions should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A JVM intelligent predictive tuning method based on a large model, characterized in that, include: Collect multimodal runtime metrics data of the target JVM instance; The multimodal performance index data is subjected to feature engineering to generate standardized feature vectors; The standardized feature vector is input into a pre-trained performance prediction model to obtain the predicted probability that the target JVM instance will experience a performance degradation event within a preset future time window. In response to the predicted probability exceeding a preset probability threshold, at least one candidate JVM parameter optimization scheme that satisfies the preset objective constraints is generated through a multi-objective constraint optimization algorithm. Select a target optimization scheme from the at least one candidate JVM parameter optimization schemes, and safely execute the target optimization scheme on the target JVM runtime instance.
2. The JVM intelligent predictive tuning method based on a large model according to claim 1, characterized in that, The method further includes: After executing the target optimization scheme, the performance metrics of the target JVM instance are continuously monitored within a preset observation window. In response to the monitored performance indicators deteriorating to the point of exceeding the preset safety boundary, an automatic rollback operation is triggered to restore the JVM parameters of the target JVM instance to the state before the target optimization scheme was executed; The data and results of this optimization process are stored in a preset knowledge base to update the optimization strategy of the performance prediction model.
3. The JVM intelligent predictive tuning method based on a large model according to claim 1, characterized in that, The multimodal runtime metric data of the target JVM instance being collected includes: Metrics for memory management, garbage collection, thread status, and class loading are collected via the JMX interface. Collect garbage collection pauses, object allocation rates, and lock contention events using a Java flight recorder; Collect garbage collection log files to obtain data on downtime distribution and collection efficiency; Collect the host operating system's CPU load, I / O wait time, and container resource limits.
4. The JVM intelligent predictive tuning method based on a large model according to claim 1, characterized in that, The step of generating at least one candidate JVM parameter optimization scheme that satisfies preset objective constraints through a multi-objective constraint optimization algorithm includes: The optimization objectives are at least two of the following: reducing service response latency, reducing total garbage collection downtime, increasing throughput, and reducing resource costs. The service level target threshold, the upper limit of JVM parameter change range, and the dependency relationship between JVM parameters are used as constraints. The Bayesian optimization algorithm is used to search within the feasible region defined by the constraints to generate the candidate JVM parameter optimization schemes.
5. The JVM intelligent predictive tuning method based on a large model according to claim 1, characterized in that, Safely executing the target optimization scheme on the target JVM runtime instance includes: Identify the adjustable class of the JVM parameters to be adjusted in the target optimization scheme, the adjustable class including runtime adjustable parameters and parameters that require a restart to take effect; For runtime adjustable parameters, they can be set online through the DiagnosticCommandMBean interface or the jcmd command provided by the JDK; For parameters that require a restart to take effect, configuration is performed through a preset rolling restart process.
6. The JVM intelligent predictive tuning method based on a large model according to claim 1, characterized in that, The target optimization scheme adopts a canary release approach, which includes: The target optimization scheme is executed on a pre-selected set of target instances of the target JVM runtime instance. If the performance metrics of the target instance set are confirmed to be stable or improved within the preset observation window, the execution scope of the target optimization scheme will be gradually expanded to more instances. If a performance metric is detected to deteriorate at any stage of the grayscale release, a rollback operation on the modified instance will be immediately triggered.
7. The JVM intelligent predictive tuning method based on a large model according to claim 2, characterized in that, The method further includes: The optimization cases in the knowledge base are analyzed using a large language model to generate a readable optimization report that includes the reasons for the changes, the expected impact, and risk warnings. Transferable rules are extracted from successful optimization cases and used to optimize the search strategy of the multi-objective constraint optimization algorithm.
8. The JVM intelligent predictive tuning method based on a large model according to claim 1, characterized in that, Before selecting the target optimization scheme from the at least one candidate JVM parameter optimization scheme, the method further includes: The interpretability of the candidate JVM parameter optimization schemes is analyzed using a large language model, and the tuning basis description text corresponding to the candidate JVM parameter optimization schemes is generated.
9. A computer device, characterized in that, The computer device includes a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the method as described in any one of claims 1-8.
10. A computer-readable storage medium, characterized in that, The storage medium stores a computer program that, when executed by a processor, can implement the method as described in any one of claims 1-8.