Skip to content

Out of memory after intersects(s1, s2) #206

@Ronneesley

Description

@Ronneesley

Hello,

First of all, congrats for your work. It's owesome!

I'm working with your module, and need check 100 thousands of intersections.
After doing my loop, my memory is empty, it's about 32 GB. Although the shapes are small.
Here a sample of my code that the problem can be observed:

for i = 1:100000
    LibGEOS.intersects(shape2, shape1)
end

I observed that the problem happends even when I check the intersection of two small shapes many times.

I don't know why the problem happens, but I suspect of some global data. Inspecting the code at: https://github.com/JuliaGeo/LibGEOS.jl/blob/master/src/geos_functions.jl, I saw the context variable that could be linked at shape, that is a global variable at my code, because it is at a dataframe (Dataframes.jl), I read like this:

using Shapefile, DataFrames
table = Shapefile.Table(path)
df = DataFrame(table)

If it's the problem, how could I clear this context? If it isn't the problem, how can I check the interssection without lack of memory?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions