The Artima Developer Community
Sponsored Link

Java Answers Forum
Opening Large files(3MB) in a text editor.

1 reply on 1 page. Most recent reply: Mar 15, 2002 12:53 PM by Charles Bell

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
Roopali

Posts: 1
Nickname: roopali
Registered: Mar, 2002

Opening Large files(3MB) in a text editor. Posted: Mar 14, 2002 9:35 PM
Reply to this message Reply
Advertisement
Hi friends,

I am builing a text Editor which should be capable of handling large files upto 3MB.
I am using JTextArea for displaying the contents of the file.
I have tried various ways but landed up in OutOfMemoryError Exception.
I will be glad if i get some help reagrding this.
Thanks for the help.

Roopali


Charles Bell

Posts: 519
Nickname: charles
Registered: Feb, 2002

Re: Opening Large files(3MB) in a text editor. Posted: Mar 15, 2002 12:53 PM
Reply to this message Reply
Suggest you use one of the -X options with java

such as:

java -Xms64m YourProgramName


c:\j2sdk1.4.0\projects>java -X
-Xmixed mixed mode execution (default)
-Xint interpreted mode execution only
-Xbootclasspath:<directories and zip/jar files separated by ;>
set search path for bootstrap classes and resources
-Xbootclasspath/a:<directories and zip/jar files separated by ;>
append to end of bootstrap class path
-Xbootclasspath/p:<directories and zip/jar files separated by ;>
prepend in front of bootstrap class path
-Xnoclassgc disable class garbage collection
-Xincgc enable incremental garbage collection
-Xloggc:<file> log GC status to a file with time stamps
-Xbatch disable background compilation
-Xms<size> set initial Java heap size
-Xmx<size> set maximum Java heap size
-Xss<size> set java thread stack size
-Xprof output cpu profiling data
-Xrunhprof[:help]|[:<option>=<value>, ...]
perform JVMPI heap, cpu, or monitor profiling
-Xdebug enable remote debugging
-Xfuture enable strictest checks, anticipating future default
-Xrs reduce use of OS signals by Java/VM (see documentation)
-Xcheck:jni perform additional checks for JNI functions

The -X options are non-standard and subject to change without notice.

Flat View: This topic has 1 reply on 1 page
Topic: Java Programming Previous Topic   Next Topic Topic: Printing Text

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use