Increase heap size in java for weka

后端 未结 17 1309
天命终不由人
天命终不由人 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:04

    I am running Weka 3.6 in windows. This is what i did. Go to the Weka installation directory and you will find a RunWeka.bat file. Open this file in a text editor and add -Xmx argument in the java command line.

    for instance this sets to 4GB memory, %_java% -Xmx4096m -classpath . RunWeka -i .\RunWeka.ini -w .\weka.jar -c %_cmd% "%2"

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

    Omit the -classpath option. Use just -Xmx500m option.

    So, instead of just:

    java weka.core.Instances data/soybean.arff
    

    you do:

    java -Xmx500m weka.core.Instances data/soybean.arff
    

    If you run weka via some script (RunWeka.bat for example), then you need to modify that script (with some text editor like notepad).

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

    Run this command in your terminal:

    java -Xmx1024m -jar weka.jar
    
    0 讨论(0)
  • 2020-12-14 09:06

    The official Weka answer (for all operating systems and Weka versions) can be found on http://weka.wikispaces.com/OutOfMemoryException.

    In case you are using a recent Weka version on Windows, the answer is:

    Modify the maxheap parameter in the RunWeka.ini file.

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

    The best way to do it using this command

        java -Xmx1024m -[weka classifier] -t [training file path]
    
    0 讨论(0)
  • 2020-12-14 09:07

    You should also see if default thread stack size 20MB is enough. Increase the value to 50MB in the file /Applications/weka-3-8-1-oracle-jvm.app/Contents/Info.plist (on MAC) like below:

    <string>-Xss50M</string>
    
    0 讨论(0)
提交回复
热议问题