title: How to fix Error "JNI ERROR (app bug): global reference table overflow (max=65535)"
body: <p>My app crashes (very rarely) and reports this error:</p>
  
  <pre><code> "JNI ERROR (app bug): global reference table overflow (max=65535)"
  03-04 14:22:05.974: A/art(15796): sart/runtime/indirect_reference_table.cc:109] JNI ERROR (app bug): global reference table overflow (max=65535)
  03-04 14:22:05.974: A/art(15796): sart/runtime/indirect_reference_table.cc:109] global reference table dump:
  03-04 14:22:05.974: A/art(15796): sart/runtime/indirect_reference_table.cc:109]   Last 10 entries (of 65533):
  03-04 14:22:05.974: A/art(15796): sart/runtime/indirect_reference_table.cc:109]     65532: 0x134039c0 java.lang.String "cocalac"
  03-04 14:22:05.974: A/art(15796): sart/runtime/indirect_reference_table.cc:109]     65531: 0x76dd9200 android.graphics.Typeface
  03-04 14:22:05.974: A/art(15796): sart/runtime/indirect_reference_table.cc:109]     65530: 0x13403940 java.lang.String " "
  03-04 14:22:05.974: A/art(15796): sart/runtime/indirect_reference_table.cc:109]     65529: 0x13403860 java.lang.String "sans-serif-light"
  03-04 14:22:05.974: A/art(15796): sart/runtime/indirect_reference_table.cc:109]     65528: 0x1328c940 android.graphics.Paint
  03-04 14:22:05.974: A/art(15796): sart/runtime/indirect_reference_table.cc:109]     65527: 0x13403840 java.lang.String "sans-serif-light"
  03-04 14:22:05.974: A/art(15796): sart/runtime/indirect_reference_table.cc:109]     65526: 0x134038a0 java.lang.String "sans-serif-light"
  03-04 14:22:05.974: A/art(15796): sart/runtime/indirect_reference_table.cc:109]     65525: 0x134038c0 java.lang.String "#todo"
  03-04 14:22:05.974: A/art(15796): sart/runtime/indirect_reference_table.cc:109]     65524: 0x13403940 java.lang.String " "
  03-04 14:22:05.974: A/art(15796): sart/runtime/indirect_reference_table.cc:109]     65523: 0x134038e0 java.lang.String "... more[+]"
  </code></pre>
  
  <p>What causes this error and how to fix it?</p>