Solved

increase heap

Posted on 2009-05-09
8
1,021 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
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Android studio getdrawable(int) is deprecated 4 82
split string containing \r\n in Java 46 43
difference of if loops 23 49
Chrome and Firefox Java 5 23
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

813 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now