Skip to Main Content
Talk Intermediate

When malloc() Lies: Building a Lightweight Memory Debugger for Embedded Systems

Proposal status is Rejected
Session Description

Memory leaks and heap corruption are among the most difficult bugs to debug in embedded and RTOS-based systems. Limited memory, long-running applications, and the lack of advanced debugging tools often make these issues hard to reproduce and even harder to fix.

In this session, I'll share how I built a lightweight memory debugging tool to trace every "malloc()" and "free()" call in an embedded application. The talk will cover the design of the tracing mechanism, how allocation metadata was captured, and how the tool helped identify memory leaks, invalid frees, and heap corruption during development.

Along the way, I'll discuss the trade-offs involved in building a low-overhead debugging solution, techniques for minimizing runtime impact, and practical lessons learned from debugging real-world memory issues.

The session will include a live demonstration of the memory tracer in action, showing how allocation history can be used to quickly locate leaks and understand heap behavior. While the examples focus on embedded software, the concepts are equally applicable to Linux and other systems programming environments.

Key Takeaways

- Understand why memory leaks and heap corruption are particularly difficult to debug in embedded systems.

- Learn how a lightweight memory tracing tool can be built by intercepting "malloc()" and "free()".

- See practical techniques for tracking allocations and identifying common memory bugs.

- Understand the trade-offs between debugging capability and runtime overhead.

- Learn approaches that can be adapted to RTOS, embedded Linux, or other systems software projects.

References

Session Categories

Contributing to FOSS

Which track are you applying for?

Real Time Operating Systems (RTOS)

Speakers

Partha Sarthy
Partha Sarthy Software Engineer Expert | Applied Materials

I'm a software engineer with over eight years of experience in systems software and networking. I've worked at HPE, Juniper Networks, Cisco and Applied Materials, building software for networking and high-performance computing environments. My interests lie at the intersection of distributed systems, AI infrastructure, high-performance computing, and compiler technologies.

I enjoy building practical systems that solve real engineering problems and learning by implementing new technologies from the ground up. Recently, I've been been exploring the Model Context Protocol (MCP) to build AI-enabled applications, and I'm excited to share the engineering lessons I learned along the way.