none
Memory usage RRS feed

  • Question

  • Hello,
    I wrote window application that has some datagrids and data from SQL. I saw in task manager that this application uses 23 MB memory. Is it considered as normal / high ? And if high how can i reduce it?
    BTW it's only the beginning of the application writing. I will have to add much more datagrids and other stuff...
    Tuesday, May 12, 2009 10:08 AM

Answers

  • "Virtually methods and classes does not consume memory" by this I mean that they do consume memory, but that is too small to be considered. I think the memory consumption will be a summation of all the tabs unless you clean up memory when switching tabs. You can clean up memory by nullifying objects and calling the Garbage Collector by invoking GC.Collect() method. But it is strongly advised NO TO invoke the GC.Collect() method explicitly unless and until it is required- like in memory critical applications.

    Sandeep Aparajit | Home | My Blog | Photography | Mark useful posts as Answer/Helpful.
    • Marked as answer by Bin-ze Zhao Thursday, May 14, 2009 9:54 AM
    Tuesday, May 12, 2009 10:51 AM

All replies

  • Hi michaelgr123 ,

      As per my understanding a simple processing having DataGrid does not consume 23MB of memory. Well, at the same time it will also depend on the amount of data that you are fetching from SQL DB and binding it to the DataGrid. I would suggest you to analyze this behavior with less amount of data. If still the problem persists then review your source code.

    Hope this helps you!
    Sandeep Aparajit | Home | My Blog | Photography | Mark useful posts as Answer/Helpful.
    Tuesday, May 12, 2009 10:11 AM
  • Yes. But without data it takes 22MB. And with 23MB. Can it cause problems? or it is still fairly normal?
    Tuesday, May 12, 2009 10:29 AM
  • Hi michaelgr123 ,

      If you application is huge, which has other components as well, then it should be Okay. But if your application contains a single form with a single DataGrid, then this seems to be an issue.

    Sandeep Aparajit | Home | My Blog | Photography | Mark useful posts as Answer/Helpful.
    Tuesday, May 12, 2009 10:32 AM
  • I have a form with 5 datagrids and click mouse button events .

    Does using with methods and classes reduces the memory usage or not?
    I am nor worried now, but still there will be much more datagrids and stuff (about 10 times more datagrids)
    Tuesday, May 12, 2009 10:39 AM
  • Virtually your methods and classes does not consume memory. The actual memory that is consume is due to the data residing in it. I think when you have 5 DataGrids, the usage seems to be appropriate.
    Sandeep Aparajit | Home | My Blog | Photography | Mark useful posts as Answer/Helpful.
    Tuesday, May 12, 2009 10:41 AM
  • OK, And if i have tab pages, does the memory usage consume is taken from other tab pages too or only from the one viewed in the moment?
    What did you mean by saying virtually methods and classes does not consume memory (or less)?
    Tuesday, May 12, 2009 10:46 AM
  • "Virtually methods and classes does not consume memory" by this I mean that they do consume memory, but that is too small to be considered. I think the memory consumption will be a summation of all the tabs unless you clean up memory when switching tabs. You can clean up memory by nullifying objects and calling the Garbage Collector by invoking GC.Collect() method. But it is strongly advised NO TO invoke the GC.Collect() method explicitly unless and until it is required- like in memory critical applications.

    Sandeep Aparajit | Home | My Blog | Photography | Mark useful posts as Answer/Helpful.
    • Marked as answer by Bin-ze Zhao Thursday, May 14, 2009 9:54 AM
    Tuesday, May 12, 2009 10:51 AM