Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Launching process via string args seems to not work #90

@kylesayrs

Description

@kylesayrs

Issue

The documentation claims that you can pass a command to psrecord to launch and attach to that process. However, doing so seems to fail and produces different results than if the process is launched in a separate shell and attached to manually.

Environment

Operating System: Linux-5.15.0-91-generic-x86_64-with-glibc2.35
Python Version: 3.10.12 (main, May 27 2025, 17:12:29) [GCC 11.4.0]
psrecord 1.4
psutil 7.0.0
matplotlib 3.10.3

Launching from within a venv virtual environment

Steps to reproduce

memory_eater.py
import time
import tqdm

print("Eating memory")
a = []
for i in tqdm.tqdm(range(10_000)):
    a.append([0 for _ in range(i)])
    time.sleep(0.001)
print("Done eating memory")
psrecord "python3 memory_eater.py" --log eaterlog.txt

eaterlog.txt

python3 memory_eater.py &
psrecord XXXXXX --log eaterlog_2.txt 

eaterlog_2.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions