Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Out of memory on UCase()
Message
From
29/07/2013 03:05:51
 
 
To
28/07/2013 13:34:11
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01579306
Message ID:
01579327
Views:
43
>>What are oApp.Occurs() and oApp.At() ? Are you sure it is the UCase() rather than these which is causing the problem?
>
>Same as VFP Occurs() and VFP At().
>
>The last line of the Stack trace gives this:
>
>at Microsoft.VisualBasic.Strings.UCase(String Value)
>
>>IAC, it would be more efficient to create upper case versions of the string for use in those functions rather than repeating the conversion each time.
>
>Will do.
>
>>Does using ToUpper() rather than the VisualBasic namespace UCase() also cause the OOM ?
>
>I never use that as all functions are mainly from the framework. So, if we change environment and do a framework for that, all the client code would remain as is for those functions in case ToUpper() wouldn't exist. But, at this point, it is difficult to try a few changes as it is only in the production that the problem started yesterday. That code as always worked well for a few years and still works well in our test servers.


I'm with Viv on this one - performance - Do the Ucase conversion ony once

Also - instead of using Occurs() and the successive At(...., occurrence) which traverse the string many times (once for Occurs and each time for At)
consider using a RegEx that returns a matches collection. ( RegEx adds some overhead, but the string will be traversed once. It also lets you specify ignoreCase)


It may also be that the 'memory eating' part is somewhere else in the application and that there is not enough memory available for a UCase at that point in time
Gregory
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform