Profiler-Guided Detection and Refactoring of Runtime Hotspots in Java Applications | IJCSE Volume 10 – Issue 4 | IJCSE-V10I4P11

IJCSE
International Journal of Computer Science Engineering Techniques
ISSN 2455-135X ¡ Peer-Reviewed ¡ Open Access
📚 Volume 10, Issue 4
📅 August 20, 2026
📄 Pages 87–94
🔖 ID: IJCSE-V10I4P11

Profiler-Guided Detection and Refactoring of Runtime Hotspots in Java Applications

Author(s)

Sumit Kumar, Jasvir Singh

Abstract

Runtime hotspots in Java applications are usually chased down by intuition rather than by measurement. This study profiles three applications chosen to represent three structurally different hotspot categories: a Sudoku backtracking solver that is algorithmic and CPU-bound, a headless Snake simulation that is allocation-bound, and an invoice generator dominated by string building and file input/output. JDK Flight Recorder is the only profiling instrument used, and each hotspot receives a refactoring matched to its category. Execution time is measured independently across ten iterations per configuration and improves significantly in every application, by 38.7 percent for the invoice generator, 52.1 percent for the solver and 67.4 percent for the simulation. Peak heap, allocation rate and garbage-collection pause time are drawn from a single aggregated recording per configuration, so they are presented as descriptive point estimates and carry no significance test, and CPU time is reported as a proxy equal to execution time because no independent instrumentation was implemented. The invoice generator improves on all five metrics and rests on the largest volume of underlying events. The other two applications each yield one result opposing the direction their refactoring targeted, which the present recording design cannot separate from sampling artefact. Every refactoring was validated against byte-identical output before measurement began. The work shows that a profiler-first workflow reliably identifies and removes hotspots, while also demonstrating how measurement design determines which performance claims a study can legitimately support.

Keywords

allocation reduction, garbage collection, JDK Flight Recorder, refactoring, runtime profiling

Conclusion

This paper tested a profiler-guided workflow built on JDK Flight Recorder across three Java applications representing different hotspot categories. All three refactorings were validated for functional equivalence, through byte-identical output under a fixed workload or seed, before any performance measurement was taken. Execution time, the only metric measured with independent per-iteration variance, improved significantly in every application, with gains between 38.7 and 67.4 percent. Peak heap, allocation rate and pause time were measured from a single aggregated recording per configuration and are reported as descriptive point estimates. Two of those point estimates ran counter to the direction the corresponding refactoring targeted, namely an increase in the solver’s peak heap and an increase in the simulation’s pause time, and the present design cannot establish whether either is a real effect or an artefact of a short recording containing very few events.

References

[1] Oracle Corporation, “Java Platform, Standard Edition Flight Recorder API Programmer’s Guide, Release 21,” Oracle Corporation, Redwood Shores, CA, USA, 2023. [Online]. Available: https://docs.oracle.com/en/java/javase/21/jfapi/
[2] VisualVM: All-in-One Java Troubleshooting Tool, 2023. [Online]. Available: https://visualvm.github.io/
[3] R. Pereira, M. Couto, F. Ribeiro, R. Rua, J. Cunha, J. P. Fernandes, and J. Saraiva, “Ranking Programming Languages by Energy Efficiency,” Science of Computer Programming, vol. 205, 2021, Art. no. 102609.
[4] C. Sahin, L. Pollock, and J. Clause, “How Do Code Refactorings Affect Energy Usage?,” Proceedings of the 8th ACM/IEEE International Symposium on Empirical Software Engineering and Measurement (ESEM), Torino, Italy, pp. 1-10, 2014.
[5] C. Sahin, M. Wan, P. Tornquist, R. McKenna, Z. Pearson, W. G. J. Halfond, and J. Clause, “How Does Code Obfuscation Impact Energy Usage?,” Journal of Software: Evolution and Process, vol. 28, no. 7, pp. 565-588, 2016.
[6] S. Dieckmann, and U. Hölzle, “A Study of the Allocation Behavior of the SPECjvm98 Java Benchmarks,” Proceedings of the 13th European Conference on Object-Oriented Programming (ECOOP), Lecture Notes in Computer Science, vol. 1628, Berlin, Germany: Springer, pp. 92-115, 1999.
[7] S. M. Blackburn, P. Cheng, and K. S. McKinley, “Myths and Realities: The Performance Impact of Garbage Collection,” Proceedings of the Joint International Conference on Measurement and Modeling of Computer Systems (SIGMETRICS/Performance), New York, NY, USA, pp. 25-36, 2004.
[8] D. Detlefs, C. Flood, S. Heller, and T. Printezis, “Garbage-First Garbage Collection,” Proceedings of the 4th International Symposium on Memory Management (ISMM), Vancouver, BC, Canada, pp. 37-48, 2004.
[9] P. Runeson, and M. Höst, “Guidelines for Conducting and Reporting Case Study Research in Software Engineering,” Empirical Software Engineering, vol. 14, no. 2, pp. 131-164, 2009.
[10] A. Georges, D. Buytaert, and L. Eeckhout, “Statistically Rigorous Java Performance Evaluation,” Proceedings of the 22nd Annual ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages and Applications (OOPSLA), Montreal, QC, Canada, pp. 57-76, 2007.
[11] T. Kalibera, and R. E. Jones, “Rigorous Benchmarking in Reasonable Time,” Proceedings of the 2013 International Symposium on Memory Management (ISMM), Seattle, WA, USA, pp. 63-74, 2013.
[12] T. Mytkowicz, A. Diwan, M. Hauswirth, and P. F. Sweeney, “Producing Wrong Data Without Doing Anything Obviously Wrong!,” Proceedings of the 14th International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS), Washington, DC, USA, pp. 265-276, 2009.
[13] C. Wohlin, P. Runeson, M. HĂśst, M. C. Ohlsson, B. Regnell, and A. WesslĂŠn, Experimentation in Software Engineering, Berlin, Germany: Springer, 2012.
[14] M. Fowler, Refactoring: Improving the Design of Existing Code, 2nd ed., Boston, MA, USA: Addison-Wesley, 2018.
[15] L. Cruz, and R. Abreu, “Catalog of Energy Patterns for Mobile Applications,” Empirical Software Engineering, vol. 24, no. 4, pp. 2209-2235, 2019.
[16] A. Noureddine, “PowerJoular and JoularJX: Multi-Platform Software Power Monitoring Tools,” Proceedings of the 18th International Conference on Intelligent Environments (IE), Biarritz, France, 2022.

📋 How to Cite This Paper

Sumit Kumar, Jasvir Singh (2026). Profiler-Guided Detection and Refactoring of Runtime Hotspots in Java Applications. International Journal of Computer Science Engineering Techniques, 10(4), 87–94. ISSN: 2455-135X. DOI: https://doi.org/10.5281/zenodo.22032312
Š 2026 International Journal of Computer Science Engineering Techniques (IJCSE). All rights reserved. ¡ ijcsejournal.org

Related Post

Submit Your Paper