MenuTroubleshooting / My Run was stopped

Docs / Troubleshooting

My Run was stopped

JSpark stops a Run that stays busy too long, uses too much memory, or loops too many times. The console says which.

On this page

Which limit stopped it

Read the console. A limit prints a card that names it, and the footer says the same. What the Run printed before it was stopped stays above the card.

The time limit

JSpark stops code that stays busy without a pause for longer than the time limit, 5 seconds by default. This is usually an endless loop. A server, or a timer that waits between events, is not busy: it keeps running until you press Stop or ⌘. or Ctrl+..

The time limit stopped the Run, which never paused.

In the Timeline, the time limit covers the whole recording, and the card says Stopped after 5s.

The memory limit

JSpark stops a Run that uses more memory than the memory limit, 1 GB by default, before it slows down your computer. In the Timeline, the recording may use up to half of it.

The memory limit stopped the Run at 1 GB.

The loop guard

A loop that repeats 20,000,000 times is stopped by the loop guard. It throws aRangeError that names the line. Click the line in the error to go to it.

The loop guard names line 2; the fixed loop prints done.

Give it more

First check the code. A Run that is stopped is most often a loop that never ends, or data that keeps growing.

If the code is right and needs more, change the limit in Settings → Running:Time limit or Memory limit per run. In JSpark, the time limit goes up to 5 seconds, and the memory limit is fixed at 1 GB. The loop guard has no setting. See Time and memory limits.

Run longer or with more memory JSpark+

In JSpark+, the button on the card runs the Snippet again with more, for that Run only:

  • Run longer gives it four times the time limit, up to 10 seconds.
  • Run with more memory gives it twice the memory limit, up to 8 GB.

The next Run has the limit in Settings again. In JSpark+, the time limit goes up to 10 seconds and the memory limit from 256 MB to 8 GB. In JSpark, the buttons say that this needs JSpark+.

Run longer lets the Run finish; then the time limit is raised in Settings.

The pictures show JSpark on a Mac. On Windows, the window looks a little different and uses Ctrl for ⌘, but everything works the same way.

Esc

Type to search every docs page.