Skip to content

Instantly share code, notes, and snippets.

View stenlarsson's full-sized avatar

Sten Larsson stenlarsson

View GitHub Profile
@stenlarsson
stenlarsson / dtruss.log
Last active April 21, 2022 08:12
sudo dtruss -b 100m $(rbenv which ruby) arrow-test.rb 2> dtruss.log
This file has been truncated, but you can view the full file.
SYSCALL(args) = return
access("/AppleInternal/XBS/.isChrooted\0", 0x0, 0x0) = -1 Err#2
bsdthread_register(0x1A9945084, 0x1A9945078, 0x4000) = 1073742303 0
shm_open(0x1A9809F5D, 0x0, 0x6E6F6973) = 3 0
fstat64(0x3, 0x16B3417A0, 0x0) = 0 0
mmap(0x0, 0x4000, 0x1, 0x40001, 0x3, 0x0) = 0x104BD0000 0
close(0x3) = 0 0
ioctl(0x2, 0x4004667A, 0x16B34184C) = -1 Err#25
ioctl(0x2, 0x40487413, 0x16B341850) = -1 Err#25
mprotect(0x104BDC000, 0x4000, 0x0) = 0 0
@stenlarsson
stenlarsson / arrow_memory_leak.py
Last active May 24, 2022 12:00
arrow_test_csv.rb creates a CSV with random data used by arrow_memory_leak.rb
import gc
import resource
from pyarrow import csv
import sys
def print_stats():
gc.collect()
print(f'{sys.getrefcount(object)} objects, {resource.getrusage(resource.RUSAGE_SELF).ru_maxrss / (1024*1024)} MB')
def main():