This program reproduces both behaviours. from collections import defaultdict import gc import os import pulsar import subprocess import time NUM_MESSAGES = 500 ...