Java.Lang.OutOfMemoryError with 1 million index array

Discussion in 'Java' started by Ian Suttle, Aug 22, 2003.

  1. Ian Suttle

    Ian Suttle Guest

    Hey all. I am having an issue with the java.lang.outofmemoryerror. I
    am loading a resultset from SQL 2000 into my console application in
    Windows XP. The recordset consists of 1,000,000 rows (all rows in
    table) which I convert to an array structure. This was working fine
    until I added additional data to the array from the resultset. In
    total, the physical table size is 35,840KB. When I monitor the amount
    of memory being used via Task Manager, it throws the error at about 75
    MB consistently.

    I have tried to break up the query into parts of 250,000 thinking that
    all of the data from the 1,000,000 rows is too much memory overhead in
    addition to storing the data in the arrays. This has the same effect
    once I get to about 75MB of Mem Usage.

    I have also watched the heap size within JBuilder9, which has an
    allocated heap size of 31.8MB. When the error occurs, the utilized
    portion of the heap is also around the allocated size. I have tried
    running this application within JBuilder and as a compiled EXE.

    If anyone has any suggestions as to how to get around whatever
    limitations are occurring here, please let me know.

    The following are the specs of the test:
    Microsoft Windows XP - SP1
    P4 - 1.8GHZ
    640MB RAM
    JDK 1.4.1
    JBuilder 9 Enterprise

    Thanks in advance!
    Ian Suttle
    Zing.com
     
    Ian Suttle, Aug 22, 2003
    #1
    1. Advertising

  2. Ian Suttle

    Ian Suttle Guest

    Thank you for the help. It turns out that my whole problem had been
    that in JBuilder I was putting the "-mx128m" switch into the
    application startup line instead of the VM startup line.

    Do you know if there is any way to change the default maximum
    allocation to be higher than 64MB?

    Thanks again!
    Ian Suttle

    Wolfram Rittmeyer <> wrote in message news:<bi5t42$5kfnd$-berlin.de>...
    > Ian Suttle wrote:
    >
    > > Hey all. I am having an issue with the java.lang.outofmemoryerror. I
    > > am loading a resultset from SQL 2000 into my console application in
    > > Windows XP. The recordset consists of 1,000,000 rows (all rows in
    > > table) which I convert to an array structure. This was working fine
    > > until I added additional data to the array from the resultset. In
    > > total, the physical table size is 35,840KB. When I monitor the amount
    > > of memory being used via Task Manager, it throws the error at about 75
    > > MB consistently.
    > >

    > You have to set the memory-options atz starttime. These are - for example -
    > "-ms64m" for the memory allocated right from the start and "-mx128m" for
    > the maximum amount of memory. The standard is -mx64m which is obviously not
    > enough in your case. try setting it to -mx128m or more (since you've got
    > 640 MB you should probably spend 256 MB).
     
    Ian Suttle, Aug 25, 2003
    #2
    1. Advertising

  3. Ian Suttle wrote:
    > Thank you for the help. It turns out that my whole problem had been
    > that in JBuilder I was putting the "-mx128m" switch into the
    > application startup line instead of the VM startup line.
    >
    > Do you know if there is any way to change the default maximum
    > allocation to be higher than 64MB?
    >
    > Thanks again!
    > Ian Suttle
    >


    No, AFAIK there is only the command-line option. But that should be good
    enough. Just create a shell-script / batch-file to call your programm,
    using any command-line options needed, so you wont have to type it in
    over and over again.

    Wolfram Rittmeyer
    http://www.jsptutorial.org
     
    Wolfram Rittmeyer, Aug 27, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Xiaopeng Xiong

    java.lang.OutOfMemoryError problem

    Xiaopeng Xiong, Nov 14, 2003, in forum: Java
    Replies:
    3
    Views:
    444
    Xiaopeng Xiong
    Nov 15, 2003
  2. Mit Majithia
    Replies:
    6
    Views:
    15,171
    Moazam Raja
    Feb 26, 2004
  3. H.MuthuKumaraRajan

    java.lang.OutOfMemoryError

    H.MuthuKumaraRajan, Apr 3, 2004, in forum: Java
    Replies:
    1
    Views:
    1,233
    e.Morr
    Apr 3, 2004
  4. Replies:
    0
    Views:
    479
  5. Goofball
    Replies:
    9
    Views:
    786
    Goofball
    Nov 8, 2006
Loading...

Share This Page