Prevent Out-of-Memory Crashes (Tutorial)
Support

Prevent Out-of-Memory IDE Crashes (Tutorial)

Last updated 2026-04-15

Abbreviations Key

GB

gigabyte [decimal base]

GiB

gigibyte [binary basee]

HISE

Human Immune System Explorer

IDE

integrated development environment

OS

operating system

SDK

software development kit

At a Glance

If you’re working with large datasets, you can monitor and cap your IDE’s memory usage so that your session doesn’t crash. Use the SDK methods outlined here to set limits and to check memory status periodically. (For example, after a large ingest or transformation, you might want to know how close you are to maxing out your IDE’s capacity.) As an additional safeguard, you can optionally add a memory ceiling at the OS level. 

When to Use This Feature

Use this feature when you’re running analyses that could exceed your IDE’s available memory and cause session crashes.

Description

You can check memory usage by calling the get_memory_usage() SDK method. You can set limits either by calling the set_memory_limit() SDK method or by using prlimit, a Linux command that lets you start a program with constraints on resources like memory or CPU time. If you’re comfortable using the terminal and want an extra safeguard against crashes, try the latter option.

Both kinds of limits reset when you restart, so you’ll need to configure them again each time you start a new IDE session.

Instructions

Check current memory usage

Use the SDK to check the amount of memory your IDE is using. 

  1. Navigate to HISE, and use your organizational email address to sign in.

  2. Open an IDE. For instructions, see Create Your First HISE IDE (Tutorial) .

  3. To import hisepy, enter the following code into a new cell in your IDE:
    # Import the Python SDK to enable programmatic access to HISE functions

    import hisepy as hp

  4. To check your memory usage, run the following command:
    hp.get_memory_usage()

Set a memory limit

Set and adjust the memory limit for a given notebook. As a starting point, set a threshold of about 75% of your IDE’s configured memory, as shown in the following examples:


  • 4 GB IDE → 3 GB limit

  • 8 GB IDE → 6 GB limit

  • 16 GB IDE → 12 GB limit

  1. In a new cell of the same notebook you used in Step 1, enter the following command:


    #Set a 6 GB memory limit for this session
    hp.set_memory_limit(limit_gb=6)


  2. (Optional) Adjust the limit up or down, depending on the complexity of your analysis and the number of other notebooks or applications you have open.

(Optional) Set an OS-level ceiling

  1. In your IDE, open a terminal window.

  2. To define a memory limit, enter the following command:
    # Example: 4 GiB limiit
    MEM_LIMIT=$((4 * 1024 * 1024 * 1024))
    prlimit --as="$MEM_LIMIT" -- COMMAND_TO_BE_RUN


NOTE
Any process you start under prlimit uses that memory ceiling only for as long as it’s running. You must reapply the limit each time you restart your IDE.


Related Resources

Use the Pixi Environment

Best Practices for HISE IDE Users

Use HISE SDK Methods and Get Help in the IDE