Predicting CPU and Memory Usage in Code Execution Using Machine Learning Models
Efficient management of CPU time and memory usage is essential in software development for optimizing performance and resource allocation. This paper focuses on using the XGBoost model to predict these metrics, comparing its performance with Decision Tree, GBDT, and LightGBM. The dataset, sourced from Project CodeNet, was preprocessed to handle missing data and scale features. We evaluated each model's performance with and without hyperparameter tuning. Results indicate that XGBoost outperformed other models in terms of MAE and <tex xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">$R^{2}$</tex> values for both CPU time and memory consumption predictions. While the Decision Tree model showed improvement, especially in CPU time prediction after tuning, and GBDT performed reasonably well, neither matched the predictive power of XGBoost. LightGBM, on the other hand, showed weaker performance across tasks. Our findings highlight the importance of hyperparameter tuning for performance enhancement. Future work could explore advanced feature engineering, deep learning methods, and ensemble strategies. Testing these models on other datasets could also validate their generalizability, with more interpretable models offering valuable insights from the predictions.
Authors
- X. Zhu (ORCID: https://orcid.org/0000-0002-9573-4570)
- Yi Yang
Institutions
- Lancaster University (GB)
- Lanzhou University (CN)
Publication Details
- Published
- 2024-12-27
- DOI
- https://doi.org/10.1109/auteee62881.2024.10869647
- Primary Topic
- Parallel Computing and Optimization Techniques
- Type
- article
- Field-Weighted Citation Impact
- 0.00