Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

show memory used by this process #457

Merged
merged 1 commit into from
Nov 14, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions apstools/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
~quantify_md_key_use
~redefine_motor_position
~replay
~rss_mem
~run_in_thread
~safe_ophyd_name
~select_live_plot
Expand Down Expand Up @@ -69,6 +70,7 @@
import ophyd
import os
import pandas
import psutil
import pyRestTable
import re
import smtplib
Expand Down Expand Up @@ -590,6 +592,11 @@ def decreasing_time_sorter(run):
callback(k, doc) # play it through the callback


def rss_mem():
"""return memory used by this process"""
return psutil.Process(os.getpid()).memory_info()


def run_in_thread(func):
"""
(decorator) run ``func`` in thread
Expand Down