cpu usage - High CPU utilization - VB.NET -


we facing issue vb.net listeners utilizes high cpu (50% 70%) in server machine running. listeners using threading concept , used filesystemwatcher class keep monitoring file renaming pointing 1 common location. both console applications , scheduled jobs running day. can please me out how control cpu utilization filesystemwatcher class?

this depend on code running.

for instance if have timer interval of 10ms work every 2 minutes , on each timer interval lot of checking take lot of cpu nothing.

if using multiple threads , 1 looping waiting 2nd release lock (monitor.tryenter()) again may taking cpu. can avoid putting waiting thread monitor.wait() , when busy thread finished monitor.pulse().

apart general advise above, if post key parts of code or profile results may able more.

if looking profiler use redgates ants profiler (costs free trial) , give results, haven't used other compare (and in no way affiliated redgate) others may better.

hope of help.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -