Dim memory usage

Discussion in 'Questions (Windows Mobile)' started by JamesC, Jul 21, 2008.

  1. JamesC

    JamesC Member Licensed User

    I'm using some potentially quite large arrays in my database program. How much memory is allocated from RAM when you dim an array? How does it differ for different datatypes? Can one free up RAM by using dim arrayname(0)?

    Thanks.

    The support on this forum is fantastic!! :sign0098:
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    How large are your arrays?
    If you don't specify any type for your array it will be a default strings array.
    Such array is actually an array of pointers and the memory it uses will increase as you insert new items to the array.
    It is better to declare large arrays that only suppose to hold numeric values as Double.

    Dim arrayname(0) will free the RAM that this array holds (though not immediately).
     
  3. JamesC

    JamesC Member Licensed User

    Ta

    Thanks Erel. The arrays were potentially a few hundred thousand records in size. The idea was to extract info from a (very large) text file (the chess .pgn file!), store it in arrays, and then insert it into an SQLite table. But I see now that I can insert the info at the same time as I read the info, one record at a time, or insert it every 1000 records, say.

    James
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice