Android Garbage Collector Slow Down
<p>I'm a semi experienced programmer, just not so much within java. To help learn Java/Android I started working on a world builder application, something that takes 2-7 characters and finds all common words out of that. Currently I have about 10,000 words split between 26 .txt files that are loaded based on what characters are inputted from the user. Together it's ~10kb of data.</p>

<p>The logic was the easy part but now, the GC seems to be slowing everything down and I'm struggling to find ways to optimize due to my lack of Java experience. Here is the code below that I'm almost postitive the GC is constantly running on. I'd like to point out with 2-4 characters the code below runs pretty quickly. Anything larger than that gets really slow.</p>

<pre><code>public void readFile() throws IOException, NotFoundException
{       
    String dictionaryLine = new String(); //Current string from the .txt file
    String currentString =  new String(); //Current scrambled string
    String comboStr =  new String();      //Current combo string

    int inputLength = myText.getText().length(); // lenth of the user input

    //Loop through every "letter" dictionary
    for(int z = 0; z &lt; neededFiles.length - 1; z++)
    {
        if(neededFiles[z] == null)              
            break;

        InputStream input = neededFiles[z];
        InputStreamReader inputReader = new InputStreamReader(input);
        BufferedReader reader = new BufferedReader(inputReader, inputLength);

        //Loop through every line in the dictionary
        while((dictionaryLine = reader.readLine()) != null)
        {   
            Log.i(TAG, "dictionary: " + dictionaryLine);

            //For every scrambled string...
            for(int i = 0; i &lt; scrambled.size(); i++)
            {

                currentString = scrambled.get(i).toString();

                //Generate all possible combos from the scrambled string and populate 'combos'
                generate(currentString);

                //...lets find every possible combo from that current scramble
                for(int j = 0; j &lt; combos.size(); j++)
                {
                    try 
                    {  
                        comboStr = combos.get(j).toString();

                        //If the input length is less than the current line, don't even compare
                        if(comboStr.length() &lt; dictionaryLine.length() || comboStr.length() &gt; dictionaryLine.length())
                            break;

                        //Add our match
                        if(dictionaryLine.equalsIgnoreCase(comboStr))
                        {
                            output.add(comboStr);
                            break;
                        }
                    }
                    catch(Exception error)
                    {
                        Log.d(TAG, error.getMessage());
                    }
                }
                combos.clear();
            }
        }           
    }
}
</code></pre>

<p>To help clarify this code generates many, many lines of the following:</p>

<pre><code>GC_FOR_MALLOC freed 14000 objects / 510000 byes in 100ms
</code></pre>

<p>I appreciate any help you can give, even if it's just Java best practices.</p>
