
Find Memory Leaks With Valgrind Memcheck
Run a C program under Valgrind Memcheck with --leak-check=full to find memory that was allocated and never freed, and read the report down to the source line.
Tag
362 posts

Run a C program under Valgrind Memcheck with --leak-check=full to find memory that was allocated and never freed, and read the report down to the source line.

Reserve 1 GiB huge pages at boot on Linux with the hugepagesz=1G and hugepages= kernel parameters, check the pdpe1gb flag, and verify the pool in /proc/meminfo.

Use per-board .overlay and .conf files in a boards folder so one Zephyr application builds for several boards, with the naming rules for Zephyr 4.2.

errno is a per-thread integer that C library and system calls set on failure. Learn when it is valid and how to read it correctly with glibc 2.41.

A complete guide to Linux kernel modules: lifecycle, build, load, parameters, exported symbols, a working misc device, licensing, signing, DKMS and debugging.

Choose between TCP and UDP for systems code by weighing reliability, ordering, latency and framing, with a decision table and the cost of each option.

Pin a process and its memory to one NUMA node with numactl --cpunodebind and --membind, compare it with --interleave and --preferred, and verify placement.

Pin Zephyr and its modules with a west.yml manifest so every build of your application uses the same revisions. Covers import, allowlists and updates.

A beginner guide to Linux kernel development: how the kernel works, a safe lab, reading source, kernel C, a first module, debugging and a first patch.

Build a default-deny seccomp allow-list in C with libseccomp, add an argument rule that limits write to one file descriptor, and inspect the generated BPF.

Use C99 designated initializers to set struct fields and array slots by name, zero the rest and avoid uninitialized reads. Includes flags and pitfalls.

Resolve hostnames in C with getaddrinfo, walk the result list, connect to the first address that works, and free it with freeaddrinfo on Linux.