Create a test that mimicks normal interaction with your program, and run it in an infinite loop, while monitoring memory growth before/after important function calls.
Perform a code review. | [reply] |
Some apache child processes grow to a value around 350MB. The more time goes by, the more childs reach this value.
They grow to 350MB and then stop growing?
That sounds like an inefficient algorithm, not a memory leak.
Memory leaks grow to infinity, whereas an algorithm that needs 350MB will use it, and be able to reuse it later without grabbing more. Of course, each child that hits that algorithm will need its own chunk of 350MB.
Making the algorithm more space-efficient is the way to go here. Don't let it slurp huge files, make it read line by line.
| [reply] |
You're right, it's no memory leak, but I still have no clue how to get a hint where the memory is eaten up :-(
| [reply] |