I had a tough question during an interview today. They asked me how do I find the root cause of an out of memory error in my production code. I started talking about profilers. The interviewer pulled it to a different direction by saying how do I generate the traffic that's happening in production in order to benefit from the profiler. I didn't have a clue. Any information will be very helpful.
Profilers are not the best tool to chase memory leaks in production
The solution is to take a heap dump (using jmap for instance - JVM dependent) and analyze it using a tool like the excellent (and freely available) SAP Memory Analyzer (MAT)