Red Gate forums :: View topic - Extremely Slow Asssembly Reflection under Memory Profile
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
ANTS Memory Profiler 7
ANTS Memory Profiler 7 forum

Extremely Slow Asssembly Reflection under Memory Profile

Search in ANTS Memory Profiler 7 forum
Post new topic   Reply to topic
Jump to:  
Author Message
michael.russell



Joined: 26 Aug 2013
Posts: 4

PostPosted: Mon Aug 26, 2013 11:07 pm    Post subject: Extremely Slow Asssembly Reflection under Memory Profile Reply with quote

Hi

We have an issue when profiling our application under Ants Memory Profiler. on start-up we have a procedure that scans all types in an assembly.

foreach (Type type in assembly.GetTypes()) {
...
}

Outside of the memory profiler this takes about 10 seconds, but when memory profiling, it takes about 50 minutes. assembly.GetTypes is what takes the time as I have tried putting the result into an array before the foreach.

It doesn't seem to matter whether it is .net 3.5 or .net 4.0.

This issue does not happen in the Ants performance profiler.

Has anyone had a similar issue and if so, how can we work around this.

Thanks.
Back to top
View user's profile Send private message
james.billings



Joined: 16 Jun 2010
Posts: 1123
Location: My desk.

PostPosted: Wed Aug 28, 2013 12:02 pm    Post subject: Reply with quote

Thanks for your post.

We've not seen this behaviour before, unfortunately. If you're using the v8 Beta, then we're aware this can slow things down a little if unmanaged profiling is enabled but nowhere near to the extent you are seeing.

Another theory is that there are PDB files present for the assemblies in question, and source-code location these refers to is on a network drive / non-existent drive-letter on the profiling machine etc. Another possibility is your AV software doing something unusual when the assemblies are loaded so it could be worth turning that off.

One of our developers did do a quick test that does something similar on mscorlib, but the difference was negligible (just under a second without the profiler, around 2s with, and 3s with unmanaged enabled in AMP8.
Back to top
View user's profile Send private message
michael.russell



Joined: 26 Aug 2013
Posts: 4

PostPosted: Thu Aug 29, 2013 2:06 am    Post subject: Reply with quote

We are using version 7.4. All of the application is on a local hard drive on my computer. I don't have any AV software running.

It could be related to the size of the assembly is quite large, it is 16mb in size with a 27mb PDB file, there are about 6000 types in it.
Back to top
View user's profile Send private message
james.billings



Joined: 16 Jun 2010
Posts: 1123
Location: My desk.

PostPosted: Thu Aug 29, 2013 7:34 am    Post subject: Reply with quote

That's possibly the problem then- we do run code for each type loaded so with that many it could account for the delay, but it does sound pretty slow.
Is it possible we could obtain the assembly along with a simple calling app to test here and see if we get the same? If so, I can create you some FTP space to put it in.
Back to top
View user's profile Send private message
michael.russell



Joined: 26 Aug 2013
Posts: 4

PostPosted: Thu Sep 05, 2013 5:43 am    Post subject: Reply with quote

This problem only occurs when running in 64-bit mode, using 32-bit mode the application starts up in 3 minutes 30 seconds, in 64-bit mode, it takes about 50 minutes.

I have confirmed this by changing the platform target back and forth.
Back to top
View user's profile Send private message
michael.russell



Joined: 26 Aug 2013
Posts: 4

PostPosted: Thu Sep 05, 2013 5:44 am    Post subject: Reply with quote

For memory profiling since our applications deal with large amounts of data, using 32-bit mode is not a good workaround for us.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group