How to find out why application eats that much memory?
• Run profiling-enabled application.
• Connect to application. DO NOT record allocations as they are not needed to solve this task.
• Capture memory snapshot. To identify the moment when to capture the snapshot, use Telemetry to see when and how the used memory grows. Also, a snapshot can be captured automatically on low memory and/or on out of memory.
• Open the snapshot and use the Statistics section in the “All Objects” view.
Memory leak is an existence of objects that are not needed anymore according to the application logic, but still retain memory and cannot be collected because they are referenced from other live objects, due to a bug in application itself.
You can suspect the presence of memory leaks with the help of Telemetry, by watching how used memory grows in the “Memory” tab. You can use “Force Garbage Collection” to see whether some of the objects that consume the memory can be collected, thus decreasing used memory. If after those explicit garbage collections the used memory remains on the same level or decreases insignificantly, this possibly means you have a leak. (“Possibly,” because it can turn out not to be a leak, but simply high memory consumption)
Also consider the “capture snapshot on low memory” feature in YJP tool. Snapshots captured automatically using this feature may possibly be captured in the state when memory usage reaches the specified threshold because of memory leaks. Thus, the snapshots will provide information sufficient to discover and fix the leaks.