title: Java exception message length
body: <p>I am designing a database table, which will log Java exception messages.</p>
  
  <p>For this case (and also out of interest) I want to know the (max.) message sizes I will encounter.</p>
  
  <p>At the moment I am only interested in standard java language exceptions.</p>
  
  <ul>
  <li>Is there any technical limitation on the message size?</li>
  <li>What are the message lengths of the most common exceptions?</li>
  <li>What is the average message length of all standard java exceptions?</li>
  <li>Did the messages change a lot between different Java Versions?</li>
  </ul>
  
  <p>Example:</p>
  
  <pre><code>try {
    //Some code, which throws an Exception
  } catch(Exception ex) {
    String msg = ex.toString();    //Use toString, because sometimes there is no message
    int size = msg.length();       //How large can this be?
  }
  </code></pre>
  
  <p>Throwable toString() implementation:</p>
  
  <pre><code>  public String toString() {
      String var1 = this.getClass().getName();
      String var2 = this.getLocalizedMessage();
      return var2 != null ? var1 + ": " + var2 : var1;
    }
  </code></pre>
  
  <hr>
  
  <p>Thanks for the replies.
  Bonus question: Is there a list with all the java language exception messages (in English), so I do not have to check the source files manually?</p>