Open lspinheiro opened 3 years ago
Sounds like a bug to me ... unfortunately I don't have a solution, but would gladly take pull requests if you come across a solution or workaround
Hi!
I spotted some consequent memory increase due to memory_profiler
in this issue: https://github.com/PyFPDF/fpdf2/issues/641#issuecomment-1465730884 It contains some minimal code to reproduce the problem.
I'm not sure if this is really a leak, or even a bug, but just importing the library increases the RSS memory usage by 15MiB to 25MiB.
I have been using the
memory_usage
function to get the peak usage of an ETL job but noticed it actually caused increased memory usage.It looks like it creates a copy of the inputs to the function being profile causing some duplication in memory. My function simply does some merging and processing of some columns but here is a script very close to my testing:
Sample script to reproduce
Without
memory_usage
With
memory_usage
Is this a bug or expected behaviour? Is there any way to avoid this?