maxMemory and outOfMemoryException
<p>I developed an App for android. My Problem is that the App crashes on a Huawei Honor 7 but works fine on Samsung Galaxy S3 mini, Galaxy S4, Galaxy S6, Nexus 4 and Nexus 5.</p>

<p>I set this line in the application tag in the manifest:</p>

<pre><code>android:largeHeap="true"
</code></pre>

<p>But this error is in the logcat of the Huawei:</p>

<pre><code>Throwing OutOfMemoryError "Failed to allocate a 31806012 byte allocation with 4194304 free bytes and 24MB until OOM"
</code></pre>

<p>I test the maxMemory on my S4 and on the Huawei and get this values:
Galaxy S4: 192MB
Huawei Honor 7: 256MB</p>

<p>To get the values, i use this code:</p>

<pre><code>    Runtime rt = Runtime.getRuntime();
    long maxMemory = rt.maxMemory();
    Log.v("onCreate", "maxMemory:" + Long.toString(maxMemory));
</code></pre>

<p>I wonder what this values mean. Because the error above says that there only are ca 4MB on the Device.</p>

<p>My 2 questions now are the following:</p>

<ol>
<li><p>What does the maxMemory stand for? And what does the ca 4MB from the error stand for?</p></li>
<li><p>How do Apps like Facebook view so many images? i can scroll and scroll and scroll and then there are 300 images load in the app. But in my app i only can show a few images until it crashes?</p></li>
</ol>

<p>Thank you!</p>