Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible cyclic references in pandas #3351

Closed
ghost opened this issue Apr 14, 2013 · 4 comments
Closed

Possible cyclic references in pandas #3351

ghost opened this issue Apr 14, 2013 · 4 comments
Labels
Performance Memory or execution speed performance
Milestone

Comments

@ghost
Copy link

ghost commented Apr 14, 2013

recent change in test_perf (now worked around, but present in d7617d3 for example)
disabled the gc when doing multiple runs on the same vb (just in case).

Though usage, this appears to cause memory exhaustion for large N, which is
an indication that cyclic refs are being created somewhere. invoking gc.collect()
clears the memory (so it's not the malloc.trim issue from #2659)

It might be another dependency, not pandas that's causing this but need to check.

repro:

git reset --hard d7617d3
python ./setup.py develop
./test_perf.sh -H -N 500 -r frame_get_numeric_data
# monitor memory

See also comments in #4491

@jreback
Copy link
Contributor

jreback commented Jan 3, 2014

This does not appear to leak

maybe a refernce is kept around in the test?
(their IS copying of the blocks, so if a ref is held memory will increase)

import gc
from time import sleep
import pandas as pd
import numpy as np
df = pd.DataFrame(np.random.randn(10000, 25))
df['foo'] = 'bar'
df['bar'] = 'baz'
df = df.consolidate()

for i in range(1000):
    print i
    df._get_numeric_data()
    sleep(0.1)
    # this is optional
    if i % 100 == 0:
          gc.collect()

@ghost
Copy link
Author

ghost commented Jan 3, 2014

This was a long time ago and I don't remember the details.
If you reset to the commit mentioned and run the test, doesn't the memory grow without bound?

I just came across the comments in #4491 on cycles and remembered I opened an issue
on it and so dropped in the xref. afaict, those comments are still valid and there are memory
cycles hiding somewhere.

The problem here may be with the test, though, as you say.

@jreback
Copy link
Contributor

jreback commented Jan 3, 2014

I am sure that their are memory cycles hidden!

@jreback jreback modified the milestones: 0.15.0, 0.14.0 Mar 9, 2014
@jreback
Copy link
Contributor

jreback commented Jan 26, 2015

closing as stale

@jreback jreback closed this as completed Jan 26, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Performance Memory or execution speed performance
Projects
None yet
Development

No branches or pull requests

1 participant