Created
March 14, 2023 08:32
-
-
Save tot-ra/3b096e8e051eaa6733660509ec541a23 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import psutil | |
import threading | |
if is_local_env(): | |
def print_memory_usage(): | |
process = psutil.Process() | |
while True: | |
logger.debug("Memory usage: %d mb", process.memory_info().rss / (1024 * 1024)) | |
time.sleep(1) | |
memory_thread = threading.Thread(target=print_memory_usage) | |
memory_thread.daemon = True | |
memory_thread.start() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment