Amazon Interview Question
Software Engineer / DevelopersCountry: India
Interview Type: In-Person
Valgrind can help on smaller programs. Not always feasible on large programs. You can overload malloc() and new() to get when memory is created, and delete()/free() for when memory is deallocated.
Log the data, and correlate it to your application logs (you do have those, right?) to verify when stuff is happening. Match them up to make sure what's going on.
Is your program threaded? Try and disable threading. Did it just appear? Look at recent code additions. Isolate the "bad code" as much as you can, to reduce what you are looking at.
Also useful, is running it using strace, which will also give you system calls you can dive into to check out what is happening. It can be a very tedious thing to do, but these are the basic approaches to do so.
What exactly is Linux program means here..??
- prateek April 08, 2014we have a tool Valgrind to detect memory leak check