Closed JonasIsensee closed 7 months ago
Currently, I observe the following steady increase in memory upon repeated triangulations eventually leading to OOM errors:
julia> using GeometryBasics julia> points = Point2f.(reverse.(sincos.(0:0.01:2π))); julia> triang = GeometryBasics.earcut_triangulate([points]); julia> Sys.maxrss()/2^20 433.01171875 julia> @time for i=1:10^5 GeometryBasics.earcut_triangulate([points]); end 19.742204 seconds (500.00 k allocations: 30.518 MiB, 0.06% gc time) julia> GC.gc(true) julia> Sys.maxrss()/2^20 1156.88671875 julia> @time for i=1:10^5 GeometryBasics.earcut_triangulate([points]); end 19.175300 seconds (500.00 k allocations: 30.518 MiB) julia> GC.gc(true) julia> Sys.maxrss()/2^20 1873.0859375
With this PR:
julia> points = Point2f.(reverse.(sincos.(0:0.01:2π))); julia> triang = GeometryBasics.earcut_triangulate([points]); julia> Sys.maxrss()/2^20 411.16796875 julia> @time for i=1:10^5 GeometryBasics.earcut_triangulate([points]); end 21.869706 seconds (500.00 k allocations: 748.062 MiB, 1.02% gc time) julia> GC.gc(true) julia> Sys.maxrss()/2^20 438.33203125 julia> @time for i=1:10^5 GeometryBasics.earcut_triangulate([points]); end 21.142299 seconds (500.00 k allocations: 748.062 MiB, 0.17% gc time) julia> GC.gc(true) julia> Sys.maxrss()/2^20 438.33203125
Currently, I observe the following steady increase in memory upon repeated triangulations eventually leading to OOM errors:
With this PR: