newbie: ArrayList memory leak?

  • Thread starter Thread starter Peter Schmitz
  • Start date Start date
P

Peter Schmitz

Hi everyone,

I am new to .net programming and I do have some serious memory problems:

In my current application I need to maintain a big linked list (of Type
ArrayList), which includes items/class instances that contain filled members
of ArrayList themselves,e.g.

Public Class MyTestClass
Public myList as ArrayList 'filled with data
End Class

Dim mytest as new ArrayList 'contains lots of MyTestClasses

Now, when the main thread of my application is finished, I call
mytest.Clear() to free the memory I used. Unfortunately, the RAM consumption
of my application does not change through this call. Do I have to call Clear
on every 'index' in my ArrayList? Is there a way to explicitly delete a
variable in VB .net (just as malloc() and free() in good old C++)?

Best wishes,

Peter
 
Peter said:
Hi everyone,

I am new to .net programming and I do have some serious memory
problems:

In my current application I need to maintain a big linked list (of
Type ArrayList), which includes items/class instances that contain
filled members of ArrayList themselves,e.g.

Public Class MyTestClass
Public myList as ArrayList 'filled with data
End Class

Dim mytest as new ArrayList 'contains lots of MyTestClasses

Now, when the main thread of my application is finished, I call
mytest.Clear() to free the memory I used. Unfortunately, the RAM
consumption of my application does not change through this call. Do I
have to call Clear on every 'index' in my ArrayList? Is there a way
to explicitly delete a variable in VB .net (just as malloc() and
free() in good old C++)?

Best wishes,


The Framework uses a garbage collection mechanism. It destroys objects....
read here:
http://msdn.microsoft.com/en-us/library/f144e03t.aspx


Armin
 
Peter,

You tell the memory consumption is to high, do you see that because your
computer is acting to slow after a while or does it restart?

Cor
 
I just wonder if ..............


Please befor this thread goes wild please try the following , after you have
done everything you said
minimize the app wait a few seconds and then maximize the app watch the
memory behavior now
is it fine now ? , well then my friend it is time for you to learns some
more about the memory management of the .Net framework

regards

Michel
 
Back
Top