Is there anyway to set a breakpoint in eclipse or another debugger such that the execution stops on the construction of an array? I am particularly interested in the construction of a primitive array (int[]) but this question should be equally applicable to any array.
I need to find the culprit(s) creating large amount of garbage consisting of int[], char[] and byte[] among others, so if I can put a breakpoint with some conditions, I will be able to narrow the code down.
I tried using yourkit memory profiling, but it only shows allocations for only a tiny portion of these objects and the rest are shown as <objects without allocation information>
, I am not sure why. When I go into the Objects unreachable from GC roots
view, I see allocation information for only about 7% of the garbage. With allocations for such a small percentage of objects, I am not even sure if I am missing some locations. Is there a way to get YK to preserve all allocations?