Open echai58 opened 4 months ago
Can you do the following, change your script to sleep first for 30 secs, then create the table and then sleep again for 30 secs, then start writing in a loop those 50 times?
I think the slow increase in resident size might just be because at every write you update the table state at the end of the commit since it includes more info now.
here's the mem graph with the 30 second sleeps:
@ion-elgreco
This is a graph for 250 merges:
and for 250 appends:
The slow increase in the 250 appends I think would correspond to the increased table state metadata. But the merge memory use rises much faster, so maybe it is something particular with merges?
Merge operations probably holds more info, so this looks normal to me
@ion-elgreco The _last_checkpoint
file says:
{"size":360,"size_in_bytes":75770,"version":100}
for the last checkpoint after running a script with 1000 merges resulting in the following memory increase:
The amount the memory increased seems much larger than the metadata
@echai58 the checkpoint is compressed and also would never translate 1:1 from disk to mem afaik
@ion-elgreco profiling a script that just instantiates the same delta table gives the following:
~13 mb , which is still much less than the >100mb seen from the merge script
Has there been any progress on this? I'm experiencing the same issue with merges.
I have a theory that this might be related to some of the performance issues that @roeap and I were hunting after this week. He's got some fixes in mind after which we can look into this specific issue some more
Environment
Binding: python
Bug
What happened: We're noticing constantly rising memory in our processes that write to deltalake. I wrote a minimal reproduction that loops and writes to deltalake, and the memory usage seems to indicate a memory leak.
What you expected to happen: Memory to be reclaimed after writes.
How to reproduce it: This is my script I tested with:
More details: Here's the memray graph:
I also tested this with just
write_deltalake(mode="append")
, and the issue seems to also persist:I saw https://github.com/delta-io/delta-rs/issues/2068 and tried setting that env var, and got the following (doesn't seem to help):