Page 1 of 1

profiler says connection.open is creating a LOT of strings

Posted: Thu 15 Feb 2007 16:32
by kevinherring
Hi
I ran the profiler built into VS2005 on my project today and it raised an interesting point.

It says that Corelab.Oracle.OracleConnection.Open creates 49,992 string instances, 26,010 byte arrays and 48,400 type arrays.

Together they account for just over 50% of the memory allocated by my program.

Any ideas why this is so? I only open the connection once.

Thanks
Kevin

Posted: Fri 16 Feb 2007 09:37
by Alexey
the profiler built into VS2005
Where is it?

Posted: Fri 16 Feb 2007 09:52
by kevinherring
there is a useful blog and video about it here:

http://channel9.msdn.com/ShowPost.aspx?PostID=46208

Basically go to Tools->Performance Tools->Performance Wizard

Posted: Fri 16 Feb 2007 11:58
by Alexey
Which edition of Visual Studio should it be?
How to install it separately?
I've just tested simple OracleConnection.Open() call with AQtime and didn't find anything strange.

Posted: Fri 16 Feb 2007 12:02
by kevinherring
"VS 2005 Team Edition For Software Developers"

Version 8.0.50727.762 (SP.050727-7600)

Posted: Fri 16 Feb 2007 12:09
by Alexey
Could you send me (alexeyi at crlab dot com) the screenshot of what you get with description for us.

Posted: Fri 16 Feb 2007 13:04
by kevinherring
just sent them.

I ran it with a different program too and it seems to think that one of my functions also creates nearly 20,000 strings, and that function is pretty straightforward, so I dont think it is anything to worry about.

It is very peculiar though! Perhaps it is something the framework is doing in the background?

Posted: Fri 16 Feb 2007 13:43
by Paul
Do you use OCI mode or Direct mode without Oracle client?
Did you see performance degradation comparing to "Microsoft DataProvider for Oracle" or "Oracle Data Provider"? What is the total memory usage of your program you can see in Windows Task Manager?

Posted: Fri 16 Feb 2007 13:49
by kevinherring
OCI mode (the default one)
I havent noticed any performance difference between yours and the MS one, but then I havent done any benchmarking. I've never used the oracle one.
Memory usage of my app at startup is 43mb, which sounds perhaps a little high, but i find it very difficult to predict with .NET programs how much they should use.

As I said, I havent experienced any actual issues I was just curious as to what could be causing it.

Thanks for looking
Kevin

Posted: Thu 22 Feb 2007 10:28
by kevinherring
it seems that the behaviour is normal:
http://forums.microsoft.com/msdn/showpo ... 6&siteid=1

Posted: Fri 23 Feb 2007 08:05
by Alexey
Thanks for your consideration.