Memory usage of DataTable

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.
 
C

Chris Tacke, eMVP

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
 
S

Simone

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.
 
C

Chris Tacke, eMVP

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top