PC Review Forums Newsgroups Microsoft DotNet Microsoft Dot NET Compact Framework Memory usage of DataTable

Reply

Memory usage of DataTable

 
Thread Tools Rate Thread
Old 16-03-2005, 05:12 PM   #1
Simone
Guest
 
Posts: n/a
Default Memory usage of DataTable


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.


  Reply With Quote
Old 16-03-2005, 05:23 PM   #2
Chris Tacke, eMVP
Guest
 
Posts: n/a
Default Re: Memory usage of DataTable

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


"Simone" <simone.bonacin@elitec.it> wrote in message
news:ul4IsLkKFHA.3500@TK2MSFTNGP14.phx.gbl...
> 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.
>
>



  Reply With Quote
Old 16-03-2005, 05:51 PM   #3
Simone
Guest
 
Posts: n/a
Default Re: Memory usage of DataTable

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


  Reply With Quote
Old 16-03-2005, 06:32 PM   #4
Chris Tacke, eMVP
Guest
 
Posts: n/a
Default Re: Memory usage of DataTable

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


"Simone" <simone.bonacin@elitec.it> wrote in message
news:uxc2RhkKFHA.2812@TK2MSFTNGP15.phx.gbl...
>> 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.
>
>



  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off