none
Perfomance Issue LinqTosql RRS feed

  • Question

  • Hello 

    I am currently facing issue of performance and Memory in LinqToSql with WPF,

    I have Table Contains 300000 record having 15 foreign key ,

    basically we are using INotifyCollectionChanged that is BindingList<T> same as GetNewBindingList()

    but in this process it throws Memory Out of Exception and it uses around 2 GB (only One Table   :(  ) than its Throws Exception of Memorry I have 8 GB RAM in My PC but ,

    i think its using Lots of Memory and throws Exception  

    PLEASE HELP ME FOR THE SAME  ITS AN ARGENT ISSUE !!!! 

    Thanks 

    VIpul Thakkar

    Monday, April 22, 2013 1:58 PM

Answers

  • There is nothing particular wrong with BindingList<T>, your problem is 300'000 records in your collection.

    No one will be able to read this count of records on your form. Your customers will probably apply some filters to find necessary data.

    Consider apply filtering on database level and bring only the items that you need on the interface. Also pager could be an option too.

    BTW Sambath Raj.C also posted an interesting article. Take some time to read it.


    Please Mark as Answer and Vote as Helpful if I helped.

    Also please visit my blog http://msguy.net/

    Tuesday, April 23, 2013 9:08 AM

All replies

  • Are you trying to push all of your 300'000 records in your collection? Don't you think that it could be a bad practice to select all these records (without applying any WHERE filter on it)

    Just do raw calculations for yourself.

    1. What is estimate size of your one object reference in collection.
    2. Then multiply this bytes to 300'000 and you'll get your memory allocation only for this collection.

    Please Mark as Answer and Vote as Helpful if I helped.

    Also please visit my blog http://msguy.net/

    Monday, April 22, 2013 9:28 PM
  • I hope the following URL will help you to understand the LINQ performance

    http://www.codeproject.com/Articles/38174/How-to-improve-your-LINQ-query-performance-by-5-X


    With Thanks and Regards
    Sambath Raj.C
    click "Proposed As Answer by" if this post solves your problem or "Vote As Helpful" if a post has been useful to you
    Happy Programming!

    Tuesday, April 23, 2013 4:34 AM
  • Thank You Michael ,

    I appreciate your help !!

    but i need Notify Collection for my Items Source !!,

    by the way can you suggest some alternative to this option any other ways to implement this kind of screen with example???

    how can we achieve this feature ??

    Thanks 

    Vipul Thakkar,

    Tuesday, April 23, 2013 9:02 AM
  • There is nothing particular wrong with BindingList<T>, your problem is 300'000 records in your collection.

    No one will be able to read this count of records on your form. Your customers will probably apply some filters to find necessary data.

    Consider apply filtering on database level and bring only the items that you need on the interface. Also pager could be an option too.

    BTW Sambath Raj.C also posted an interesting article. Take some time to read it.


    Please Mark as Answer and Vote as Helpful if I helped.

    Also please visit my blog http://msguy.net/

    Tuesday, April 23, 2013 9:08 AM