java.lang.OutOfMemoryError: Java heap space error with bigger number combinations. For example, if I calculate permuations out of 18 numbers I get this exception: Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space