none
System.OutOfMemoryException while listing 1000 users RRS feed

  • Question

  • Hi Guys/Boys n Girls if any ...

    I have a program (Web app)...

    In which I am listing 1000 Users, while listing all this users... I am getting following error

    Exception: System.OutOfMemoryException
    Message: Exception of type 'System.OutOfMemoryException' was thrown.
    Source: mscorlib
       at System.String.CreateStringFromEncoding(Byte* bytes, Int32 byteLength, Encoding encoding)
       at System.Text.UTF8Encoding.GetString(Byte[] bytes, Int32 index, Int32 count)
       at XXX.XXX.XXX.XXX.Serialize(Object o)

    1. Machine is with 2GB of RAM. Running only this program.(No other process is taking these much space !)
    2. I restarted machine, cleaned the cache(Everything which is possible)
    3. I can list 50 Users but get error for 500 ( program can list 5,10, 50, 500 Users .. I can't change this.)
    4. If I select 500 users then in code, I just increase the page size(Grid size & displays it.)

    What can be the possible reason ???

    Waiting ....
    Monday, March 8, 2010 2:40 PM

Answers

  • The issue is obvious: you're out of memory.  We can't really shed any light on this until we some more information.  I think you still need to provide more detail.  Maybe an example of the information you're retrieving, a code snippet, etc..
    If everyone is thinking alike, then somebody isn't thinking.
    • Marked as answer by eryang Monday, March 15, 2010 1:51 AM
    Tuesday, March 9, 2010 5:38 PM

All replies

  • 1) Very rare and unique situation of Unicode string that can not be parsed obviously
    2) tyr to run some profiler like: RedGate Ants and see what happens

    C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do it blows your whole leg off (c) — Bjarne Stroustrup [http://www2.research.att.com/~bs/bs_faq.html#really-say-that]
    Monday, March 8, 2010 2:46 PM
  • We would have to take a look at the code you're using to load/list all the users, otherwise there's no way of knowing what's consuming more memory than it should
    -- Blog: http://geeklyeverafter.blogspot.com/
    Monday, March 8, 2010 2:51 PM
  • Hi All,
     Thank you very much for your reply ...

    Here are more details about code...

    Its a standard call,
    I am retrieving data from the table(DataView), assigning grid datasource to the table(DataView).

    Thats it...!

    One more important point.. On another setup the code is working fine.
    But the problem is only with this setup.

    (Its a large product, needs installation on 2-3 servers, On local test setup everything is working fine but the problem is with this setup. Logs showing only above data,,, no more helpful logs.)


    Tuesday, March 9, 2010 7:22 AM
  • The issue is obvious: you're out of memory.  We can't really shed any light on this until we some more information.  I think you still need to provide more detail.  Maybe an example of the information you're retrieving, a code snippet, etc..
    If everyone is thinking alike, then somebody isn't thinking.
    • Marked as answer by eryang Monday, March 15, 2010 1:51 AM
    Tuesday, March 9, 2010 5:38 PM
  • Hey guys thanks to all of you..!

     

    But i didn't found any solution for this.. even if I am having 8GB RAM. with no other application running.

     

    I am using FlipList may be some error bcoz of that.

    Again thank you very much for all of your support n help.

     

    If I find anything helpful/ solution will surely update u all.

    Monday, April 19, 2010 6:50 AM