So, I'm wondering: is this what is going to happen if I just keep appending to the JTextArea, and never take any steps to "throw away" old data? And if so, how do I get rid of the "old stuff" in the JTextArea?
This just seemed like fun. I created a simple JFrame that contained a JScrollPane and a JTextArea. In my class, I had the following method:
public void overflowMessage()
{
for(long l = 0L; l < 1000000; l++)
{
this.jTextArea1.append(
"This is log output " + l +
"which will be on the line " +
"specified right here: (ln: " +
jTextArea1.getLineCount() + ")\n"); if(l%10000 == 0){
System.out.println("At: " + l);
}
}
}It took under a minute to run, and used about 50MB of memory before finally dying with an OutOfMemoryError. I was able to break the 100,000 line limit before it died though.
Seems to me if you can archive or clear it or something every 25 or 50 thousand lines (depending on how large your message is) you should be fine.
Cory
_______________________________________________ Juglist mailing list [EMAIL PROTECTED] http://trijug.org/mailman/listinfo/juglist_trijug.org
