I'm monitoring the memory usage of my Android application through the Android Profiler and I see that my app is using more than 30MB of RAM for the code. But I don't have a clue on how to reduce the memory used by this code.
Quoting the android documentation:
Code: Memory that your app uses for code and resources, such as dex bytecode, optimized or compiled dex code, .so libraries, and fonts.
- How could we reduce the
dex codeof the application? - What are
.so Librariesand what could I do to reduce the impact of such libraries? - Is their anything else I could do to reduce this memory usage?
Thank's.
To reduce
the dex codejust use less libraries. Sometimes it is sufficient to attach only some parts of a framework. Check all yourbuild.gradlefiles for unneeded inclusions..so librariesare native dynamically linked libraries, usually written in C or C++ which can be used in Android application, see NDK.