You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.
Hi @lisroach and maintainers, thanks for this useful tool!
A quick story. As I was profiling an application yesterday I kept running into an odd issue - the initial footprint seemed reasonable, but when profiling later into its lifecycle the snapshots showed a list of pd.Series objects. I do create some Series objects in my app, but to my knowledge all refs are discarded, so they get garbage collected. The profiling made me think there's an edge case where they do not get discarded, so I spent the day trying to pinpoint when and why that happens.
Along the way I realised that these extra references are actually getting created by the memory analyzer itself - so the sudden jump of pd.Series objects was a red herring. This seems like a huge oversight - the memory usage of the process being analyzed is being affected by the analyzer itself, so the metrics you get back aren't actually representative of the scanned process.
Here's a repro to support this:
Make a runnable and two scripts to measure+plot its memory usage using ps and gnuplot
# /tmp/show_mem.pltset ylabel "VSZ"set y2label "RSS"set ytics nomirror
set y2tics nomirror inset yrange [0:*]
set y2range [0:*]
plot "/tmp/mem.log" using 3 with lines axes x1y1 title "VSZ", \
"/tmp/mem.log" using 2 with lines axes x1y2 title "RSS"
Run, measure, plot
python run.py &
./script.sh $!# Hit Ctrl+c when process is done
a) let it run to completion
b) run memory_analyzer run $PID periodically
Results
a:
b:
(I stopped running analyzer past the 100s mark)
First snapshot from profiler:
Last snapshot from profiler:
It feels like this could be fixed by piping the metrics retrieved from gdb into the analyzer process and then discarding them from the scanned process, though I don't know if there is an inherent limitation to the underlying tooling that prevents this. Though if this is at all expected, I think the README could use a clear warning sign!
EDIT: looks the like graphs suggest the process starts off using less memory when profiled than not - I think this is actually an issue with the plotting, so ignore the scale - the key aspect is that it grows vs staying static.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi @lisroach and maintainers, thanks for this useful tool!
A quick story. As I was profiling an application yesterday I kept running into an odd issue - the initial footprint seemed reasonable, but when profiling later into its lifecycle the snapshots showed a list of pd.Series objects. I do create some Series objects in my app, but to my knowledge all refs are discarded, so they get garbage collected. The profiling made me think there's an edge case where they do not get discarded, so I spent the day trying to pinpoint when and why that happens.
Along the way I realised that these extra references are actually getting created by the memory analyzer itself - so the sudden jump of pd.Series objects was a red herring. This seems like a huge oversight - the memory usage of the process being analyzed is being affected by the analyzer itself, so the metrics you get back aren't actually representative of the scanned process.
Here's a repro to support this:
ps
andgnuplot
a) let it run to completion
b) run
memory_analyzer run $PID
periodicallyResults
a:
b:
(I stopped running analyzer past the 100s mark)
First snapshot from profiler:
Last snapshot from profiler:
It feels like this could be fixed by piping the metrics retrieved from gdb into the analyzer process and then discarding them from the scanned process, though I don't know if there is an inherent limitation to the underlying tooling that prevents this. Though if this is at all expected, I think the README could use a clear warning sign!
EDIT: looks the like graphs suggest the process starts off using less memory when profiled than not - I think this is actually an issue with the plotting, so ignore the scale - the key aspect is that it grows vs staying static.
The text was updated successfully, but these errors were encountered: