What is the maximum amount of data that a String can hold in java?
<p>I know this may be a really noobish qustion to ask but I found no good reliable resource where I can get this info.</p>

<p>In an Android application, I'm trying to hold data in a String by just continuing to append it with more data  . And finally when the user closes the application or hits a "save button", I log it into a data .csv file. </p>

<p><strong>I want to know how much data can a simple String hold in java?</strong>, So that the app does not crash if the String datatype runs out of the memory allocated.
BTW I have tried to stress test my application, and it seems to run fine no matter how much data I store in one string.</p>

<p>Adit </p>
