Cyclic GC issues
See original GitHub issueA mystery to be debugged soon:
import pandas as pd
import numpy as np
arr = np.random.randn(100000, 5)
def leak():
for i in xrange(10000):
df = pd.DataFrame(arr.copy())
result = df.xs(1000)
# result = df.ix[5000]
if __name__ == '__main__':
leak()
Issue Analytics
- State:
- Created 11 years ago
- Reactions:9
- Comments:20 (5 by maintainers)
Top Results From Across the Web
Garbage Collection and Cyclic References in Java - Baeldung
In this quick article, we'll see how the JVM makes sure to collect the unreachable but cyclic references. First, we'll explore different ...
Read more >How does Java Garbage Collection work with Circular ...
Java's GC considers objects "garbage" if they aren't reachable through a chain starting at a garbage collection root, so these objects will ...
Read more >Garbage Collector Design - Python Developer's Guide
This is the cyclic garbage collector, usually called just Garbage Collector (GC), even though reference counting is also a form of garbage collection....
Read more >Garbage collection in Python: things you need to know
The reference counting algorithm has a lot of issues, such as circular references, thread locking, and memory and performance overhead.
Read more >Garbage Collection and Application Performance - Dynatrace
The more objects die, the faster garbage collection is. If every object in the heap were to be garbage-collected, the GC cycle would...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
For the record, we (+@sbneto) are using this in preduction for a bit of time, and is doing very good:
Ok, this is, in a word, f*cked up. If I add gc.collect to that for loop it stops leaking memory:
There are objects here that only get garbage collected when the cyclic GC runs. What’s the solution here, break cycle explicitly in
__del__
so the Python memory allocator stops screwing us?