I am trying to change the max memory size "heap" for Java on Mac OS X. I have read many places to change "-XX:MaxPermSize", but I can't find the file and don't know where to change that setting.
Open a terminal window. Review the command output. The argument beginning with "-Xmx" will give you the value of the current Java heap space. In the example above, the value is 1024 MB, or 1 GB.
The theoretical limit is 2^64 bytes, which is 16 exabytes (1 exabyte = 1024 petabytes, 1 petabyte = 1024 terabytes). However, most OS's can't handle that. For instance, Linux can only support 64 terabytes of data. Note: We don't recommend you exceed 2 GB of in use JVM heap.
you can set the memory available to the java VM using this parameters:
-Xms64m -Xmx200m
-Xms specifies the minimum memory; -Xmx the maximum one.
You have to specify them when you run your app. For example, if you a jar named app.jar, you can run it typing
java -Xms64m -Xmx512m -jar app.jar
I think that on a 32 bit machine you can't give the JVM more than 1Gb.
I was using the WEKA and I got the same problem. Here, I found the solution, and it was easy.
Go to Application==> Left click on specific application (like Weka)==> Show Package Content==> Contents==>Info.Plist==>Java==> VMOptions==> increase the size of memory as you want (in my mac the default was 1 Gb, I increased to 6 Gb)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With