String Builder - out of Memory Exception

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I have around 30 fields on a screen each one of which I need to validate.
The idea was to have a set of messages to be displayed for all the posiible
errors instead of having to show a single message at a time.
For this I was using a string builder and appending all the text to it after
each validation. This process slowed down the system and at a point I got the
out of memory exception. Would a string builder consitsiting of 20-30 lines
leave the system out of memory? What is the best way to tackle this oter than
having to send one error message back to the client each time?

P K
 
Have you tried to check what you construct as you go ?

My first move would be that there is some kind of error that makes a far
more bigger string than what you expect (would explain both slowness and out
of memory error).
 
Hi P.K.,

The error you described indicates an infinite loop somewhere in your code.
Try to step through the page using the debugger.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top