rstacruz / kingraph

Plots family trees using JavaScript and Graphviz
439 stars 86 forks source link

Issue with very large families #6

Open Tb8854 opened 6 years ago

Tb8854 commented 6 years ago

Hello,

When I go for a large family (which works in smaller chunks) I have the following error

When I run the following

kingraph myfamily_all.yml -F png > myfamily_all.png

I get the following result.

Cannot enlarge memory arrays. Either (1) compile with  -s TOTAL_MEMORY=X  with X higher than the current value 16777216, (2) compile with  -s ALLOW_MEMORY_GROWTH=1  which adjusts the size at runtime but prevents some optimizations, (3) set Module.TOTAL_MEMORY to a higher value before the program runs, or if you want malloc to return NULL (0) instead of this abort, compile with  -s ABORTING_MALLOC=0 
abort("Cannot enlarge memory arrays. Either (1) compile with  -s TOTAL_MEMORY=X  with X higher than the current value 16777216, (2) compile with  -s ALLOW_MEMORY_GROWTH=1  which adjusts the size at runtime but prevents some optimizations, (3) set Module.TOTAL_MEMORY to a higher value before the program runs, or if you want malloc to return NULL (0) instead of this abort, compile with  -s ABORTING_MALLOC=0 ") at Error
    at jsStackTrace (/usr/local/lib/node_modules/kingraph/node_modules/viz.js/viz.js:5:20800)
    at stackTrace (/usr/local/lib/node_modules/kingraph/node_modules/viz.js/viz.js:5:20983)
    at abort (/usr/local/lib/node_modules/kingraph/node_modules/viz.js/viz.js:28:5424)
    at abortOnCannotGrowMemory (/usr/local/lib/node_modules/kingraph/node_modules/viz.js/viz.js:5:21343)
    at enlargeMemory (/usr/local/lib/node_modules/kingraph/node_modules/viz.js/viz.js:5:21788)
    at Function.dynamicAlloc [as alloc] (/usr/local/lib/node_modules/kingraph/node_modules/viz.js/viz.js:5:6269)
    at _sbrk (/usr/local/lib/node_modules/kingraph/node_modules/viz.js/viz.js:5:602676)
    at N4 (/usr/local/lib/node_modules/kingraph/node_modules/viz.js/viz.js:21:7406)
    at cK (/usr/local/lib/node_modules/kingraph/node_modules/viz.js/viz.js:13:185312)
    at bK (/usr/local/lib/node_modules/kingraph/node_modules/viz.js/viz.js:13:185061)
If this abort() is unexpected, build with -s ASSERTIONS=1 which can give more information.

Adding options (1), (2) or (3) has no effect. The family isn't that big - around 200 lines and 400-500 people in 10 houses.

Any advice appreciated.

Mac OS 10.13.3

vsmalladi commented 6 years ago

I also have this issue.

janisz commented 6 years ago

It looks like it's a problem with viz.js. Temporary workaround is to use dot

kingraph family.yaml --format=dot > family.dot  && dot -Tsvg family.dot > family.svg
rstacruz commented 6 years ago

Thanks for the help debugging the issue!

rstacruz commented 6 years ago

This seems to be worth at least documenting somewhere. Let's see if updating viz.js would help too.

janisz commented 6 years ago

We can try increase totalMemory like proposed here https://github.com/mdaines/viz.js/issues/89 or heere https://github.com/mdaines/viz.js/issues/23

momack2 commented 5 years ago

In case anyone else is curious - I fixed this by changing the totalMemory variable in viz.js with this line: sudo sed -i '' -e 's/|16777216/|1677721600/' viz.js - that allows viz to use ~1.6GB