Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Increase heap size in java for weka

Tags:

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

> java -Xmx500m -classpath 

but I get the following error:

-classpath requires class path specification 

I'm not sure what this means. Any suggestions?

like image 673
screechOwl Avatar asked Dec 29 '11 00:12

screechOwl


People also ask

How can I increase my Weka heap size?

According to the https://waikato.github.io/weka-wiki/faqs/OutOfMemoryException/, you can set the max heap up to 2GB. Easy way In “control panel-system-advance setting-environment variables” edit _JAVA_OPTIONS and change it to Xmx2g .

How do you increase your heap?

Increase the memory heap of the IDE If you are experiencing slowdowns, you may want to increase the memory heap. From the main menu, select Help | Change Memory Settings. Set the necessary amount of memory that you want to allocate and click Save and Restart.

What is the maximum heap size for 64 bit JVM?

For 64 bit platforms and Java stacks in general, the recommended Maximum Heap range for WebSphere Application Server, would be between (4096M - 8192M) or (4G - 8G).


2 Answers

What I found was the actual issue was in the file 'RunWeka.ini' in '\Program Files (x86)\Weka-3-6'. I opened it with notepad and in the middle of the file there is a line 'maxheap = 512m'.

I changed the line to read 'maxheap=2000m', saved the file and reloaded weka and this fixed my problems.

I'm not sure if this is the correct way to do it or not but it worked for me.

like image 178
screechOwl Avatar answered Sep 22 '22 01:09

screechOwl


Run this command in your terminal:

java -Xmx1024m -jar weka.jar 
like image 43
Dulith De Costa Avatar answered Sep 23 '22 01:09

Dulith De Costa