Docs / Settings and looks
Time and memory limits
JSpark stops a Run that stays busy too long or uses too much memory. Here is what each limit counts.
On this page
Both limits are in Settings → Running. A new setting applies from the next Run.
Run the code a moment after you stop typing. Off: only when you press Run (⌘↵). Code that reaches outside — files, network — waits for Run either way.
How long to wait after your last keystroke before running. Shorter feels live; longer runs less often while you think.
Stops code that stays busy this long without a pause, like an endless loop. A server or a timer that waits between events keeps going until you press Stop. In the Timeline, it limits the whole recording.
JSpark+ lets the time limit go up to 10 seconds. JSpark stops at 5.
Stops a run that uses more memory than this, before it slows down your computer. Raise it for large data. In the Timeline, the recording may use up to half of it.
JSpark+ lets a Run use from 256 MB to 8 GB. JSpark runs with 1 GB.
TypeScript
Off: type errors are underlined and the code runs anyway. On: they are printed in the console and nothing runs.
Language for new Snippets
No type checking.
New Snippets run as
Always strict. Uses import, export and top-level await, like a .mjs file. Snippets you already have keep the one they were made with.
The time limit
Time limit stops code that stays busy this long without a pause, such as an endless loop. The default is 5 s. JSpark allows up to 5 s; JSpark+ up to 10 s.
- In a Node Run, only busy time counts. A server, a timer or a file watcher that waits between events keeps running until you press Stop (⌘. or Ctrl+.).
- In the Timeline, the limit counts the whole recording, from start to end.
Most endless loops are stopped sooner, by the loop guard. After 20,000,000 turns of one loop, it stops the Run with an error that names the line. Click the line in the error to go to it.
The memory limit
Memory limit per run stops a Run that uses more memory than this, before it slows down your computer. The default is 1 GB.
- In JSpark, it is fixed at 1 GB. JSpark+ can set it from 256 MB to 8 GB.
- A Node Run never gets more than half of your computer’s memory, whatever the setting says.
- In the Timeline, the recording may use up to half of the limit.
When a Run is stopped
When a limit stops a Run, the console shows a card that names the limit, and keeps everything the Run printed before it. The footer says the same in short: Stopped: busy for 5s, or Stopped: used more than 1 GB.
In the Timeline, a Run stopped by the time limit reads Stopped after 5s. For a Trace that ran out of Steps, see What is not recorded.
Run longer or with more memory JSpark+
The card’s button runs the Snippet again, once, with more:
- Run longer gives it four times the time limit, up to 10 s.
- Run with more memory gives it twice the memory limit, up to 8 GB.
This is for that Run only. To give every Run more, raise the limit in Settings → Running. When a Run that already had more memory is stopped again, the card has no button and asks you to raise the limit in Settings.
Run the code a moment after you stop typing. Off: only when you press Run (⌘↵). Code that reaches outside — files, network — waits for Run either way.
How long to wait after your last keystroke before running. Shorter feels live; longer runs less often while you think.
Stops code that stays busy this long without a pause, like an endless loop. A server or a timer that waits between events keeps going until you press Stop. In the Timeline, it limits the whole recording.
Stops a run that uses more memory than this, before it slows down your computer. Raise it for large data. In the Timeline, the recording may use up to half of it.
TypeScript
Off: type errors are underlined and the code runs anyway. On: they are printed in the console and nothing runs.
Language for new Snippets
No type checking.
New Snippets run as
Always strict. Uses import, export and top-level await, like a .mjs file. Snippets you already have keep the one they were made with.
In JSpark, the buttons are on the card too. Pressing one says what JSpark+ adds, and runs nothing.
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.