When a backtest runs out of memory: choosing a machine size

Why big universes, minute data and large datasets need more memory, how to pick Standard, Large or XL for a backtest or notebook, and what each costs.

  • Compute
  • Backtesting
  • Notebooks
Choosing a machine size for a backtest: cover with a pixel lightning bolt

Most backtests fit comfortably on a small machine: one or a few symbols, daily data, a handful of indicators. But some don't. Ask for 500 stocks at minute resolution over ten years, or load a multi-gigabyte dataset, and the engine has to hold far more in memory. When it runs out, the backtest fails. On MarketsCoder you can give that run a bigger machine instead of cutting the idea down.

The three sizes

The three machine sizes: Standard with 1 CPU and 3 GB of memory, Large with 2 CPUs and 8 GB, XL with 4 CPUs and 16 GB, with their prices per backtest minute
Standard is the default. Large and XL are there for the runs that need them.
  • Standard: 1 CPU, 3 GB memory, 20 GB disk. $0.005 a backtest minute, $0.10 a notebook hour.
  • Large: 2 CPUs, 8 GB, 50 GB. $0.010 a minute, $0.20 an hour.
  • XL: 4 CPUs, 16 GB, 100 GB. $0.025 a minute, $0.50 an hour.

What uses memory

  • Number of symbols. Each subscription keeps its own data, indicators and history. A universe of hundreds adds up fast.
  • Resolution. Minute data is about 390 bars a trading day per US stock, against one for daily.
  • History requests. Asking for years of minute history at once loads it all.
  • Large custom data. A big uploaded dataset, especially one read in full.
  • Your own objects. Lists or dataframes that grow every bar and are never trimmed.

Choosing one

Start on Standard. If a run fails for memory, or takes much longer than you can wait, try Large; keep XL for the biggest universes and datasets. More CPUs help most when the work can run in parallel, such as large universe selection, so a bigger machine isn't always faster for a simple strategy, but it is never short of memory where Standard was.

Pick the size next to Run backtest in the editor, or in a notebook's toolbar. Your choice is remembered in your browser for that project.

See what's running: the Compute page

The Compute page in the app shows everything running on your account at once: backtests, notebook kernels, live and paper deployments and AI agents, each with its machine and how long it has run, against how many of each can run at the same time. It's the quickest way to find a forgotten notebook or see why a new backtest is queued.

You pay only while it runs

Machines start when there's work and stop when there isn't, so there's nothing to rent or switch off. A ten-minute backtest on XL costs $0.25. Full prices are on the pricing page.

Frequently asked questions

Why did my backtest run out of memory?

Usually because it holds a lot of data at once: many symbols, minute or tick resolution, long indicator histories, or large custom datasets. A bigger machine gives it more memory.

What machine sizes are available?

Standard (1 CPU, 3 GB memory, 20 GB disk), Large (2 CPUs, 8 GB, 50 GB) and XL (4 CPUs, 16 GB, 100 GB).

How much do bigger machines cost?

Backtests are $0.005 a minute on Standard, $0.010 on Large and $0.025 on XL. Notebook kernels are $0.10, $0.20 and $0.50 an hour. You pay only while they run.

Share on XLinkedIn

Test your own idea on point-in-time data.

Write a strategy in Python or describe it to the AI assistant, and see a full backtest report in minutes.

Get started