Turfjs / Turfjs/turf

turf.disolve crashes

Open
#2,854 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

polyclip-ts
Dominant language
TypeScript
Stars
10.5k
Forks
1k
Avg merge
1h 11m
Merged PRs (30d)
4

Description

turftest2.zip

Please see the enclosed turftest2.js program that using turf 7.2 generates the following output when calling turf.dissolve. Since there is a crash and no error, we could really use a fix or work around to apply. Prior to the dissolve, I am already doing fc = turf.truncate(fc, {precision: 6, mutate:true});

BEFORE
<--- Last few GCs --->

[1540546:0x5560efef6a80] 501159 ms: Mark-Compact 4017.9 (4128.7) -> 4002.3 (4129.0) MB, 1085.24 / 0.00 ms (average mu = 0.099, current mu = 0.014) allocation failure; scavenge might not succeed
[1540546:0x5560efef6a80] 502118 ms: Mark-Compact 4018.2 (4129.0) -> 4002.4 (4129.0) MB, 938.41 / 0.00 ms (average mu = 0.063, current mu = 0.021) allocation failure; scavenge might not succeed

<--- JS stacktrace --->

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
----- Native stack trace -----

1: 0x5560ec6bd79a [node]
2: 0x5560eca8bda4 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [node]
3: 0x5560eca8c065 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [node]
4: 0x5560ecc81fbb [node]
5: 0x5560ecc894fc [node]
6: 0x5560ecc9c480 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::internal::GarbageCollectionReason, char const*) [node]
7: 0x5560ecc9cfb5 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]
8: 0x5560ecc78451 v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node]
9: 0x5560ecc7954a v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node]
10: 0x5560ecc5af72 v8::internal::Factory::NewFillerObject(int, v8::internal::AllocationAlignment, v8::internal::AllocationType, v8::internal::AllocationOrigin) [node]
11: 0x5560ed04fc79 v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [node]
12: 0x55608d419ef6
Aborted (core dumped)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the attached turftest2.js with Turf 7.2 and inspect the call to turf.dissolve after turf.truncate. Trace the dissolve path while monitoring memory usage; done means the reproducer no longer exhausts the Node.js heap and produces the expected dissolved output.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
data, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.