Solved

increase heap

Posted on 2009-05-09
8
1,022 Views
Last Modified: 2013-11-23
I am trying to run a Java base program called WEKA. I am running Vista 64 bit.

I installed the program and it ran but then I got an insufficient memory message.
"Not enough memory. Please load a smaller dataset or use larger heap size"
I saw a post on the net at http://www.errorbase.net/Not_enough_memory._Please_load_a_smaller_dataset_or_use_larger_heap_size.

That suggests
this command.
C:\Matlab\weka-3-5-7>java -Xmx256m -jar weka.jar

I changed it to:

C:\Program Files (x86)\Weka-3-6>java -Xmx256m -jar weka.jar
I tried running this at the dos command but it says "java is not recognized as an internal or external command"
But I know that java was installed because the program (WEKA) was running.
How can I adjust the memory?
0
Comment
Question by:onyourmark
  • 4
  • 4
8 Comments
 
LVL 3

Expert Comment

by:hazgoduk
ID: 24343224
I always do java -jar -Xmx256m weka.jar

If you just type java into the console it should give you the help text.
If it says unrecognised you need to add java to your PATH environment variable
0
 

Author Comment

by:onyourmark
ID: 24343274
Hi, can you tell me how to add it to the PATH environment variable and what I should add?
Thanks!
0
 
LVL 3

Expert Comment

by:hazgoduk
ID: 24343308
Right click my computer
Click properties
Advanced system settings
Environment variables

There are user and system variables, you want system.
Scroll down in the system variables box until you find Path
Click it so the Path row is highlighted
Click edit
Add the path to your jre/bin folder at the end and don't forget to put a ; after the current last path to split them.

I had to add ;C:\Program Files\Java\jdk1.6.0_13\jre\bin to mine but yours will probably be ;C:\Program Files\Java\JRE6\bin or something
0
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

by:onyourmark
ID: 24343369
Hi Thanks. I added C:\Program Files\Java\JRE6\bin  to the PATH.

Then  I went to the dos command and typed -jar -Xmx512m weka.jar

I got "Unable to access jarfile weka.jar"

What doe this mean?
0
 
LVL 3

Expert Comment

by:hazgoduk
ID: 24343422
weka.jar would have to be in the folder that you're in on the command line...

I suggest putting weka.jar into C:\
cmd
cd \
java -jar -Xmx512m weka.jar
0
 

Author Comment

by:onyourmark
ID: 24344035
Hi I think it worked. Is there some way to verify that it has actually increased?

THANKS!
0
 
LVL 3

Accepted Solution

by:
hazgoduk earned 500 total points
ID: 24344582
Well if it doesn't crash still because of that error it's increased. Not sure if there is a way to actually confirm how much ram the java process is using. It definitely does work though. I have a huge program that won't load without it but runs perfectly with it in. Put it in a batch file as well then you can just double click that instead of going through the command line every time. Just type the command into a file called weka.bat

Maybe if you open task manager and go to processes the java process will have 256 in the momory column
0
 

Author Closing Comment

by:onyourmark
ID: 31579747
Thanks for great help.
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question