GIDForums  

Go Back   GIDForums > Computer Programming Forums > MS Visual C++ / MFC Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 07-Feb-2006, 05:09
prakhar_jack prakhar_jack is offline
New Member
 
Join Date: Feb 2006
Posts: 5
prakhar_jack is on a distinguished road

CPU Usage


I am running a MFC application and as soon as user interface is displayed the CPU usage reaches 100. Memory usage is not high.
Is it due to some project settings? or something related to code?

Thanks in advance!

Regards
- Jack
  #2  
Old 07-Feb-2006, 07:32
Paramesh's Avatar
Paramesh Paramesh is offline
Regular Member
 
Join Date: Sep 2005
Location: The Milky Way
Posts: 927
Paramesh is a jewel in the roughParamesh is a jewel in the roughParamesh is a jewel in the rough

Re: CPU Usage


Hi Jack,

Welcome to the GIDForums.

Your problem may be mainly due to the code also..
Can you please show some part of it?

Try enabling optimization during compiling.
That may help reducing the cpu usage..

Best Regards,
Paramesh.
__________________

Don't walk in front of me, I may not follow.
Don't walk behind me, I may not lead.
Just walk beside me and be my friend.
  #3  
Old 07-Feb-2006, 21:13
prakhar_jack prakhar_jack is offline
New Member
 
Join Date: Feb 2006
Posts: 5
prakhar_jack is on a distinguished road

Re: CPU Usage


Hi Paramesh!
Thanks for your reply.
Can you please tell me how to enable optimization during compiling?

Regards
Jack
  #4  
Old 07-Feb-2006, 23:25
Paramesh's Avatar
Paramesh Paramesh is offline
Regular Member
 
Join Date: Sep 2005
Location: The Milky Way
Posts: 927
Paramesh is a jewel in the roughParamesh is a jewel in the roughParamesh is a jewel in the rough

Re: CPU Usage


Go to Projects->C++->Optimization.

Then select which optimization you want.
i.e:
Minimize size
Maximize speed or
Full Optimization.

You can also Favor size or speed in the dialog.

But also consider the code you are writing.
Is there an infinite loop?
The CPU usage can be because of your code too...

Regards,
Paramesh.
__________________

Don't walk in front of me, I may not follow.
Don't walk behind me, I may not lead.
Just walk beside me and be my friend.
  #5  
Old 07-Feb-2006, 23:35
prakhar_jack prakhar_jack is offline
New Member
 
Join Date: Feb 2006
Posts: 5
prakhar_jack is on a distinguished road

Re: CPU Usage


Actually I am using VC++ .NET
Earlier in project settings optimization was disabeled, when i m changing it to full optimization it is giving me some compatability error.

Regards
Prakhar
  #6  
Old 07-Feb-2006, 23:50
Paramesh's Avatar
Paramesh Paramesh is offline
Regular Member
 
Join Date: Sep 2005
Location: The Milky Way
Posts: 927
Paramesh is a jewel in the roughParamesh is a jewel in the roughParamesh is a jewel in the rough

Re: CPU Usage


Yes. If you leave the project settings by default, it will show that /RTC1 and /0x are incompatible.

For that, you should change your basic runtime checks to default.
Go to Project->properties->c++->Code generation.
In the basic runtime checks, select default.

And also you should change the format of your debug information.
For that, go to Project->Properties->C++->General.
In that, change the Debug information format as Program Database /Zi

Now the code will be optimized.
Enable Full optimization if you want to have both optimization in speed and size.
If you dont care about the size, then enable Maximize speed only..

Again, I doubt your code... Can you please show some part of your code?

Regards,
Paramesh.
__________________

Don't walk in front of me, I may not follow.
Don't walk behind me, I may not lead.
Just walk beside me and be my friend.
  #7  
Old 08-Feb-2006, 00:05
prakhar_jack prakhar_jack is offline
New Member
 
Join Date: Feb 2006
Posts: 5
prakhar_jack is on a distinguished road

Re: CPU Usage


Ok...i will try that.
About the code...its actually quite big...we r developing a CAD software so it has around 8 projects and each project has many cpp files...so i dont kno which part should i show u!

regards
Prakhar
 
 

Recent GIDBlogObservations of Iraq by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
tcpsvcs.exe causing 100% CPU usage jammm Computer Software Forum - Windows 21 12-Oct-2007 10:33
no output, usage of sqrt and pow micheldenostra C Programming Language 3 25-Sep-2005 17:32
usage of seekg function walrus C++ Forum 2 07-May-2005 15:33
ADT's - Common Usage the_crazyman C Programming Language 3 17-Jan-2005 07:37
PHP/Apache memory usage issue bacchus Apache Web Server Forum 0 18-Aug-2003 12:57

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 11:26.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.