Results 1 to 3 of 3

Thread: Freeup memory? (Array)

  1. #1

    Thread Starter
    PowerPoster Radjesh Klauke's Avatar
    Join Date
    Dec 2005
    Location
    Sexbierum (Netherlands)
    Posts
    2,244

    Freeup memory? (Array)

    Hi,

    I'm loading a couple of comboboxes with a few 100 items using an array. I only need them to load at the startup of the app. So because I don't need to use the array anymore I was wondering if they were still located in the memory and if so..: What would be the best way to clean it? Erase(myarray) or Array.Clear(...)


    If you found my post helpful, please rate it.

    Codebank Submission: FireFox Browser (Gecko) in VB.NET, Load files, (sub)folders treeview with Windows icons

  2. #2
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,424

    Re: Freeup memory? (Array)

    Array.Clear just clears the values from the array elements, so if you start with a 300 element array filled with strings, after clearing you'll have a 300 element array filled with ""

    erase completely erases the array. after erase your array = nothing.

    but i don't think you'll be saving much memory doing that

  3. #3

    Thread Starter
    PowerPoster Radjesh Klauke's Avatar
    Join Date
    Dec 2005
    Location
    Sexbierum (Netherlands)
    Posts
    2,244

    Re: Freeup memory? (Array)

    but i don't think you'll be saving much memory doing that
    So I guess it's a bit pointless in my case, but thank you for telling me how it works. The msdn didn't mention that.

    Edit: after adding the erase it seems tat the app uses even more memory ...


    If you found my post helpful, please rate it.

    Codebank Submission: FireFox Browser (Gecko) in VB.NET, Load files, (sub)folders treeview with Windows icons

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