anchor.diff:          JBP_CONFIG_OPEN_JDK_JRE: '[memory_calculator: {memory_sizes: {native: 150m}}]'
       ```
   
  -    In the example above, `150m` of the overall available `1G` are reserved for anything that is not `heap`, `metaspace` or `permgen`. In less common cases, this may come from companion processes started by the JVM, such as the [Process API](https://docs.oracle.com/javase/8/docs/api/java/lang/Process.html).
  -
  -* **Cause 2 - High thread count**: Java threads in the JVM can cause memory errors at the Garden level. In high load scenarios, an app uses a high number of threads, which consumes a significant amount of memory.
  -
  -* **Solution 2**: Correct the reserved memory for stack traces considering the maximum amount of threads.
  -
  -    The [`stack` setting](https://github.com/cloudfoundry/java-buildpack/blob/master/docs/jre-open_jdk_jre.md#memory-sizes) of the memory calculator configures how much space the JVM reserves for each Java thread. You must multiply this value by how many threads your app requires. You can specify the amount of threads in the [`stack_threads` setting](https://github.com/jdeoliveira/mule-cf-java-buildpack/blob/master/docs/jre-open_jdk_jre.md#memory) of the memory calculator.
  -    For example, if the estimated max thread count for an app is `800` and the amount of memory to represent the deepest stacktrace of a Java thread is `512KB`, you can configure the memory calculator with:
  +    In this example, `150m` of the overall available `1G` are reserved for anything that is not `heap`, `metaspace`, or `permgen`. In less common cases, this may come from companion processes started by the JVM, such as the [Process API](https://docs.oracle.com/javase/8/docs/api/java/lang/Process.html).
  +
  +* **Cause 2 - High thread count**: Java threads in the JVM can cause memory errors at the Garden level. When an app is under a heavy load, it uses a high number of threads and consumes a significant amount of memory.
  +
  +* **Solution 2**: Set the reserved memory for stack traces to the correct value for your app.
  +
  +    You can use the `stack` [setting](https://github.com/cloudfoundry/java-buildpack/blob/master/docs/jre-open_jdk_jre.md#memory-sizes) of the memory calculator to configure the amount of space the JVM reserves for each Java thread. You must multiply this value by how many threads your app requires. You can specify the amount of threads in the `stack_threads` [setting](https://github.com/jdeoliveira/mule-cf-java-buildpack/blob/master/docs/jre-open_jdk_jre.md#memory) of the memory calculator.
  +    For example, if the estimated max thread count for an app is `800` and the amount of memory to represent the deepest stacktrace of a Java thread is `512KB`, you can configure the memory calculator as follows:
   
       ```
       ---
  
positive.code: 
  ### <a id='memory-troubleshoot'></a>Troubleshoot Out Of Memory ###
  
  A Java app may crash because of insufficient memory on the Garden container or the JVM. See the following sections for help diagnosing the issue.
  
  #### JVM 
  
  * **Error**: `java.lang.OutOfMemoryError`. See the following example.
      <pre class="terminal">
      $ cf logs APP-NAME --recent
      2016-06-20T09:18:51.00+0100 [APP/0] OUT java.lang.OutOfMemoryError: Metaspace   
      </pre>
  * **Cause**: If the JVM cannot garbage-collect enough space to ensure the allocation of a data-structure, it fails with [java.lang.OutOfMemoryError](https://docs.oracle.com/javase/8/docs/api/java/lang/OutOfMemoryError.html). In the example above, JVM has an under-sized `metaspace`. You may see failures in other memory pools, such as `heap`.
  * **Solution**: Correct the configurations of the JVM. See [Allocate Sufficient Memory](#memory).
  
  #### Garden Container
  
  * **Error**: The Garden container terminates the Java process with the `out of memory` event. See the following example:
      <pre class="terminal">
  
negative.code: 
      This error appears when the JVM allocates more OS-level memory than the quota requested by the app, such as [through the manifest](https://docs.cloudfoundry.org/devguide/deploy-apps/manifest.html#memory).
  
  * **Cause 1 - Insufficient native memory**: This error commonly means that the JVM requires more `native` memory. In the scope of the Java buildpack and the memory calculator, the term `native` means the memory required for the JVM to work, along with forms of memory not covered in the other classifications of the memory calculator. This includes the memory footprint of OS-level threads, [direct NIO buffers](https://docs.oracle.com/javase/8/docs/api/java/nio/ByteBuffer.html), code cache, program counters, and more.
  
  * **Solution 1**: Determine how much `native` memory a Java app needs by [measuring it](https://docs.oracle.com/javase/8/docs/technotes/guides/troubleshoot/tooldescr007.html) with realistic workloads and fine-tuning it accordingly.
  You can then configure the Java buildpack using the `native` [setting](https://github.com/cloudfoundry/java-buildpack/blob/master/docs/jre-open_jdk_jre.md#memory-sizes) of the memory calculator, as in the example below:
  
      ```
      ---
  