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
[x ] I have searched the issues of this repo and believe that this is not a duplicate.
OS version and name: Debian GNU/Linux 12 (bookworm)
Pendulum version: 3.0.0
Issue
In pendulum 3.0.0 it is allocating a large amount of memory for the library (up to 1gb). In prior versions, memory allocation was usually less than 2 mb for the same import. Possibly due to rust re-write?
tested/validated using memray with both pendulum==3.0.0 and pendulum==2.1.2
I think one first step would be to see if anyone else sees the same results I get when profiling. I tested in windows/linux and saw similar results, but would be great to confirm its not just a "me" issue.
@cody-scott any chance you could test the latest master branch? I have merged some changes to the Rust-Python code and I suspect it might be the answer to this issue (at least partially)
I am running macOS Sequoia 15.3.1.
I am using python 3.12
I have tested with versions 3.0.0a1, 3.0.0b1, and 3.0.0. The high memory usage appears to correlate with the new Rust extension introduced in 3.0.0b1.
I've attached an archive file containing flamegraphs for each version, with comparisons across different malloc implementations, along with a test Python script used for profiling.
Activity
[-]High memory allocation in pendulum 3.0+[/-][+]High memory allocation in pendulum 3.0[/+]Secrus commentedon Nov 21, 2024
That is troubling. I don't know too much about Rust, but I am open to accepting PRs that implement improvements on that front.
cody-scott commentedon Nov 22, 2024
I think one first step would be to see if anyone else sees the same results I get when profiling. I tested in windows/linux and saw similar results, but would be great to confirm its not just a "me" issue.
protoss-player commentedon Nov 27, 2024
Actually, I got the exactly same memory consumption issue with
memrayand ended up here.s-rigaud commentedon Dec 16, 2024
I'm getting segfault inside a docker container as
fastapi_cacheis based overpendulumand memory consumption is way higher than before.Secrus commentedon Dec 17, 2024
@cody-scott any chance you could test the latest master branch? I have merged some changes to the Rust-Python code and I suspect it might be the answer to this issue (at least partially)
rudolfix commentedon Jan 13, 2025
this is because
mimallocis used instead of of default memory allocator. but I betmemrayis giving you wrong results.bloomberg/memray#577
I can't see increased memory usage otherwise, not in the process stat, not when using valgrind.
GriffinBoris commentedon Feb 21, 2025
I am seeing the same issue in version
3.0.0I am running macOS Sequoia 15.3.1.
I am using
python 3.12I have tested with versions
3.0.0a1,3.0.0b1, and3.0.0. The high memory usage appears to correlate with the new Rust extension introduced in3.0.0b1.I've attached an archive file containing flamegraphs for each version, with comparisons across different malloc implementations, along with a test Python script used for profiling.
Archive.zip
For a quick reference here is

3.0.0a1withmalloc:Here is

3.0.0b1withmalloc:Here is the reference of the script:
This continues into
3.0.0regardless of allocator.AngerM commentedon Mar 10, 2025
Is disabling of mimalloc actually working? At least in the default mimalloc is just grabbing 1GB immediately:
levzem commentedon Mar 12, 2025
I am seeing similar numbers as well
ashb commentedon Apr 1, 2025
Thanks we will take a look at this soon. (Myself: once Airflow 3.0 is out and things have calmed down a bit)
ashb commentedon Apr 1, 2025
This should be fixed by #871 which removes mimalloc (as it's benefits don't make sense for our usage patterns anyway!)