This is a migrated thread and some comments may be shown as answers.

GridView & releasing memory

8 Answers 267 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Bob
Top achievements
Rank 1
Bob asked on 21 May 2008, 06:45 PM
Once I start my app, it utilizes 15MB of RAM.

After adding 2,000 records and manipulating some of the cells, it's at 75MB.  Okay, no problem.

I then clear the rows...but the memory is still at 75MB.  What must I do to clear that 60MB from memory?

8 Answers, 1 is accepted

Sort by
0
Julian Benkov
Telerik team
answered on 22 May 2008, 01:13 PM
Hello Bob,

Sorry for the inconvenience this issue causes you.

We recognize that the memory footprint of the RadGridView should be reduced. At this time, I cannot offer you a workaround to enable you to decrease the memory usage of your application. We are continuing our work on improving this aspect of the control. This task has a high priority for the Q2 2008 release.

Best wishes,
Julian Benkov
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Bob
Top achievements
Rank 1
answered on 22 May 2008, 01:29 PM
So within the next month and a half...If it is possible to get an early beta test of this component with the memory fix in place I'd love to test it.  This puts me in a tough spot for the application I'm writing.

I tried disposing of the GridView to clear the memory, but it didn't change at all...if it's not being stored in that object, where is it so I can clear it manually, and re-create my grid?  I have to have a way to accomplish this soon.  My my tests so far have only been with ~2,000 rows...and I'm expecting to use up to 20,000 but I can't do that if I have no way to reduce the memory footprint.

Thanks.
0
Kiril
Telerik team
answered on 23 May 2008, 04:24 PM
Hello Bob,

Thank you for getting back to us.

We are very interested in the details of your scenario. You can try calling GC.Collect() to reclaim any memory released since the last collect call. If that does not help, please send us your project. We would like to investigate further and come up with a solution that works for you.

All the best,
Kiril
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Brandon
Top achievements
Rank 1
answered on 28 Jul 2008, 03:34 PM
Hi,

I was wondering if the memory problem has been fixed.  I don't see it mentioned in the release history.  This is an even bigger problem for us because we would like to use 10+ grids in a tab control on one form and when the form is closed the memory is not released.

Thanks,

Brandon
0
Bob
Top achievements
Rank 1
answered on 28 Jul 2008, 03:44 PM
What I found is that if I traced the actual memory being used, I could visibly see it drop after the explicit call to the GC.  However, windows still reported the same amount of memory used.  So I don't know if this is really a problem or not.

I plan to revisit this issue in my app in the next month or so.
0
Angel
Telerik team
answered on 29 Jul 2008, 01:19 PM
Hi Bob,

It is possible that the virtual machine leaves the memory allocated for future use.

Try creating the form with the 10+ grids many times.
Does the memory usage increase each time a new form is created and opened?
Or is this happening only for the first form?

Regards,
Angel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Bob
Top achievements
Rank 1
answered on 29 Jul 2008, 01:32 PM
That's not really applicable to my situation.  I'm not deleting the grid, it's created at design time and I just filling it with records, update the rows, then clear it out.  And repeat once or twice more.


0
Peter
Telerik team
answered on 30 Jul 2008, 02:10 PM
Hi Bob,

We cannot confirm this as a RadGridView issue.
I did several tests with intensive adding/removing rows in unbound mode and will investigate the result deeply - at first look i cannot detect memory leak.

Maybe the reported behavior comes from the way that Garbage Collector (GC) works.
Here is quote from NET Memory Management and Garbage Collection:
"We know that allocating memory is time-consuming, so its generally better
when there is lots of memory to just go ahead and allocate a big chunk all at once.
This means that our .NET applications can actually perform better in many cases,
since they don't have to be constantly allocating and deallocating needed memory.
Similarly, the garbage collector is often criticized by newbies to .NET unfairly,
because the implication of GC is that memory is not released as quickly as possible.
"

Here is another speaking for .NET Memory Management.

I hope this clarifies the issue.
If you have additional questions, feel free to contact me.


All the best,
Peter
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
GridView
Asked by
Bob
Top achievements
Rank 1
Answers by
Julian Benkov
Telerik team
Bob
Top achievements
Rank 1
Kiril
Telerik team
Brandon
Top achievements
Rank 1
Angel
Telerik team
Peter
Telerik team
Share this question
or