Memory usage of DataTable

  • Thread starter Thread starter Simone
  • Start date Start date
S

Simone

Problem:

If a datatable has 100 rows and use 1 MB of memory and then i use the
Clear() method and then
i refill the datatable with 10 rows. The memory usage of the DataTable is
still 1MB?
The Clear method frees memory usage of the datatable?

If i want to free the memory usage of the Datatable, i must destroy the
DataTable and wait for the GC to collect that?

By Simon.
 
Are you actually running out of memory or just watching the memory usage?
If you're not seeing a problem don't worry about it. If you don't tell the
GC how to do its job, it won't tell you how to do yours.

--
Chris Tacke
Co-founder
OpenNETCF.org
Has OpenNETCF helped you? Consider donating to support us!
http://www.opennetcf.org/donate
 
Are you actually running out of memory or just watching the memory usage?

I see that my app sometimes increase memory usage of about 10KB during usage
of application and sometimes does not increase the memory usage.

Since i have only a Form and an object containing the DataTable in memory
why my app icrease memory uage?

Simon.
 
Again, if you're not getting an error, don't worry about it. The GC will do
it's job when it feels it needs to, which doesn't always coincide with when
you're watching.

--
Chris Tacke
Co-founder
OpenNETCF.org
Has OpenNETCF helped you? Consider donating to support us!
http://www.opennetcf.org/donate
 
Back
Top