Dukascopy
 
 
Wiki JStore Search Login

Attention! Read the forum rules carefully before posting a topic.

    Try to find an answer in Wiki before asking a question.
    Submit programming questions in this forum only.
    Off topics are strictly forbidden.

Any topics which do not satisfy these rules will be deleted.

Jforex Client API - high cpu usage
 Post subject: Jforex Client API - high cpu usage Post rating: 0   New post Posted: Thu 04 Jul, 2013, 08:50 

User rating: 0
Joined: Tue 25 Jun, 2013, 15:15
Posts: 14
I'm trying to use the API to fetch account history from several accounts, I have discovered that the IClient is a singleton (which not making any sense), so it means I need to run my app in a separate process for each account - running a single instance causes the cpu to spike to 70%, 2 instances causes it to jump to 100 - in other words it's not usable.

Is this normal? I've discovered lots of bugs with your API as well.

Tested on core i3- 2120 8gb ram, windows 7 64bit.
The logic of the app is pretty simple - connect to account, subscribe to symbols, get history, disconnect.

Please advise.


 
 Post subject: Re: Jforex Client API - high cpu usage Post rating: 0   New post Posted: Thu 04 Jul, 2013, 09:00 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
sereja wrote:
I have discovered that the IClient is a singleton (which not making any sense)
It is a system restriction by design.
sereja wrote:
running a single instance causes the cpu to spike to 70%, 2 instances causes it to jump to 100 - in other words it's not usable.
Please provide a program which replicates the case.
sereja wrote:
Is this normal? I've discovered lots of bugs with your API as well.
Report them here: viewforum.php?f=16


 
 Post subject: Re: Jforex Client API - high cpu usage Post rating: 0   New post Posted: Thu 04 Jul, 2013, 09:52 

User rating: 0
Joined: Tue 25 Jun, 2013, 15:15
Posts: 14
code attached.
I've also attached JRockit dump so you can see what exactly causes the cpu to spike.

using version JForex-API-2.7.9.


Attachments:
flight_recording_2013-07-04_08_49_42.7z [800.83 KiB]
Downloaded 329 times
JForexClient - Copy.7z [9.15 KiB]
Downloaded 322 times
DISCLAIMER: Dukascopy Bank SA's waiver of responsability - Documents, data or information available on this webpage may be posted by third parties without Dukascopy Bank SA being obliged to make any control on their content. Anyone accessing this webpage and downloading or otherwise making use of any document, data or information found on this webpage shall do it on his/her own risks without any recourse against Dukascopy Bank SA in relation thereto or for any consequences arising to him/her or any third party from the use and/or reliance on any document, data or information found on this webpage.
 
 Post subject: Re: Jforex Client API - high cpu usage Post rating: 0   New post Posted: Thu 04 Jul, 2013, 11:09 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
By a problem-replication program we mean a single-file, IDE-independent java program which replicates the case.


 
 Post subject: Re: Jforex Client API - high cpu usage Post rating: 0   New post Posted: Thu 04 Jul, 2013, 12:44 

User rating: 0
Joined: Tue 25 Jun, 2013, 15:15
Posts: 14
please check this files


Attachments:
src.7z [2.06 KiB]
Downloaded 322 times
DISCLAIMER: Dukascopy Bank SA's waiver of responsability - Documents, data or information available on this webpage may be posted by third parties without Dukascopy Bank SA being obliged to make any control on their content. Anyone accessing this webpage and downloading or otherwise making use of any document, data or information found on this webpage shall do it on his/her own risks without any recourse against Dukascopy Bank SA in relation thereto or for any consequences arising to him/her or any third party from the use and/or reliance on any document, data or information found on this webpage.
 
 Post subject: Re: Jforex Client API - high cpu usage Post rating: 0   New post Posted: Fri 05 Jul, 2013, 17:23 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
For us the CPU usage during the strategy run was 7 to 18% and we managed to launch without a problem 6 instances of the program at a time -with each next instance the average CPU usage of a program instance dropped. We tested on a 3 core workstation with other parameters just about the same as yours.


 

Jump to:  

cron
  © 1998-2025 Dukascopy® Bank SA
On-line Currency forex trading with Swiss Forex Broker - ECN Forex Brokerage,
Managed Forex Accounts, introducing forex brokers, Currency Forex Data Feed and News
Currency Forex Trading Platform provided on-line by Dukascopy.com