mlsanityData to 14 Oct 2026

The Hidden Environmental Cost of Poor Coding Practices in TensorFlow and Keras Applications: A Study on Resource Leaks and Carbon Emissions

arXiv 2606.19799 ↗First posted 18 Jun 2026cs.SE cs.LGcited by 0

Not on the map. Why?

Abstract (arXiv)

Efficiency and sustainability are critical considerations in the development and deployment of machine learning (ML) applications. Among the factors influencing sustainability, resource leaks in ML code can introduce hidden inefficiencies that elevate energy consumption and CO2 emissions. Despite this, empirical evidence quantifying their environmental impact remains limited. This emerging results paper presents an initial empirical investigation of two common resource-leak smells, namely Improper Model Reuse (IMR) and Unreleased Tensor References (UTR), and their impact on energy consumption and CO2 emissions in TensorFlow and Keras workloads. Controlled experiments were conducted for each smell by executing identical training tasks while comparing against a smell-free baseline. Our preliminary results show that both smells consistently increase estimated electricity usage and carbon emissions. IMR and UTR increased electricity consumption by approximately 32% and 46%, respectively, with proportional increases in CO2 emissions. Paired statistical tests indicate that these differences are systematic and statistically significant, providing initial empirical evidence that resource-leak smells may degrade ML energy efficiency and environmental sustainability. These findings suggest that resource-leak smells pose measurable risks to both software quality and sustainability, emphasizing the importance of integrating resource-lifecycle management and energy-efficiency considerations into ML development.

Key facts. No citing papers in the map yet (data through 14 Oct 2026). Builds on 4 of its 11 references that are in the map. First posted on arXiv 18 Jun 2026.

Builds on

4 of 11 references.

References · 4

  1. 2024Computing Within Limits: An Empirical Study of Energy Consumption in ML Training and Inferencecited by 4
  2. 2025Green MLOps to Green GenOps: An Empirical Study of Energy Consumption in Discriminative and Generative AI Operationscited by 2
  3. 2023Test Smell: A Parasitic Energy Consumer in Software Testingcited by 1
  4. 2025From Code Smells to Best Practices: Tackling Resource Leaks in PyTorch, TensorFlow, and Kerascited by 1

Built on by

Not cited yet.