CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: memory problem

  1. #1
    Join Date
    Oct 2004
    Posts
    77

    Angry memory problem

    i am writing a program which is working on a 50MB file i am using hashmaps to store the words in the text file and the count as value and i am using some arrayLIsts having hashmap as values.and now the program gives me error
    Exception in thread "main" java.lang.OutOfMemoryError
    i tried using the command

    java -Xms32m -Xmx128m filename

    it speed up the process a bit bit still the error is there

    can you please tell me if there is any other command which i can use to get rid of this probelm .i understand it due to makinga lot of objects but now i am finding it hard to chg the structure of my program.

    if you think its due to a lot of hashmaps ,if i make a class and make the objects and put in the vector and use that verctor as value of arraylist ..will it be better memory wise?

  2. #2
    Join Date
    Sep 2004
    Posts
    247

    Re: memory problem

    If you need this amount of memory, you need it! Have you tried increasing the memory available to Java to more than 128M?


    -Xmx256m perhaps?

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured