Source code leaking or hogging resources is a nightmare for any organization and developers alike. Be it an application which crashes randomly due to unusually high memory consumption or any software which hogs CPU and starves other applications to death, these are perfect recipes for disaster for any organization.
Poorly written working code can often be far worse than non-functional code as it can lead to catastrophic side effects. It is a double-edged sword as it not only eats up system resources and hampers its performance, at the same time it adds up an entry in terms of cost for problem determination, defect resolution, research, operational and support costs.
How costly is leaking code?
The problem with poorly written leaking code is that the later you discover it, the harder it hits your organization. While memory leaks and CPU-hogs do not classify as functional defects, these performance defects are as critical as the functionality of any application. Therefore, it’s fair to classify leaking code as being equivalent to a performance defect.
The following white paper on ‘Minimizing code defects to improve software quality and lower development costs’ by IBM Software Group suggests that the cost of fixing defects (including performance issues) increases exponentially at each stage of SDLC and therefore, it’s absolutely critical that such issues are highlighted and fixed sooner than later.
It’s mind-boggling to note that a memory leak discovered after your application has turned live can cost as much as 30 times more than what it would have in the design phase.
When it comes to fixing leaking code, it’s clearly the case of ‘The earlier, the better’ or else the development cost shoots up big time. Imagine, a real time application being deployed as part of a mission-critical system and crashing due to memory leaks just when it was processing sensitive information, it is a scary prospect indeed. A few missing lines of code eating up your company’s revenues – strange as it may seem, but that’s not a distant possibility when it comes to poorly written code.
What are memory leaks & how do they impact you?
As the name suggests, memory leaks refers to memory allocations in source code that do not get freed even though they are no longer required. Though many programming languages such Java have automatic garbage collection, however they do not guarantee that source code will be free of memory leaks. While a program with minor memory leaks may get away without any dire consequences, major leaks can crash the application or even the whole system due to out of memory errors.
A poorly written piece of code can lead to fatal consequences in terms of a system’s overall utilization – no matter if the development language supports automatic garbage collection or not. Further, even in languages which offer automatic garbage collection, memory leaks prolong the execution of Garbage Collector, thereby loading the CPU rather un-necessarily for extended periods of time. Since the CPU is busy freeing up the poorly allocated memory, the application performance slows down, thereby leading to lower transactions and reduced throughput.
It’s not just about the money
If memory leaks and performance issues were only monetary concerns, some companies would learn to live with it and fix them as they discover it without losing sleep over the costs. However, the implications of leaking code are actually far worse than financial losses – your organization’s image and reputation is at stake.
Losing customers is easy; getting them back is a mountainous task.
Time & Resources Trade-off
Many companies defer the decision to improve performance of their applications either because they do not have the required expertise to do so or the in-house resources are just too loaded with other tasks to clean the code up. All companies claim to be suffering from resource crunch in some way or the other and Murphy’s Law stating “When you find a bug in a developer’s code, the developer would either be in a different project or a different company” holds true.
If you pull out the original developer from his new project, it has a cascading effect and the new project suffers. In most cases, it’s far from the ideal solution.
Seek Expert Help
Code optimization and performance tuning are complex activities which require skilled expertise. Even if you have in-house development resources (people as well as tools), there’s no guarantee of producing leak-free code. And since the stakes are high, you shouldn’t really be taking any chances.
And since the stakes are high, you shouldn’t really be taking any chances. Opt for the services of a specialist performance optimization company like ours and we’ll fix your code. With a team of best in class software experts and sophisticated tools, our services come at the fraction of a price as compared to the mounting costs of leaking code.
Conclusion
When it comes to leaking code, being ‘pro-active’ is far better than being ‘reactive’. The choice, as always is yours – either learn things the hard and costly way or be proactive and choose an optimization partner like us sooner than later!
If you enjoyed this post, make sure you subscribe to my RSS feed!


Comments