Increase heap size in java for weka

后端 未结 17 1311
天命终不由人
天命终不由人 2020-12-14 08:27

I\'m trying to increase the heap size in java for weka which keeps crashing. I used the suggested line:

> java -Xmx500m -classpath

but

相关标签:
17条回答
  • 2020-12-14 09:19

    Weka 3.9.2 also does not has the option of maxheap anymore. RunWeka.ini have the option of javaOpts, So you may change the below to your required memory allocation,

    javaOpts=%JAVA_OPTS%   ---- > javaOpts= -Xmx1024m
    

    Here 1024m is the customised amount of memory you want to allocate.

    0 讨论(0)
  • 2020-12-14 09:25

    You need to specify a classpath after -classpath, similar to the PATH env variable you need to specify the path where Java can find the classes.

    The -Xmx500m setting looks fine, except that I would suggest to use 512m.

    0 讨论(0)
  • 2020-12-14 09:27

    For Mac OS, you have to edit a configuration file in order to increase the heap size of the Weka UI application.

    I am repeating what I wrote in: Is there a workaround to solve "Java heap space" memory error when the max heap value has been already specified?

    1. Quit out of Weka if it is running.

    2. cd into /Applications/weka-XXX.app/Contents , or wherever your weka executable was installed. There will be a file called Info.plist there. It is an XML text file. I suggest you save a copy of it to another location, as you'll need to edit it in the next step.

    3. Open the Info.plist (XML) file in your favorite text editor and look for a block that says "VMOptions". There should be a value that says "-Xmx256M" or something similar that specifies the maximum heap size. You should change that value to something bigger, such as "-Xmx1024M".

    4. Start Weka.

    0 讨论(0)
  • 2020-12-14 09:27

    On Ubuntu i had the same problem but i solve it by increasing the amount of memory to use for the Java Virtual Machine run this : weka -m 1024m

    0 讨论(0)
  • 2020-12-14 09:27

    The answers above are too old (last one is 1 year ago). I had same issue with my WEKA (version 3.8.1) on Windows 10.

    I had a problem to update the heap size , the way I fixed it is by adding an environment variable (under control panel) as follows:

    JAVA_OPTS = -Xms30000m -Xmx30000m
    

    Tip: Just ensure that RunWeka.ini is using this environment variable.

    In the above example I give WEKA 30GB. It works.

    Hope it will be helpful for some people.

    0 讨论(0)
提交回复
热议问题