Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
OutOfMemory and StringBuilder
Message
De
13/01/2013 02:33:37
 
 
À
13/01/2013 00:14:08
Information générale
Forum:
ASP.NET
Catégorie:
Problèmes
Versions des environnements
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01562245
Message ID:
01562347
Vues:
20
>>Bear in mind that an OutOfMemoryException is thrown when a *request for memory* cannot be fulfilled. If you have 900Mb available and try to add a 1Gb string then you will get an exception. But that is not, in itself, fatal to the app - you still have 900Mb available and the process can continue to run. Whether you can safely handle an OOMException depends on the circumstances.
>
>What we had that situation, many errors like that came in. In some of them, they halted on the StrTran() method. On those, only a small string was sent. Well, small, in terms that this was a SQL command being parsed for verifications to encapsulated SQL Server reserved words with []. But, the one that triggered it was about 400 characters at most.

Those 400 bytes would be the ones that broke the camel's back. I'm guessing that the exception was caught at a much higher level in the stack - by which point GC would be able to free up sufficient memory to continue execution.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform