Results 1 to 11 of 11
  1. #1
    monika is offline Member
    Join Date
    Mar 2010
    Posts
    15
    Rep Power
    0

    Default Out of memory Error

    Hi ,

    I am using weka which is a open source data mining software.When I am using large dataset,it gives me out of memory error.



    When I am trying to run a J48 algorithm,it gives an out of memory error and it suggesting me to increase Java virtual machine heap size


    In the comment promt-(C:\user\xyz> )

    I have typed the command



    java -Xmx1g -C:\Program Files\Weka-3-6\weka.jar

    where
    "C:\Program Files\Weka-3-6\weka.jar"-the location of the jar file of weka
    But this did not work.

    Somewhere I have found the solution as
    java -Xmx1g -classpath /some/where/weka.jar


    Do I have to edit my class path


    I have also tried with editing my class path

    My previous class path
    .;C:\Program Files (x86)\Java\jre6\lib\ext\QTJava.zip

    New one--
    .;C:\Program Files (x86)\Java\jre6\lib\ext\QTJava.zip;C:\Program Files\Weka-3-6\Weka.jar

    But it also didnt work.

    Please let me know how to increase the heap size.

    Thank You
    Monika

  2. #2
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    9

    Default

    Increase your heap size using the -Xmx<num>m argument (before the classname) to increase your heap size to that "num" of megabytes (default 64).

  3. #3
    monika is offline Member
    Join Date
    Mar 2010
    Posts
    15
    Rep Power
    0

    Default

    I have tried with this command in command prompt--

    java -Xmx512m C:\Program Files (x86)\Java\jre6\lib\ext\QTJava.zip

    where this is my class path.

    But it didnt work

    Please help

  4. #4
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    9

    Default

    Define "didn't work".

    What, exactly, happened? Why are you attempting to execute a zipfile? And don't forget to place quotes around arguments that contain spaces.

  5. #5
    monika is offline Member
    Join Date
    Mar 2010
    Posts
    15
    Rep Power
    0

    Default

    I have tried with the following command at my command prompt and I am getting the following message.


    Command-
    C:\Documents and Settings\user>java -Xms512 -C:\Program Files\Java\jre6\bin

    Error message—
    Unrecognized option: -C:\Program
    Could not create the Java virtual machine.

    (where “ C:\Program Files\Java\jre6\bin” is my class path)

    Command—
    C:\Documents and Settings\user>java -Xms512 -"C:\Program Files\Java\jre6\bin"
    Error message---
    Unrecognized option:
    -C:\Program Files\Java\jre6\bin
    Could not create the Java virtual machine.

    Command-
    C:\Documents and Settings\user>java -Xms512 -C:\Program Files\Weka-3-6\weka.jar
    Error message-
    Unrecognized option: -C:\Program
    Could not create the Java virtual machine.

    (where “C:\Program Files\Weka-3-6\weka.jar” is the location of the jar file of weka)



    Commmand-
    C:\Documents and Settings\user>java -Xms512 -"C:\Program Files\Weka-3-6\weka.jar"
    Error message-
    Unrecognized option: -C:\Program Files\Weka-3-6\weka.jar
    Could not create the Java virtual machine.


    Please help

  6. #6
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    9

    Default

    it is '-cp<classpath>', not '-<classpath>' and you are still not providing the class to actually execute.

    See java - the Java application launcher

  7. #7
    monika is offline Member
    Join Date
    Mar 2010
    Posts
    15
    Rep Power
    0

    Default

    Sorry I did not understand what do you mean to say.

    Do you mean I should use actual class name.

    I want this for weka(a data mining tool) and its jar file is present in
    C:\Program Files\Weka-3-6\weka.jar. Agian I have tried with command



    C:\>java -Xms512 -Xmx1024 -classpath C:\Program Files\Weka-3-6\weka.jar

    But it gives the error NoclassdefFoundError.

  8. #8
    toadaly is offline Senior Member
    Join Date
    Jan 2009
    Posts
    671
    Rep Power
    6

    Default

    You are not telling the JVM a main class to open. If the jar file is executable, use '-jar' instead of '-classpath'. If not, you need to specify a main class as the last argument.

  9. #9
    monika is offline Member
    Join Date
    Mar 2010
    Posts
    15
    Rep Power
    0

    Default

    I have also tried with
    C:\>java -Xms512 -Xmx1024 -jar C:\Program Files\Weka-3-6\weka.jar

    I have alreday tried with this,it gives me error

    unable to access jar file

  10. #10
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    9

    Default

    Quote Originally Posted by monika View Post
    I have also tried with
    C:\>java -Xms512 -Xmx1024 -jar C:\Program Files\Weka-3-6\weka.jar

    I have alreday tried with this,it gives me error

    unable to access jar file
    And did you quote the arguments that contain spaces? As I already mentioned? Not according to that posted line.

    Edit: P.S. Did you even bother to look at the link in my previous post? Probably not.

  11. #11
    monika is offline Member
    Join Date
    Mar 2010
    Posts
    15
    Rep Power
    0

    Default

    I have look at the link you have given on the previous post.

    But I still did'nt find the way to do it.

    thank you

Similar Threads

  1. out of memory error in weka
    By monika in forum New To Java
    Replies: 2
    Last Post: 03-16-2010, 01:06 PM
  2. Out of memory error
    By Mrs. Deswal in forum Threads and Synchronization
    Replies: 3
    Last Post: 07-30-2009, 04:27 AM
  3. Out of memory error in eclipse
    By Java.child in forum New To Java
    Replies: 5
    Last Post: 09-05-2008, 05:50 PM
  4. Low memory error
    By rlhs76 in forum New To Java
    Replies: 2
    Last Post: 02-08-2008, 11:25 PM
  5. Java Heap Out of Memory Error
    By stonkers in forum New To Java
    Replies: 3
    Last Post: 07-17-2007, 05:43 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •