1
\$\begingroup\$

We are profiling a game app on Android 4.4.2 device via Unity’s ADB profiling.

We have set up ADB profiling following the official guide: http://docs.unity3d.com/Manual/Profiler.html

The ADB profiling works fine, when the app is running, Unity Profiler reports its memory usage as following:

Unity Profiler reported Memory usage

Used Total: 100.4 MB Unity: 40.5 MB Mono: 10.1 MB GfxDriver: 34.9 MB FMOD: 3.9 MB Profiler: 14.8 MB Reserved Total: 112.8MB Unity: 47.0 MB Mono: 15.4 MB GfxDriver: 34.9 MB Profiler: 15.5 MB

Meanwhile, we are also running another performance test tool (i.e. Emmagee, https://github.com/NetEase/Emmagee) to monitor the app, which can monitor CPU, memory, network traffic, battery current and etc. However, the memory usage of the app reported by Emmagee tool is much larger:

Emmagee tool reported Memory Info

As shown above, Unity Profiler reported 112.8M memory is totally reserved for running the app, but Emmagee tool reported >200M PSS memory is used. Obviously, more than 90M memory taking up is happened somewhere by something that Unity Profiler does not take into account.

(We also tried other performance monitoring tool for Android apps, e.g. APT, and the result is similar to what Emmagee reported. The extra memory usage problem remains.)

We noticed that the Unity Profiler itself would take up ~15M memory, which is included in the profiler’s report. Also, we knew that PSS memory includes proportional shared libraries with other processes, but 90M+ extra is such large amount considering that Unity Profiler only reported 112.8M totally.

Our puzzle remained: Where does the 90M+ memory come from? How are they used by the app? Why Unity Profiler does not report the extra memory? What can we do for reducing the extra memory and the total PSS memory of the running app, and/or get it close to what Unity Profiler reports?

Any help could be appreciated!

\$\endgroup\$
  • \$\begingroup\$ Did you figured this out at the end? \$\endgroup\$ – Tomer Peled Feb 7 '18 at 20:47
1
\$\begingroup\$

I have almost zero unity experience, but I have developed android games in other platforms, and I believe I know what is going on because I had a similar experience.

Probably it is video memory. Many mid to low end Android devices use RAM to allocate video memory. Uncompressed textures take up a lot of space.

|improve this answer|||||
\$\endgroup\$
  • \$\begingroup\$ Hi, Can you elaborate on this? Can we workaround this somehow? Is it possible that on some devices it sometimes use the RAM for this and sometimes the GPU? \$\endgroup\$ – Tomer Peled Feb 8 '18 at 8:29
  • \$\begingroup\$ I don't think it can worked around, this is dependant on the hardware. But in my case it was never an issue except in low spec devices with less than 1Gb RAM (Which I ended up excluding from compatibility) and a few Samsung models that had 1Gb RAM. Unfortunately I can't provide more insight into this. \$\endgroup\$ – DavidBVal Feb 8 '18 at 20:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.