Dukascopy
 
 
Wiki JStore Search Login

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

    Submit JForex API bug reports in this forum only.
    Submit Converter issues in Converter Issues.
    Off topics are strictly forbidden.

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

Strategy tester: java.lang.OutOfMemoryError: Requested array size exceeds VM limit
 Post subject: Strategy tester: java.lang.OutOfMemoryError: Requested array size exceeds VM limit Post rating: 0   New post Posted: Wed 03 Sep, 2014, 22:02 

User rating: 0
Joined: Sat 04 Jan, 2014, 11:43
Posts: 2
Location: Nigeria, Abuja
Please I got this error message while I was trying to backtest a strategy on historical tester:

20:26:47 Strategy tester: java.lang.OutOfMemoryError: Requested array size exceeds VM limit

However, the strategy runs on live account without any error message. But I want to do extensive testing on historical tester.

I am not sure but I think the error is coming from the array generated by the universal indicator calculation method ... calculateIndicator by candle interval.


 
 Post subject: Re: Strategy tester: java.lang.OutOfMemoryError: Requested array size exceeds VM limit Post rating: 2   New post Posted: Thu 04 Sep, 2014, 15:16 
User avatar

User rating: 7
Joined: Tue 28 Feb, 2012, 09:45
Posts: 45
Location: JapanJapan
Hi support team,
I got same error on historical tester.
I think, Filter.WEEKENDS(or Filter.ALL_FLATS) is cause of this trouble.

Please check this sample strategy.
package jforex;

import com.dukascopy.api.*;
import java.util.Calendar;
import java.util.Locale;
import java.util.TimeZone;
import java.text.SimpleDateFormat;
import java.util.List;

public class GetBarsTest implements IStrategy {
    //@Configurable(value="Instrument")
    public Instrument instrument = Instrument.EURUSD;
    //@Configurable(value="Period")
    public Period period = Period.FIVE_MINS;
   
    public void onStart(IContext context) throws JFException {
        IConsole console = context.getConsole();
        IHistory history = context.getHistory();
        console.getNotif().println("Test Started : " + this.getClass().getName());
        Calendar cal =  Calendar.getInstance(TimeZone.getTimeZone("Europe/London"), Locale.US);
        cal.set(2014, 7, 24, 22,0,0);
        long startTime = history.getBarStart(period, cal.getTimeInMillis());
        SimpleDateFormat sdf = new SimpleDateFormat("EEE dd MMM yyyy HH:mm z", Locale.US);
        sdf.setTimeZone(cal.getTimeZone());
        console.getInfo().println("StartTime = " + sdf.format(startTime));
        List<IBar> bars;
        for(int i = -1; ++i < 3;){
            try{
                console.getWarn().println("CHECK " + i + ": getBars(EURUSD, FIVE_MINS, BID, " + Filter.values()[i] + ", 26, StartTime, 0).....");
                bars = history.getBars(instrument, period, OfferSide.BID, Filter.values()[i], 26, startTime, 0);
            }catch(Exception e){
                context.stop();
                console.getErr().println("CHECK " +  i + ": Faild");
                throw e;
            }
            console.getInfo().println("CHECK " + i + ": Succeeded!");
        }
    }

    public void onAccount(IAccount account) throws JFException {
    }

    public void onMessage(IMessage message) throws JFException {
    }

    public void onStop() throws JFException {
    }

    public void onTick(Instrument instrument, ITick tick) throws JFException {
    }
   
    public void onBar(Instrument instrument, Period period, IBar askBar, IBar bidBar) throws JFException {
    }
}

Result(jnlp file<java version="1.6+" initial-heap-size="256m" max-heap-size="1024m"/>) is this.
Image
What is this Error?
If memory serves me right, This error didn't exist before this summer.
Do you have any plans to fix a problem of current platform?
Or, Should I forget that and move to the JForex4?


Attachments:
GetBarsTest.java [2.02 KiB]
Downloaded 368 times
ResultSample.jpg [111.85 KiB]
Downloaded 612 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: Strategy tester: java.lang.OutOfMemoryError: Requested array size exceeds VM limit Post rating: 0   New post Posted: Fri 05 Sep, 2014, 08:31 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
We managed to replicate this, it will be fixed as soon as available.


 

Jump to:  

  © 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