Weka大数据内存不足

1、旧版本中设置

RunWeka.ini 中的 
maxheap=1024M 

2、新版本中去掉此变量(注意:不能加入此变量,或设置 maxstack=1024m )。而是使用javaOpts选项,比较简单的做法如下:

javaOpts=-Xmx1024m

 

Weka官方给出的解释:

 

Yes, we removed the maxheap setting because Oracle's Java VM has a pretty sensible default strategy for setting the maximum heap size. 

An easy way to set the heap size for Oracle Java Virtual Machines is via the _JAVA_OPTIONS environment variable

https://weka.wikispaces.com/OutOfMemoryException

There is some info on this variable here: 

https://weka.wikispaces.com/Weka+package+manager+does+not+start

Increasing the stack size is only (potentially) useful if you get a stackoverflow exception

AVA_OPTS is an environment variable. You cannot set this in the RunWeka.ini file – you must set it as either a user or system-wide environment variable in the Windows settings. The RunWeka.ini file will then pick up the value and assign it to javaOpts which, in turn, is used in the command that launches Weka. Alternatively, you can just set javaOpts directly by editing the RunWeka.ini file: 

javaOpts=-Xmx1024m 

The advantage of the JAVA_OPTS environment variable is that you don't have to actually edit the RunWeka.ini file in order to make changes to the max heap (or any other JVM argument for that matter). 

you can check yourself whether it works. In the Explorer, right-click on the “Status” information at the bottom of the window. Then select “Memory information” from the pop-up menu. The “max.” value should correspond (roughly) to the maximum heap size you have specified. 

Another way to check is to select “SystemInfo” from the “Help” menu of WEKA’s GUI Chooser. The “memory.max” entry has the heap size. 

你可能感兴趣的:(数据挖掘)