Skip to content

JavaScript API Limits

Overview

Jetpack has a job to do, and limited resources with which to do it.

As a result, the tracker will:

  • Only let your JavaScript code run for a limited time before it is canceled
  • Only let your JavaScript code use a limited amount of memory before it is canceled

Bounded Time

Your script must complete within 1 second.

This is actually a lot of time in computer-terms.

See the Editor output for an indication of your script's run duration.

If you think this is too restrictive for your purposes, please let's discuss.

Bounded Memory

Purposefully limited amount of memory available to work within.

See the Editor output for an indication of how much available memory you are using with your program.

Exceed the memory and the tracker reboots.

This is due to technical limitations.

If you're finding the available memory too limiting, please let's discuss.

Avoid logging crazy amounts of data

eg 200+ lines, it gets queued up in memory before display.

Editor Input Length

Both the Message Definition and JavaScript inputs should be kept to less than 100 lines apiece, per slot.

Save often.

Observing Limits

Take note of the output of the Editor when you test your program. You will see an indication of how your script performs before you fly it.

A working script during testing is not a guarantee!

If your sensor fails during flight, and the script slows down trying to communicate with it, that won't be known in advance.

That, and other conditions, can lead to differences in what happens in flight vs what happens during testing.

Failures like that are not common, though, so testing on the ground is still the best approach!