profiler says connection.open is creating a LOT of strings

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
kevinherring
Posts: 64
Joined: Wed 04 Jan 2006 15:32

profiler says connection.open is creating a LOT of strings

Post by kevinherring » Thu 15 Feb 2007 16:32

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

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Fri 16 Feb 2007 09:37

the profiler built into VS2005
Where is it?

kevinherring
Posts: 64
Joined: Wed 04 Jan 2006 15:32

Post by kevinherring » Fri 16 Feb 2007 09:52

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

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Fri 16 Feb 2007 11:58

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.

kevinherring
Posts: 64
Joined: Wed 04 Jan 2006 15:32

Post by kevinherring » Fri 16 Feb 2007 12:02

"VS 2005 Team Edition For Software Developers"

Version 8.0.50727.762 (SP.050727-7600)

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Fri 16 Feb 2007 12:09

Could you send me (alexeyi at crlab dot com) the screenshot of what you get with description for us.

kevinherring
Posts: 64
Joined: Wed 04 Jan 2006 15:32

Post by kevinherring » Fri 16 Feb 2007 13:04

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?

Paul
Posts: 725
Joined: Thu 28 Oct 2004 14:06

Post by Paul » Fri 16 Feb 2007 13:43

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?

kevinherring
Posts: 64
Joined: Wed 04 Jan 2006 15:32

Post by kevinherring » Fri 16 Feb 2007 13:49

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

kevinherring
Posts: 64
Joined: Wed 04 Jan 2006 15:32

Post by kevinherring » Thu 22 Feb 2007 10:28

it seems that the behaviour is normal:
http://forums.microsoft.com/msdn/showpo ... 6&siteid=1

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Fri 23 Feb 2007 08:05

Thanks for your consideration.

Post Reply