1

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 Libraries and 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.

MHogge
  • 5,408
  • 15
  • 61
  • 104

1 Answers1

1

To reduce the dex code just use less libraries. Sometimes it is sufficient to attach only some parts of a framework. Check all your build.gradle files for unneeded inclusions.

.so libraries are native dynamically linked libraries, usually written in C or C++ which can be used in Android application, see NDK.

Anton Malyshev
  • 8,686
  • 2
  • 27
  • 45
  • 2
    is there any efficient way to investigate which exact libraries or app classes consume more dex code than others? – sandrstar Nov 21 '18 at 16:08