Memory error while compiling Java 6.0

I know how to use -Xmx -Xms at runtime, is there a way to ask the compiler to allocate more bar. I have 2 gigs on my computer. I am not using IDE only text pane. I am trying to create a BigInteger with 10,000,000 digits and do operations on it. I tried to create a StringBuffer and provide a Capability (10000000) and it won't compile. Is there a class I can use to tell the compiler that I need more bar before compilation or at compile time? I've been reading about RunTime methods and am going to keep multiplying BigInteger and watch a bunch. I tried to insert a line into the code "1000000" + etc. 10,000,000 digits, which it won't compile either.

+2


source to share


1 answer


Runtime memory options for javac are not specified using the plain -X flag. Use the - J flag instead , as shown in the following example, where the load memory is reserved for 128M.

$javac -J-Xmx128M FooBar.java

      



The option, although non-standard, is available for both Solaris and Linux and Windows. Not sure about Mac.

+6


source







All Articles