Android Memory Leak Detection - Monitor, Detect, and Report Leaks with Appxiom SDK
Appxiom SDK provides automatic memory leak detection and reporting for Android applications. This feature is enabled by default in both debug and release builds, ensuring your app is monitored for leaks in all environments.
Automatic Detection: This feature is automatically activated for both debug and release builds.
How Memory Leak Detection Works
- With basic integration, Appxiom SDK will automatically detect and report memory leaks in Activities and Fragments.
- For Service classes, add
Ax.watchLeaks(this)in theonDestroy()method to enable leak detection for services. - All detected leaks are reported to the Appxiom dashboard for analysis and resolution.
If you have not completed the basic integration, see the How To Integrate section.
Enabling Memory Leak Detection in Service Classes
- Java
- Kotlin
public class ContactsParserService extends IntentService {
@Override
public void onDestroy() {
super.onDestroy();
Ax.watchLeaks(ContactsParserService.this);
}
}
class ContactsParserService : IntentService() {
override fun onDestroy() {
super.onDestroy()
Ax.watchLeaks(this)
}
}
Appxiom SDK Flavours and Leak Detection
- AppxiomDebug: Detects detailed object-level memory leaks in debug builds. All detected leaks are reported to the Appxiom dashboard.
- AppxiomCore: In release builds, reports memory leaks with the name of the leaking activity or service. All leaks are immediately reported to the dashboard.
Frequently Asked Questions (FAQ)
Q: Is memory leak detection enabled by default in Appxiom SDK?
A: Yes, memory leak detection is automatically activated in both debug and release builds. A single line API is to be added for tracking leaks in Service classes.
Q: How do I enable memory leak detection for Service classes?
A: Add Ax.watchLeaks(this) in the onDestroy() method of your Service class to enable leak monitoring for services.
Q: Where are memory leak reports visible?
A: All detected leaks are reported to the Appxiom dashboard for review and analysis.
Q: What is the difference between AppxiomCore and AppxiomDebug for leak detection?
A: AppxiomDebug provides detailed object-level leak detection in debug builds, while AppxiomCore reports leaks in release builds with the leaking component's name.
Q: Does Appxiom memory leak detection impact app performance?
A: Appxiom SDK is designed to have minimal impact on app performance while providing comprehensive leak monitoring.
Q: Is memory leak detection available in both debug and release builds?
A: Yes, leak detection is active in both build types, but the level of detail in reports may differ.
Q: Can I disable memory leak detection for specific components?
A: No. This feature is automatically enabled for Activities and Fragments. For Services, simply do not call Ax.watchLeaks(this) if you do not want leak monitoring in Service classes.
Q: Does Appxiom SDK collect any sensitive data during leak detection?
A: No, Appxiom SDK only collects technical information relevant to memory leaks and does not collect personally identifiable information by default.