Jedit still going strong – increase heap size

I still use jedit for all my tasks that require a text editor. I’ve been using it for about 4 years now and rarely find fault with it. One thing I did notice was that it slowed down quite alot if I was editing or searching large files. I knew this was down to Java and the JVM. I was not aware that you could increase the Java Heap Size which means you can increase the memory accessible by the JVM. The flag Xms is the initial heap size and Xmx is the Max heap size allowed (the default is 64m).

“C:\Program Files\Java\jdk1.6.0_04\bin\javaw.exe” -Xms256m -Xmx768m -jar “C:\Program Files\jEdit\jedit.jar”

starts Jedit with an initial heap size of 256 MB and a max heap size of 768 MB which essentially means it can handle any size file I throw at it. (Source – http://javahowto.blogspot.com/2006/06/6-common-errors-in-setting-java-heap.html).

Another option (specific to Jedit) I found was the “reuseview” flag. This forces the file to be opened in an existing instance of Jedit rather than starting a new one.

“C:\Program Files\Java\jdk1.6.0_04\bin\javaw.exe” -Xms256m -Xmx768m -jar “C:\Program Files\jEdit\jedit.jar” -reuseview “F:\Working\kf182\Databases\xml\data\Products\9826.xml”

Opens 9826.xml in an existing instance of Jedit.