Skip to content
This repository has been archived by the owner on Dec 23, 2020. It is now read-only.

Rhino.Geometry.Intersect.Intersection.MeshLine is leaking memory #141

Open
DavidRutten opened this issue May 2, 2013 · 6 comments
Open
Assignees

Comments

@DavidRutten
Copy link
Member

Successive calls to Intersection.MeshLine increase memory consumption which never goes away. The same does not happen for MeshRay intersections, memory consumption remains flat.

@ghost ghost assigned sbaer May 2, 2013
@sbaer
Copy link
Member

sbaer commented May 2, 2013

Are you making successive calls on the same mesh? The first time this function is called on a mesh, a searching data structure is created and hung off of the mesh for reuse in future intersection calls. A memory increase the first time the MeshLine function is called for a mesh it is expected to increase the memory consumption. If the memory is continuing to increase on by calling MeshLine on the same mesh over and over, then that is not expected and is a buig. Could you please verify what is going on since you probably already have some sort of test case set up? Thanks

@DavidRutten
Copy link
Member Author

I'll write a small C# script that duplicates the issue. But the fact remains that MeshRay with the exact same meshes does not boost memory whereas MeshLine does.

@goswinr
Copy link

goswinr commented May 7, 2013

hi Steve,
It would be nice to know which functions in RhCommon do build up a searching data structure on the first call. Can I find this info in the scoure code?.
I have been doing a lot of spatial searching recently on pointclouds and lineclouds. usually brut force with O(n²).
I am thinking of using the RTree class instead.
However if for example Mesh.ClosestPoint or PointCloud.ClosestPoint also built up similar internal searching data structure I might just use those.

thanks Goswin

@sbaer
Copy link
Member

sbaer commented May 7, 2013

Good point Goswin. We should try to provide comments in places where we build up search structures since they will be slow the first time they are called and very fast on calls after the first one.

@Autogen
Copy link

Autogen commented Jun 15, 2013

I was looking for MeshLine intersection issue and came up with this discussion. Three known people are discussing same issue. My question is answered . Thanks! Looks like it is a bug if it is running very slow or crashing.
Goswin is a friend/collegue of mine from London. And we all know David and Steve :)

@HanselYan
Copy link

Is it fixed? I met the same issue. I have a definition to calculate visibility analysis. Rhino.Geometry.Intersect.Intersection.MeshLine kills all memory. At the beginning, I believe it's the issue of multi-thread. After digging into every line of code, it turns out Intersection.MeshLine eats all memory.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants