Will clearing an array free the memory allocated?

Discussion in 'Questions (Windows Mobile)' started by moster67, Mar 8, 2009.

  1. moster67

    moster67 Expert Licensed User

    Another quick question.

    Will clearing an array free the memory allocated?

    If I re-declare an array, setting it to zero, will the memory-space allocated by the array be freed as well? If it does, does this take place immediately?

    The same goes for Agraham's Collection-library and using its extended methods for clearing an array: will the memory-space allocated by the array be freed as well?

    I guess above depends CF.NET's memory-handling. Can anyone shed some light?

    Thanks.

    rgds,
    moster67
     
  2. agraham

    agraham Expert Licensed User

    You don't need to worry about freeing and reusing memory in .NET/Basic4ppc (unless you are writing libraries that interact with native resources). In managed code (C#, VB.NET, Basic4ppc) memory is entirely managed for you. Google for ".NET Garbage Collection", there are lots of articles out there but you don't actually need to know about this, just ignore the issue.
     
  3. moster67

    moster67 Expert Licensed User

    Thank you Agraham.

    rgds
    moster67
     
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