JTextArea and OutOfMemory message

H

hystrio

Hi all!

A question about JTextArea behaviour.
If I read sequentially a big list of files and
append the lines on a JTextArea, after a while
I get a Memory error.
If I concatenate the list of text files in a single big file
and then read from it, there is no error, unless
the file is really huge. I got an error with a file
exceeding 5M.
Besides that, if I select a big text from the JTextArea
there is no way of copying it and paste.
Any idea why?
Are there memory limitations in the JTextArea?
Or is it a JVM problem?

Thank you all in advance
Orlando
 
J

John McGrath

A question about JTextArea behaviour.
If I read sequentially a big list of files and
append the lines on a JTextArea, after a while
I get a Memory error.
If I concatenate the list of text files in a single big file
and then read from it, there is no error, unless
the file is really huge. I got an error with a file
exceeding 5M.
Besides that, if I select a big text from the JTextArea
there is no way of copying it and paste.
Any idea why?
Are there memory limitations in the JTextArea?
Or is it a JVM problem?

It is pretty hard to tell what is wrong with the code, since you did not
post the code.

But I'll take a wild stab: Are you closing the files?

If that is not it, try posting a runnable example of the problem.
 
E

Esmond Pitt

hystrio said:
Any idea why?
Are there memory limitations in the JTextArea?
Or is it a JVM problem?

Well of course there are memory limitations. There are *always* memory
limitations.

More importantly, why on earth would you want the contents of multiple
files in a single JTextArea? What is the purpose?

I think you need to redesign your GUI.
 
H

hystrio

Esmond Pitt said:
Well of course there are memory limitations. There are *always* memory
limitations.

More importantly, why on earth would you want the contents of multiple
files in a single JTextArea? What is the purpose?

Processing a huge mailing list to sort the subjects.

Bye

Orlando
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,200
Latest member
LaraHunley

Latest Threads

Top