CPU usage 100%

 
I am experiencing a problem whereby task manager shows CPU to be nearly 100% occupied with (demo account) terminal.exe. This only occurrs when the EA has been running for a long time (2-3 weeks). Logs show no activity at this time and trade profits are changing on ticks as expected. Memory usage is up to approx 30,000k - deletion of old logs, changing history to today etc makes no difference. disabling the expert changes nothing. closing the platform and restarting seems to be the only cure.
 
BigAl wrote >>
I am experiencing a problem whereby task manager shows CPU to be nearly 100% occupied with (demo account) terminal.exe. This only occurrs when the EA has been running for a long time (2-3 weeks). Logs show no activity at this time and trade profits are changing on ticks as expected. Memory usage is up to approx 30,000k - deletion of old logs, changing history to today etc makes no difference. disabling the expert changes nothing. closing the platform and restarting seems to be the only cure.

Check in Task Manager to see if you have a very large Sychost file, these are crearted in testing/optimising and take on a life of their own.

if so you can gamble and delete them, pretty iffy, there ma be several and one may be doing someting useful.

You can also do a google search for Software fixes. It's been some time since I had that problem and I've forgotten which one I used.

Good Luck

Keith

 
kminler wrote >>

Check in Task Manager to see if you have a very large Sychost file, these are crearted in testing/optimising and take on a life of their own.

if so you can gamble and delete them, pretty iffy, there ma be several and one may be doing someting useful.

You can also do a google search for Software fixes. It's been some time since I had that problem and I've forgotten which one I used.

Good Luck

Keith

Thanks for the info but no joy. the EA is running on a remote server (2003) and it is terminal.exe itself that is creating the near 100% CPU usage. If I close the metatrader session CPU usage goes back to normal. Restarting the session brings back the 100% again. So far I have found that if I disable the expert, close all the data files it has created (about 20 very very small data files) then close, restart metatrader and enable the EA again it restarts and remakes the data files. The CPU usage reverts to being as low as you would expect (Max 6%).

 
Scheduled task to auto close and open the terminal

I have found that it is a good idea to close the trading terminal's down and restart them regularly to keep things running smoothly.
I'm sure this will solve your cpu 100% problem.
I have set up a scheduled task in windows to do this every day.
Inside the attached zip file you will find 2 files
Save the 2 attached files to your PC.
endprograms.txt - will close terminals
startterminal.txt - will open terminals

Open the file endprograms.txt with notepad:
You will see in the file there is a command " taskkill /im terminal.exe ", when this file is run it will close all running instances of metatrader "terminals".
Save this file with the extension .BAT
You can now try this by double clicking the file from windows explorer.

Open the file startterminal.txt with notepad:
The location and the .exe file to be run must be included in this file.
The start "1" "C:\Program Files (x86)\MetaTrader1\terminal.exe" must be changed for the location of the terminal.exe you want to open.
You can find the location of your terminal.exe file by right clicking on it in windows explorer and selecting properties.
More than 1 start command can be issued by including a new command line starting with " start "2" " etc.
When you have finished the changes save the file with the extension .cmd
You can test this by double clicking the file from windows explorer.

Set up a scheduled task:
Go to Start/Accessories/System Tools/Scheduled tasks/Add Scheduled task
Browse to the location of the endprograms.BAT and set the scheduler to run the file as you require. Then set up a scheduled task to run the startterminal.cmd a minute or 2 later.
 
derekc1 wrote >>
Scheduled task to auto close and open the terminal

I have found that it is a good idea to close the trading terminal's down and restart them regularly to keep things running smoothly.
I'm sure this will solve your cpu 100% problem.
I have set up a scheduled task in windows to do this every day.
Inside the attached zip file you will find 2 files
Save the 2 attached files to your PC.
endprograms.txt - will close terminals
startterminal.txt - will open terminals

Open the file endprograms.txt with notepad:
You will see in the file there is a command " taskkill /im terminal.exe ", when this file is run it will close all running instances of metatrader "terminals".
Save this file with the extension .BAT
You can now try this by double clicking the file from windows explorer.

Open the file startterminal.txt with notepad:
The location and the .exe file to be run must be included in this file.
The start "1" "C:\Program Files (x86)\MetaTrader1\terminal.exe" must be changed for the location of the terminal.exe you want to open.
You can find the location of your terminal.exe file by right clicking on it in windows explorer and selecting properties.
More than 1 start command can be issued by including a new command line starting with " start "2" " etc.
When you have finished the changes save the file with the extension .cmd
You can test this by double clicking the file from windows explorer.

Set up a scheduled task:
Go to Start/Accessories/System Tools/Scheduled tasks/Add Scheduled task
Browse to the location of the endprograms.BAT and set the scheduler to run the file as you require. Then set up a scheduled task to run the startterminal.cmd a minute or 2 later.

Thanks, that sounds like a good workaround so I will use it - however, I still think there must be a problem in the platform.

 

Hi Guys

I think leaving the platform running after markets are closed is not a good idea the brokers are always switching things on and off with tests. This can screw up the platform and give dodgy data. It sounds like a good idea to reset the platform everyday.

 
BigAl:
I am experiencing a problem whereby task manager shows CPU to be nearly 100% occupied with (demo account) terminal.exe. This only occurrs when the EA has been running for a long time (2-3 weeks). Logs show no activity at this time and trade profits are changing on ticks as expected. Memory usage is up to approx 30,000k - deletion of old logs, changing history to today etc makes no difference. disabling the expert changes nothing. closing the platform and restarting seems to be the only cure.

I had the same problem on my server : it comes from your EA. Don't search anywhere except in your EA....


Look at your EA code. I'm sure you have a bugged loop in your EA, in init() or start() functions. Ex : a while loop running with bad variables or whatever.


Good search,

Dam.

 
damtoul:

Look at your EA code. I'm sure you have a bugged loop in your EA, in init() or start() functions. Ex : a while loop running with bad variables or whatever.

Yes, otherwise know as an infinite loop... triggered by some rare event which is probably why it manifested itself only after 2-3 weeks.

 
blogzr3:

Yes, otherwise know as an infinite loop... triggered by some rare event which is probably why it manifested itself only after 2-3 weeks.

Well I have my EA running on my brand new desktop and on a VPS. It is bogging both down and running CPU usage up to 100%. VPS provider is rebooting server or whatever else he's doing. 

Seems only way to speed up my PC is to shut down MT4 and the EA.

I have my coder looking at the EA code.

 
Reduce bars on chart to something reasonable like 5k
Reason: