Skip to content

Commit

Permalink
fix: memory profiler psutil api updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Lewiscowles1986 committed Mar 31, 2024
1 parent cc6cc58 commit 542b561
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,15 @@ jobs:
echo ""
echo ""
echo "#"
echo "# Basic using example with experimental memory tracking"
echo "# Basic using example with experimental memory tracking (without psutil)"
echo "#"
python scripts/pycallgraph --memory graphviz -- examples/graphviz/basic.py
echo ""
echo ""
echo ""
pip install psutil
echo "#"
echo "# Basic using example with experimental memory tracking (with psutil)"
echo "#"
python scripts/pycallgraph --memory graphviz -- examples/graphviz/basic.py
echo ""
Expand Down
2 changes: 1 addition & 1 deletion pycallgraph/memory_profiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
def _get_memory(pid):
process = psutil.Process(pid)
try:
mem = float(process.get_memory_info()[0]) / (1024 ** 2)
mem = float(process.memory_info()[0]) / (1024 ** 2)
except psutil.AccessDenied:
mem = -1
return mem
Expand Down

0 comments on commit 542b561

Please sign in to comment.