home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 1035593183

This data as json

html_url issue_url id node_id user created_at updated_at author_association body reactions performed_via_github_app issue
https://github.com/pydata/xarray/issues/2186#issuecomment-1035593183 https://api.github.com/repos/pydata/xarray/issues/2186 1035593183 IC_kwDOAMm_X849ueXf 2273361 2022-02-10T22:24:37Z 2022-02-10T22:24:37Z NONE

Hey folks, I ran into a similar memory leak issue. In my case a had the following:

for num in range(100):
    ds = xr.open_dataset('data.{}.nc'.format(num)) # This data was compressed with zlib, not sure if that matters

    # do some stuff, but NOT assigning any data in ds to new variables

    del ds

For some reason (maybe having to do with the # do some stuff), ds wasn't actually getting cleared. I was able to fix the problem by manually triggering garbage collection (import gc, and gc.collect() after the del ds statement). Perhaps this will help others who end up here...

{
    "total_count": 2,
    "+1": 2,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  326533369
Powered by Datasette · Queries took 0.822ms · About: xarray-datasette